cross compile build script
[fishladder.git] / vg / vg_tex.h
index a9c24c0a68cd4e27e58cc801c248a0b521c8e842..4c14540ca431a4b5404534dc5d44f27938e04467 100644 (file)
@@ -12,6 +12,11 @@ struct vg_tex2d
        GLuint name;
 };
 
+struct vg_sprite
+{
+       v4f uv_xywh;
+};
+
 static void vg_tex2d_bind( vg_tex2d *tex, u32 id )
 {
        glActiveTexture( GL_TEXTURE0 + id );
@@ -55,8 +60,6 @@ static inline void vg_tex2d_clamp(void)
 
 static GLuint vg_tex2d_rgba( const char *path )
 {
-       int x,y;
-
        i64 length;
        u8 *src_data = vg_asset_read_s( path, &length );
        
@@ -66,9 +69,10 @@ static GLuint vg_tex2d_rgba( const char *path )
        
        if( src_data )
        {
-               u8 *tex_buffer = qoi_decode( src_data, length, &x, &y, 4 );
+               qoi_desc info;
+               u8 *tex_buffer = qoi_decode( src_data, length, &info, 4 );
                
-               glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, x, y, 0, GL_RGBA, GL_UNSIGNED_BYTE, tex_buffer );
+               glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, info.width, info.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, tex_buffer );
                
                free( tex_buffer );
                free( src_data );