iphone - Why is my VBO updated on 2nd click? -


i have method (invertpolygonmesh) takes array (my vbo) , inverts vertices along z axis. method directly invoked click of button (ibaction). odd reason vbo doesn't change on first click, inverted on every subsequent click after 1st one.

why there no update 1st click?

method below:

-(void)invertpolygonmesh {     nslog(@"invert mesh data.");     glbindbuffer(gl_array_buffer, _vertexbufferphoto);     glbufferdata(gl_array_buffer, sizeof(g_meshvertexdata), g_meshvertexdata, gl_dynamic_draw);      int index = 0;     bool edgecase = false;      (int row = 0; row < map_size; row += step_size)     {         (int col = 0; col < map_size; col += step_size)         {             g_meshvertexdata[index].vertex.z = 255 - g_meshvertexdata[index].vertex.z;             ++index;         }     } } 

i fixed calling glbindbuffer , glbufferdata functions after mesh vertices have been updated. resolved !!!


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -