OpenGL ES Loading

Posted by kuroutadori on Game Development See other posts from Game Development or by kuroutadori
Published on 2011-02-08T16:53:55Z Indexed on 2011/02/08 23:35 UTC
Read the original article Hit count: 305

Filed under:
|
|

I want to know what is the norm of loading rendering code.

Take a button. When the application is loaded, a texture is loaded which has the image of the button on it. When the button is tapped, it then adds a loader into a queue, which is loaded on render thread. It then loads up an array buffer with vertexes and tex coords when render is called. It then adds to a render tree. Then it renders.

the render function looks like this

void render()
{
    update();
    mBaseRenderer->render();
}

update() is when the queue is checked to see if anything needs loading. mBaseRenderer->render() is the render tree.

What I am asking then is, should I even have the update() there at all and instead have everything preloaded before it renders? If I can have it loaded when need, for instance when there is tap, then how can it be done (My current code causes an dequeueing buffer error (Unknown error: -75) which I assume is to do with OpenGL ES and the context)?

© Game Development or respective owner

Related posts about c++

Related posts about android