Recently, I have been doing accelerated GPU acceleration for my real-time program .
I want to create a context and reuse it several times (100+). And I use OpenGL 2.1 and GLSL version 1.20.
Every time I reuse a context, I am going to do the following:
- Compilation
shaders, link program, then glUsePrograme(question 1: should I re-link programor recreate programeach time?) - Generate
FBOand Texturethen snap them so that I can render on the screen. (Question2: should I destroy those FBOand Texture) - Create
GL_Array_BUFFERand put some vertex data in it. (Question3: do I even need to clear this?) - glDrawArray bluh bluh ...
- Call
glFinish(), then copy the data from the GPU to the CPU by calling glReadPixels.
And is there any other necessary cleanup operation that I should consider?
Ming source
share