logger update
[vg.git] / vg_tex.h
index 1fd2d5a29cf293306ffa4c0bb19e19c17bf947e9..ac5920a480c126f806eabe453dc9f4dfe86eee84 100644 (file)
--- a/vg_tex.h
+++ b/vg_tex.h
 #define STB_IMAGE_WRITE_IMPLEMENTATION
 #include "vg/submodules/stb/stb_image_write.h"
 
+/* its a sad day. */
+#if 0
+#define STBI_MALLOC(X) 
+#define STBI_REALLOC(X,Y)
+#define STBI_FREE(X)
+#endif
+
+#define STBI_ONLY_JPEG
+#define STBI_NO_THREAD_LOCALS
+#define STB_IMAGE_IMPLEMENTATION
+#include "vg/submodules/stb/stb_image.h"
+
 struct vg_sprite
 {
        v4f uv_xywh;
@@ -116,6 +128,10 @@ struct texture_load_info{
 
 VG_STATIC void async_vg_tex2d_upload( void *payload, u32 size )
 {
+   if( vg_thread_purpose() != k_thread_purpose_main ){
+      vg_fatal_error( "Catastrophic programming error.\n" );
+   }
+
    struct texture_load_info *info = payload;
 
        glGenTextures( 1, info->dest );