Jump to content
  • Advertisement
Sign in to follow this  
Tjaalie

OpenGL Veerrrryyyyyy lllloooowwwww frame rate

This topic is 4835 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
The texture and the window are 800x600 and i have an Ati Redeon 9600 xt 256mb
with the latest drivers i think.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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????

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!