0
votes

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?

1
glVertexAttribPointers last parameter is a byte offset into the buffer. So looks like there's a sizeof(GLfloat) factor missing.Stefan Hanke
@stefan-hanke Thanxs that was it. Really quick and accurate answer.Batiste Bieler
Didn't write an answer because last time, I did misinterpret the specs. ;)Stefan Hanke

1 Answers

2
votes

glVertexAttribPointers last parameter is a byte offset into the buffer. So looks like there's a sizeof(GLfloat) factor missing.