Commit 0e40deb8 authored by Nicolas.Rougier's avatar Nicolas.Rougier

Put code to C89 norm and fix CMakefile

parent 8d87f1a5
......@@ -38,7 +38,9 @@ OPTION(freetype-gl_BUILD_DEMOS "Build the freetype-gl example programs" ON)
# Get required and optional library
FIND_PACKAGE( OpenGL REQUIRED )
IF( WIN32 )
IF( WIN32 OR WIN64 )
SET( WINDOWS_DIR
${CMAKE_CURRENT_SOURCE_DIR}/windows )
SET( GLUT_INCLUDE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/windows/glut )
SET( GLUT_GLUT_LIBRARY
......@@ -54,14 +56,15 @@ IF( WIN32 )
SET( ANT_TWEAK_BAR_LIBRARY
${CMAKE_CURRENT_SOURCE_DIR}/windows/AntTweakBar/lib/AntTweakBar.lib )
SET( ANT_TWEAK_BAR_FOUND "YES" )
ELSE( WIN32 )
ELSE( WIN32 OR WIN64 )
FIND_PACKAGE( GLUT REQUIRED )
FIND_PACKAGE( Freetype REQUIRED )
FIND_PACKAGE( GLEW REQUIRED )
FIND_PACKAGE( FontConfig )
FIND_LIBRARY( MATH_LIBRARY m )
#FIND_LIBRARY( STDC_LIBRARY stdc++) #Buggy Cmake can't find libstdc++
FIND_PACKAGE( AntTweakBar )
ENDIF( WIN32 )
ENDIF( WIN32 OR WIN64 )
# Untested
if(MSVC)
......@@ -75,6 +78,7 @@ endif()
INCLUDE_DIRECTORIES( ${GLUT_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS}
${GLEW_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR} )
SET( FREETYPE_GL_LIBRARY freetype-gl )
......@@ -100,8 +104,10 @@ LINK_DIRECTORIES(${PROJECT_SOURCE_DIR})
MACRO( DEMO _target _sources)
add_executable(${_target} ${_sources})
include_directories(${WINDOWS_DIR} ${GLUT_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2} ${ANT_TWEAK_BAR_INCLUDE_PATH})
target_link_libraries(${_target} ${FREETYPE_GL_LIBRARY})
target_link_libraries(${_target} ${OPENGL_LIBRARY})
target_link_libraries(${_target} ${GLEW_LIBRARY})
target_link_libraries(${_target} freetype-gl)
target_link_libraries(${_target} ${GLUT_LIBRARY})
target_link_libraries(${_target} ${FREETYPE_LIBRARY})
......@@ -148,6 +154,7 @@ IF (ANT_TWEAK_BAR_FOUND)
add_executable(demo-atb-agg demo-atb-agg.c)
target_link_libraries( demo-atb-agg ${FREETYPE_GL_LIBRARY})
target_link_libraries( demo-atb-agg ${GLUT_LIBRARY})
target_link_libraries( demo-atb-agg ${GLEW_LIBRARY})
target_link_libraries( demo-atb-agg ${FREETYPE_LIBRARY})
target_link_libraries( demo-atb-agg ${ANT_TWEAK_BAR_LIBRARY})
# target_link_libraries( demo-atb-agg ${STDC_LIBRARY}) # Buggy Cmake can't find libstdc++
......@@ -162,9 +169,18 @@ IF (ANT_TWEAK_BAR_FOUND)
endif()
ENDIF (ANT_TWEAK_BAR_FOUND)
# Copy font and shaders into build directory for in-place testing
FILE(GLOB fonts "fonts/*.ttf")
file(COPY ${Fonts} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Fonts)
FILE(GLOB Fonts "fonts/Vera.ttf"
"fonts/VeraMoBI.ttf"
"fonts/VeraMoBd.ttf"
"fonts/VeraMoIt.ttf"
"fonts/VeraMono.ttf")
file(COPY ${Fonts} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/fonts)
FILE(GLOB Data "data/256colors.txt")
file(COPY ${Data} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data)
FILE(GLOB Shaders "shaders/*.vert" "shaders/*.frag")
file(COPY ${Shaders} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/shaders)
......
......@@ -61,3 +61,4 @@ Contributors:
* quarnster (Bug report & fix)
* Per Inge Mathisen (Bug report & fix)
* Wojciech Mamrak (Code review, bug report & fix)
* Wael Eloraiby (Put code to the C89 norm and fix CMakefile)
......@@ -33,6 +33,8 @@
*/
#if defined(__APPLE__)
#include <Glut/glut.h>
#elif defined(_WIN32) || defined(_WIN64)
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
......
......@@ -93,10 +93,10 @@ font_manager_new( size_t width, size_t height, size_t depth )
void
font_manager_delete( font_manager_t * self )
{
assert( self );
size_t i;
texture_font_t *font;
assert( self );
for( i=0; i<vector_size( self->fonts ); ++i)
{
font = *(texture_font_t **) vector_get( self->fonts, i );
......@@ -119,10 +119,11 @@ font_manager_delete_font( font_manager_t * self,
texture_font_t * font)
{
size_t i;
texture_font_t *other;
assert( self );
assert( font );
texture_font_t *other;
for( i=0; i<self->fonts->size;++i )
{
other = (texture_font_t *) vector_get( self->fonts, i );
......@@ -176,12 +177,11 @@ font_manager_get_from_description( font_manager_t *self,
const int bold,
const int italic )
{
assert( self );
texture_font_t *font;
char *filename = 0;
assert( self );
if( file_exists( family ) )
{
filename = strdup( family );
......
......@@ -280,7 +280,7 @@ int main( int argc, char **argv )
fwprintf( file, L" {L'\\%lc', ", glyph->charcode );
//wprintf( L" {L'\\%lc', ", glyph->charcode );
}
else if( (glyph->charcode == (wchar_t)(-1) ) )
else if( glyph->charcode == (wchar_t)(-1) )
{
fwprintf( file, L" {L'\\0', " );
//wprintf( L" {L'\\0', " );
......
......@@ -72,11 +72,12 @@ mat4_set_identity( mat4 *self )
void
mat4_multiply( mat4 *self, mat4 *other )
{
mat4 m;
size_t i;
assert( self );
assert( other );
mat4 m;
size_t i;
for( i=0; i<4; ++i )
{
m.data[i*4+0] =
......@@ -135,11 +136,14 @@ mat4_set_perspective( mat4 *self,
float fovy, float aspect,
float znear, float zfar)
{
float h, w;
assert( self );
assert( znear != zfar );
float h = tan(fovy / 360.0 * M_PI) * znear;
float w = h * aspect;
h = tan(fovy / 360.0 * M_PI) * znear;
w = h * aspect;
mat4_set_frustum( self, -w, w, -h, h, znear, zfar );
}
......@@ -174,11 +178,14 @@ mat4_set_rotation( mat4 *self,
float angle,
float x, float y, float z)
{
float c, s, norm;
assert( self );
float c = cos( M_PI*angle/180.0 );
float s = sin( M_PI*angle/180.0 );
float norm = sqrt(x*x+y*y+z*z);
c = cos( M_PI*angle/180.0 );
s = sin( M_PI*angle/180.0 );
norm = sqrt(x*x+y*y+z*z);
x /= norm; y /= norm; z /= norm;
mat4_set_identity( self );
......@@ -225,9 +232,10 @@ mat4_rotate( mat4 *self,
float angle,
float x, float y, float z)
{
mat4 m;
assert( self );
mat4 m;
mat4_set_rotation( &m, angle, x, y, z);
mat4_multiply( self, &m );
}
......@@ -236,9 +244,9 @@ void
mat4_translate( mat4 *self,
float x, float y, float z)
{
mat4 m;
assert( self );
mat4 m;
mat4_set_translation( &m, x, y, z);
mat4_multiply( self, &m );
}
......@@ -247,9 +255,9 @@ void
mat4_scale( mat4 *self,
float x, float y, float z)
{
mat4 m;
assert( self );
mat4 m;
mat4_set_scaling( &m, x, y, z);
mat4_multiply( self, &m );
}
......@@ -68,11 +68,11 @@ GLuint
shader_compile( const char* source,
const GLenum type )
{
GLint compile_status;
GLuint handle = glCreateShader( type );
glShaderSource( handle, 1, &source, 0 );
glCompileShader( handle );
GLint compile_status;
glGetShaderiv( handle, GL_COMPILE_STATUS, &compile_status );
if( compile_status == GL_FALSE )
{
......@@ -91,6 +91,7 @@ shader_load( const char * vert_filename,
const char * frag_filename )
{
GLuint handle = glCreateProgram( );
GLint link_status;
if( vert_filename && strlen( vert_filename ) )
{
......@@ -108,7 +109,7 @@ shader_load( const char * vert_filename,
}
glLinkProgram( handle );
GLint link_status;
glGetProgramiv( handle, GL_LINK_STATUS, &link_status );
if (link_status == GL_FALSE)
{
......
......@@ -115,13 +115,13 @@ text_buffer_printf( text_buffer_t * self, vec2 *pen, ... )
{
markup_t *markup;
wchar_t *text;
va_list args;
if( vertex_buffer_size( self->buffer ) == 0 )
{
self->origin = *pen;
}
va_list args;
va_start ( args, pen );
do {
markup = va_arg( args, markup_t * );
......@@ -160,6 +160,7 @@ text_buffer_add_text( text_buffer_t * self,
wchar_t * text, size_t length )
{
font_manager_t * manager = self->manager;
size_t i;
if( markup == NULL )
{
......@@ -185,7 +186,6 @@ text_buffer_add_text( text_buffer_t * self,
self->origin = *pen;
}
size_t i;
text_buffer_add_wchar( self, pen, markup, text[0], 0 );
for( i=1; i<length; ++i )
{
......@@ -213,7 +213,10 @@ text_buffer_add_wchar( text_buffer_t * self,
// - 2 triangles for glyph
glyph_vertex_t vertices[4*5];
GLuint indices[6*5];
texture_glyph_t *glyph;
texture_glyph_t *black;
float kerning = 0;
if( current == L'\n' )
{
pen->x = self->origin.x;
......@@ -236,15 +239,14 @@ text_buffer_add_wchar( text_buffer_t * self,
self->line_descender = markup->font->descender;
}
texture_glyph_t *glyph = texture_font_get_glyph( font, current );
texture_glyph_t *black = texture_font_get_glyph( font, -1 );
glyph = texture_font_get_glyph( font, current );
black = texture_font_get_glyph( font, -1 );
if( glyph == NULL )
{
return;
}
float kerning = 0;
if( previous && markup->font->kerning )
{
kerning = texture_glyph_get_kerning( glyph, previous );
......@@ -384,38 +386,39 @@ text_buffer_add_wchar( text_buffer_t * self,
vcount += 4;
icount += 6;
}
{
// Actual glyph
float r = markup->foreground_color.red;
float g = markup->foreground_color.green;
float b = markup->foreground_color.blue;
float a = markup->foreground_color.alpha;
float x0 = ( pen->x + glyph->offset_x );
float y0 = (int)( pen->y + glyph->offset_y );
float x1 = ( x0 + glyph->width );
float y1 = (int)( y0 - glyph->height );
float s0 = glyph->s0;
float t0 = glyph->t0;
float s1 = glyph->s1;
float t1 = glyph->t1;
// Actual glyph
float r = markup->foreground_color.red;
float g = markup->foreground_color.green;
float b = markup->foreground_color.blue;
float a = markup->foreground_color.alpha;
float x0 = ( pen->x + glyph->offset_x );
float y0 = (int)( pen->y + glyph->offset_y );
float x1 = ( x0 + glyph->width );
float y1 = (int)( y0 - glyph->height );
float s0 = glyph->s0;
float t0 = glyph->t0;
float s1 = glyph->s1;
float t1 = glyph->t1;
SET_GLYPH_VERTEX(vertices[vcount+0],
(int)x0,y0,0, s0,t0, r,g,b,a, x0-((int)x0), gamma );
SET_GLYPH_VERTEX(vertices[vcount+1],
(int)x0,y1,0, s0,t1, r,g,b,a, x0-((int)x0), gamma );
SET_GLYPH_VERTEX(vertices[vcount+2],
(int)x1,y1,0, s1,t1, r,g,b,a, x1-((int)x1), gamma );
SET_GLYPH_VERTEX(vertices[vcount+3],
(int)x1,y0,0, s1,t0, r,g,b,a, x1-((int)x1), gamma );
indices[icount + 0] = vcount+0;
indices[icount + 1] = vcount+1;
indices[icount + 2] = vcount+2;
indices[icount + 3] = vcount+0;
indices[icount + 4] = vcount+2;
indices[icount + 5] = vcount+3;
vcount += 4;
icount += 6;
SET_GLYPH_VERTEX(vertices[vcount+0],
(int)x0,y0,0, s0,t0, r,g,b,a, x0-((int)x0), gamma );
SET_GLYPH_VERTEX(vertices[vcount+1],
(int)x0,y1,0, s0,t1, r,g,b,a, x0-((int)x0), gamma );
SET_GLYPH_VERTEX(vertices[vcount+2],
(int)x1,y1,0, s1,t1, r,g,b,a, x1-((int)x1), gamma );
SET_GLYPH_VERTEX(vertices[vcount+3],
(int)x1,y0,0, s1,t0, r,g,b,a, x1-((int)x1), gamma );
indices[icount + 0] = vcount+0;
indices[icount + 1] = vcount+1;
indices[icount + 2] = vcount+2;
indices[icount + 3] = vcount+0;
indices[icount + 4] = vcount+2;
indices[icount + 5] = vcount+3;
vcount += 4;
icount += 6;
vertex_buffer_push_back( buffer, vertices, vcount, indices, icount );
pen->x += glyph->advance_x * (1.0 + markup->spacing);
vertex_buffer_push_back( buffer, vertices, vcount, indices, icount );
pen->x += glyph->advance_x * (1.0 + markup->spacing);
}
}
......@@ -46,9 +46,13 @@ texture_atlas_new( const size_t width,
const size_t height,
const size_t depth )
{
assert( (depth == 1) || (depth == 3) || (depth == 4) );
texture_atlas_t *self = (texture_atlas_t *) malloc( sizeof(texture_atlas_t) );
// We want a one pixel border around the whole atlas to avoid any artefact when
// sampling texture
ivec3 node = {{1,1,width-2}};
assert( (depth == 1) || (depth == 3) || (depth == 4) );
if( self == NULL)
{
fprintf( stderr,
......@@ -62,10 +66,6 @@ texture_atlas_new( const size_t width,
self->depth = depth;
self->id = 0;
// We want a one pixel border around the whole atlas to avoid any artefact when
// sampling texture
ivec3 node = {{1,1,width-2}};
vector_push_back( self->nodes, &node );
self->data = (unsigned char *)
calloc( width*height*depth, sizeof(unsigned char) );
......@@ -109,6 +109,10 @@ texture_atlas_set_region( texture_atlas_t * self,
const unsigned char * data,
const size_t stride )
{
size_t i;
size_t depth;
size_t charsize;
assert( self );
assert( x > 0);
assert( y > 0);
......@@ -117,9 +121,8 @@ texture_atlas_set_region( texture_atlas_t * self,
assert( y < (self->height-1));
assert( (y + height) <= (self->height-1));
size_t i;
size_t depth = self->depth;
size_t charsize = sizeof(char);
depth = self->depth;
charsize = sizeof(char);
for( i=0; i<height; ++i )
{
memcpy( self->data+((y+i)*self->width + x ) * charsize * depth,
......@@ -135,11 +138,17 @@ texture_atlas_fit( texture_atlas_t * self,
const size_t width,
const size_t height )
{
ivec3 *node;
int x, y, width_left;
size_t i;
assert( self );
ivec3 *node = (ivec3 *) (vector_get( self->nodes, index ));
int x = node->x, y, width_left = width;
size_t i = index;
node = (ivec3 *) (vector_get( self->nodes, index ));
x = node->x;
y = node->y;
width_left = width;
i = index;
if ( (x + width) > (self->width-1) )
{
......@@ -168,11 +177,11 @@ texture_atlas_fit( texture_atlas_t * self,
void
texture_atlas_merge( texture_atlas_t * self )
{
assert( self );
ivec3 *node, *next;
size_t i;
assert( self );
for( i=0; i< self->nodes->size-1; ++i )
{
node = (ivec3 *) (vector_get( self->nodes, i ));
......@@ -193,13 +202,14 @@ texture_atlas_get_region( texture_atlas_t * self,
const size_t width,
const size_t height )
{
assert( self );
int y, best_height, best_width, best_index;
ivec3 *node, *prev;
ivec4 region = {{0,0,width,height}};
size_t i;
assert( self );
best_height = INT_MAX;
best_index = -1;
best_width = INT_MAX;
......@@ -278,6 +288,8 @@ texture_atlas_get_region( texture_atlas_t * self,
void
texture_atlas_clear( texture_atlas_t * self )
{
ivec3 node = {{1,1,1}};
assert( self );
assert( self->data );
......@@ -285,7 +297,8 @@ texture_atlas_clear( texture_atlas_t * self )
self->used = 0;
// We want a one pixel border around the whole atlas to avoid any artefact when
// sampling texture
ivec3 node = {{1,1,self->width-2}};
node.z = self->width-2;
vector_push_back( self->nodes, &node );
memset( self->data, 0, self->width*self->height*self->depth );
}
......
......@@ -65,10 +65,6 @@ texture_font_load_face( FT_Library * library,
const float size,
FT_Face * face )
{
assert( library );
assert( filename );
assert( size );
size_t hres = 64;
FT_Error error;
FT_Matrix matrix = { (int)((1.0/hres) * 0x10000L),
......@@ -76,6 +72,10 @@ texture_font_load_face( FT_Library * library,
(int)((0.0) * 0x10000L),
(int)((1.0) * 0x10000L) };
assert( library );
assert( filename );
assert( size );
/* Initialize library */
error = FT_Init_FreeType( library );
if( error )
......@@ -186,14 +186,14 @@ texture_glyph_get_kerning( const texture_glyph_t * self,
void
texture_font_generate_kerning( texture_font_t *self )
{
assert( self );
size_t i, j;
FT_Library library;
FT_Face face;
FT_UInt glyph_index, prev_index;
texture_glyph_t *glyph, *prev_glyph;
FT_Vector kerning;
assert( self );
/* Load font */
if( !texture_font_load_face( &library, self->filename, self->size, &face ) )
......@@ -237,10 +237,14 @@ texture_font_new( texture_atlas_t * atlas,
const char * filename,
const float size)
{
texture_font_t *self = (texture_font_t *) malloc( sizeof(texture_font_t) );
FT_Library library;
FT_Face face;
FT_Size_Metrics metrics;
assert( filename );
assert( size );
texture_font_t *self = (texture_font_t *) malloc( sizeof(texture_font_t) );
if( self == NULL)
{
fprintf( stderr,
......@@ -268,8 +272,7 @@ texture_font_new( texture_atlas_t * atlas,
self->lcd_weights[4] = 0x10;
/* Get font metrics at high resolution */
FT_Library library;
FT_Face face;
if( !texture_font_load_face( &library, self->filename, self->size*100, &face ) )
{
return self;
......@@ -291,7 +294,7 @@ texture_font_new( texture_atlas_t * atlas,
self->underline_thickness = 1.0;
}
FT_Size_Metrics metrics = face->size->metrics;
metrics = face->size->metrics;
self->ascender = (metrics.ascender >> 6) / 100.0;
self->descender = (metrics.descender >> 6) / 100.0;
self->height = (metrics.height >> 6) / 100.0;
......@@ -310,6 +313,9 @@ texture_font_new( texture_atlas_t * atlas,
void
texture_font_delete( texture_font_t *self )
{
size_t i;
texture_glyph_t *glyph;
assert( self );
if( self->filename )
......@@ -317,8 +323,7 @@ texture_font_delete( texture_font_t *self )
free( self->filename );
}
size_t i;
texture_glyph_t *glyph;
for( i=0; i<vector_size( self->glyphs ); ++i)
{
glyph = *(texture_glyph_t **) vector_get( self->glyphs, i );
......@@ -335,9 +340,6 @@ size_t
texture_font_load_glyphs( texture_font_t * self,
const wchar_t * charcodes )
{
assert( self );
assert( charcodes );
size_t i, x, y, width, height, depth, w, h;
FT_Library library;
FT_Error error;
......@@ -350,6 +352,11 @@ texture_font_load_glyphs( texture_font_t * self,
texture_glyph_t *glyph;
ivec4 region;
size_t missed = 0;
assert( self );
assert( charcodes );
width = self->atlas->width;
height = self->atlas->height;
depth = self->atlas->depth;
......@@ -362,10 +369,15 @@ texture_font_load_glyphs( texture_font_t * self,
/* Load each glyph */
for( i=0; i<wcslen(charcodes); ++i )
{
FT_Int32 flags = 0;
int ft_bitmap_width = 0;
int ft_bitmap_rows = 0;
int ft_bitmap_pitch = 0;
int ft_glyph_top = 0;
int ft_glyph_left = 0;
glyph_index = FT_Get_Char_Index( face, charcodes[i] );
// WARNING: We use texture-atlas depth to guess if user wants
// LCD subpixel rendering
FT_Int32 flags = 0;
if( self->outline_type > 0 )
{
......@@ -405,11 +417,7 @@ texture_font_load_glyphs( texture_font_t * self,
return wcslen(charcodes)-i;
}
int ft_bitmap_width = 0;
int ft_bitmap_rows = 0;
int ft_bitmap_pitch = 0;
int ft_glyph_top = 0;
int ft_glyph_left = 0;
if( self->outline_type == 0 )
{
slot = face->glyph;
......@@ -423,6 +431,7 @@ texture_font_load_glyphs( texture_font_t * self,
else
{
FT_Stroker stroker;
FT_BitmapGlyph ft_bitmap_glyph;
error = FT_Stroker_New( library, &stroker );
if( error )
{
......@@ -497,7 +506,7 @@ texture_font_load_glyphs( texture_font_t * self,
return 0;
}
}
FT_BitmapGlyph ft_bitmap_glyph = (FT_BitmapGlyph) ft_glyph;
ft_bitmap_glyph = (FT_BitmapGlyph) ft_glyph;
ft_bitmap = ft_bitmap_glyph->bitmap;
ft_bitmap_width = ft_bitmap.width;
ft_bitmap_rows = ft_bitmap.rows;
......@@ -565,12 +574,12 @@ texture_glyph_t *
texture_font_get_glyph( texture_font_t * self,
wchar_t charcode )
{
assert( self );
size_t i;
wchar_t buffer[2] = {0,0};
texture_glyph_t *glyph;
assert( self );
assert( self );
assert( self->filename );
assert( self->atlas );
......
......@@ -42,9 +42,9 @@
vector_t *
vector_new( size_t item_size )
{
vector_t *self = (vector_t *) malloc( sizeof(vector_t) );
assert( item_size );
vector_t *self = (vector_t *) malloc( sizeof(vector_t) );
if( !self )
{
fprintf( stderr,
......@@ -114,9 +114,9 @@ vector_contains( const vector_t *self,
const void *item,
int (*cmp)(const void *, const void *) )
{
size_t i;
assert( self );
size_t i;
for( i=0; i<self->size; ++i )
{
if( (*cmp)(item, vector_get(self,i) ) == 0 )
......
......@@ -50,11 +50,11 @@ vertex_attribute_new( GLchar * name,
GLsizei stride,
GLvoid *pointer )
{
assert( size > 0 );
vertex_attribute_t *attribute =
(vertex_attribute_t *) malloc (sizeof(vertex_attribute_t));
assert( size > 0 );
attribute->name = (GLchar *) strdup( name );
attribute->index = -1;
attribute->size = size;
......@@ -83,10 +83,12 @@ vertex_attribute_delete( vertex_attribute_t * self )
vertex_attribute_t *
vertex_attribute_parse( char *format )
{
GLenum type = 0;
int size;
int normalized = 0;
char ctype;
char *name;
vertex_attribute_t *attr;
char *p = strchr(format, ':');
if( p != NULL)
{
......@@ -122,7 +124,6 @@ vertex_attribute_parse( char *format )
return 0;
}
GLenum type = 0;
switch( ctype )
{
case 'b': type = GL_BYTE; break;
......@@ -136,7 +137,7 @@ vertex_attribute_parse( char *format )
}
vertex_attribute_t *attr = vertex_attribute_new( name, size, type, normalized, 0, 0 );
attr = vertex_attribute_new( name, size, type, normalized, 0, 0 );
free( name );
return attr;
}
......