Veerrrryyyyyy lllloooowwwww frame rate

Started by
8 comments, last by Tjaalie 18 years, 8 months ago
Hello i made a opengl programm that run in windowed mode draws two triangles over the whole screen and covers them with a texture wich is 800x600. It sounds fine to me but when i run it it goes at a framerate less then 0:S. So why i know the counter is good becouse the programm runs very lagy. here is the render code

glBindTexture(GL_TEXTURE_2D, TextureID);
glBegin(GL_TRIANGLES);        
        //First one
        glTexCoord2f(0.0f, 1.0f); glVertex3f(X      , Y       , 0.0f);
        glTexCoord2f(0.0f, 0.0f); glVertex3f(X      , Y-Height, 0.0f);
        glTexCoord2f(1.0f, 0.0f); glVertex3f(X+Width, Y-Height, 0.0f);
        
        //Second one
        glTexCoord2f(1.0f, 1.0f); glVertex3f(X+Width, Y       , 0.0f);
        glTexCoord2f(0.0f, 1.0f); glVertex3f(X      , Y       , 0.0f);
        glTexCoord2f(1.0f, 0.0f); glVertex3f(X+Width, Y-Height, 0.0f);
glEnd();

I don't see any problem.
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };
Advertisement
That is obviously not the source of your rendering issue than. comment that code out and just test your FPS with the screen simply switching buffers. I assue you that you will find the program still has low FPS. From then on it's a matter of profiling your code to find the culprit.
Is the texture 800x600 or the window? Did you check if you're rendering in software mode? What video card do you have? Have you installed the latest drivers?
The texture and the window are 800x600 and i have an Ati Redeon 9600 xt 256mb
with the latest drivers i think.
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };
Quote:Original post by Tjaalie
The texture and the window are 800x600
Are you using a NPOT texture extension or gluBuild2DMipmaps?
Quote:Original post by Tjaalieand i have an Ati Redeon 9600 xt 256mb with the latest drivers i think.
The Catalyst 5.8 drivers were released today. If those aren't the ones you have installed, I recommend downloading them from ATI and installing them.
I got the VTune profiler and i can't let it to do what i want.
How do i get it to show the names of the functions and not some
hex decimal numbers??? Are there better profilers out there????
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };
Quote:Original post by Tjaalie
The texture and the window are 800x600 and i have an Ati Redeon 9600 xt 256mb
with the latest drivers i think.

Make your texture power-of-two (ie 512x512 or 1024x1024). Newer drivers have a nasty habit of falling back to some kind of emulation for non-power-of-two textures if they can't support them, which is dog slow.
if i left out the rendering code its still slow (just clear screen and swap buffers).
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };
That means that the problem is somewhere else in your code - it probably has little to nothing to do with the rendering code. Check your code profiler and see what functions take the longest. You'll probably find your problem there.
my siteGenius is 1% inspiration and 99% perspiration
I got it, i found out that it was the non power of two error
but if you do glClear() and glFlush and SwapBuffers stuff without glBegin and glEnd it wil be slow too.

Thanks to you all for your responses:D
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };

This topic is closed to new replies.

Advertisement