DGL https://delphigl.com/forum/ |
|
Texture and squares,lines etc https://delphigl.com/forum/viewtopic.php?f=19&t=6620 |
Seite 1 von 1 |
Autor: | washburn_it [ Sa Mai 26, 2007 09:47 ] |
Betreff des Beitrags: | Texture and squares,lines etc |
Hi, first I want to say that I consider myself a beginner with OpenGL even though I already developed some OpenGL application for the flight simulation world. To be specific I developed the replica of several onboard instruments (called glass cockpit, that you can see in my web site) using bitmap textures 256x256 in size (also bitmap font textures) to draw the "appearance" of the instruments. Now I want to rework the instruments getting rid of most of the textures that seems to slow down the execution of the programs. To draw, for example, the artificial horizon I want to use lines, rectangles, circles etc continuing to use bitmap font textures. The problem seems to be in the intialization of OpenGL: if I use Code:
then I can't see the font textures anymore, I just see a coloured rectangle in the place of the texture. If I use Code:
(I added the glEnable(GL_TEXTURE_2D) ) then I can see the font textures but not lines, rectangles etc. Which is the correct initialization to make both things appearing? Thank you, regards. Roberto |
Autor: | Lossy eX [ Sa Mai 26, 2007 11:05 ] |
Betreff des Beitrags: | |
There is no perfect initialisation that works for the whole running time of you programm. OpenGL is an state machine. If you enabled textures the will used for everywhere. Including lines etc. It draws the pixel of the last texturecoordinate over all. So you must call glEnable(GL_TEXTURE_2D); if you want to use textures and glDisable(GL_TEXTURE_2D); if you want to draw something without textures. PS: The same to all other settings. Like blending. If you draw many polygons without any alphavalues its not necesarry to have GL_BLEND enabled all the time. Modern graphiccards dont care about but its not necesarry. And perhaps if you have really much polygons they have any effect on the speed. |
Seite 1 von 1 | Alle Zeiten sind UTC + 1 Stunde |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |