I have tried for some time now to use the Vertex Buffer Objects to render a texture on the screen. I have a working function here that use the classic method:
https://github.com/batiste/sdl2-opengl-es/blob/master/common.c#L546
This first method works. A bit down there is the Vertex Buffer modified version:
https://github.com/batiste/sdl2-opengl-es/blob/master/common.c#L586
I have tried many different ways, checked all the inputs and search on this site for similar problems but without success. I need a fresh, expert eye on this.
The second part of the question is about performance. I want to use then to display some simple textures on my Android phone. What kind of speed up can I expect from using vertex buffer? Is it really worth using for 2 triangles?
glVertexAttribPointer
s last parameter is a byte offset into the buffer. So looks like there's asizeof(GLfloat)
factor missing. – Stefan Hanke