c++ - OpenGL: glTexImage2D conflicts with glGenLists & glCallList? -
I have a simple openGL application where 2 objects appear on the screen:
1) The particle system, where each particle texture is magnetized with glTexImage2D () calls. In the DrawAvent function, I attract it to GL_TRIANGLE_STRIP in 4 GlytexX 3.0.
2) A 3D text loaded from an object file, where each point is loaded using glNewList / glGenLists and stores each point as glVertex. I like to call glCallList to attract it.
The problem is that when I call glTexImage2D () to map your particles with a .bmp file, the 3D text will not appear on the screen. The particles will look fine. (This is not expected)
If I do not call glTexImage2D, then I see both 3D text and particle system. In this case, the particle system looks terrible because I did not map anything with texture. (It is expected)
Does anyone know that using the call list and glTexImage2D can be conflicts with each other?
Edit I also forgot to mention: I do call glBindTexture (GL_TEXTURE_2D, this-> texture);
EDIT2 I only call glTexImage2D () once the system starts (when I make a bitmap of texture)
uploads glTexImage2D video vs (simplified).
If OpenGL allows you to call a glTexImage2D call inside the list, then it will have to store pixel-data in the list. Now what will happen if you do the list? You will upload identical image data in the same texture.
It does not make any sense, so it has left it.
If you want to change the texture between the draw call, use glBindTexure, the call current texture sets it very fast.
About your image-upload, through glTexImage2D: only make one for each texture, either at the beginning of your program (if it is small) or every time you get new content from the disk Load.
Comments
Post a Comment