mojoshader_opengl.c
branchtrunk
changeset 222 ed4421aa7e00
parent 221 328ac819b965
child 223 8df4e9545c87
equal deleted inserted replaced
221:328ac819b965 222:ed4421aa7e00
   500 
   500 
   501     if ((usage == MOJOSHADER_USAGE_POSITION) && (index == 0))
   501     if ((usage == MOJOSHADER_USAGE_POSITION) && (index == 0))
   502     {
   502     {
   503         // !!! FIXME: fails if size==1.
   503         // !!! FIXME: fails if size==1.
   504         pglVertexPointer(size, opengl_posattr_type(type), stride, ptr);
   504         pglVertexPointer(size, opengl_posattr_type(type), stride, ptr);
       
   505         pglEnableClientState(GL_VERTEX_ARRAY);
   505     } // if
   506     } // if
   506 
   507 
   507     int i;
   508     int i;
   508     GLuint gl_index = 0;
   509     GLuint gl_index = 0;
   509     for (i = 0; i < bound_program->attribute_count; i++)
   510     for (i = 0; i < bound_program->attribute_count; i++)
   522     } // for
   523     } // for
   523 
   524 
   524     if (gl_index != 0)
   525     if (gl_index != 0)
   525     {
   526     {
   526         const GLenum gl_type = opengl_attr_type(type);
   527         const GLenum gl_type = opengl_attr_type(type);
   527         const GLboolean gl_norm = (normalized) ? GL_TRUE : GL_FALSE;
   528         const GLboolean norm = (normalized) ? GL_TRUE : GL_FALSE;
   528         pglVertexAttribPointer(gl_index, size, gl_type, gl_norm, stride, ptr);
   529         pglVertexAttribPointerARB(gl_index, size, gl_type, norm, stride, ptr);
       
   530         pglEnableVertexAttribArrayARB(gl_index);
   529     } // if
   531     } // if
   530 } // MOJOSHADER_glSetVertexAttribute
   532 } // MOJOSHADER_glSetVertexAttribute
   531 
   533 
   532 
   534 
   533 void MOJOSHADER_glProgramReady(void)
   535 void MOJOSHADER_glProgramReady(void)