Jump to content
  • Advertisement
Sign in to follow this  
phoenixj

OpenGL OpenGL + SDL + FRAPS slowdown

This topic is 4057 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 thar :] I'm working on a game using SDL + OpenGL and have recently tried using FRAPS to check the framerate. What I found is that whenever I have FRAPS overlay the FPS onto the OpenGL screen (or have ANYTHING overlay the screen, like an IM window from GAIM), the average framerate drops from 60 to 30. I cut out all of my code aside from the initialization and main loop but this still happens. Any idea what's wrong? Here's the stripped down code:
#include <SDL/SDL.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <stdlib.h>

int main(int argc, char *argv[]){
	SDL_Event event;
	SDL_Init(SDL_INIT_VIDEO);
	SDL_SetVideoMode(640, 480, 0, SDL_FULLSCREEN | SDL_OPENGL | SDL_HWSURFACE);
	
	SDL_EnableKeyRepeat(1,0);
	SDL_ShowCursor(SDL_DISABLE);
	
	int done=0;
	while(!done){
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
		SDL_GL_SwapBuffers( );
	}
	
	SDL_Quit();
	return(0);
}


By the way, I am running on a 3.6 GHZ Pentium 4 with a gig of RAM and a GeForce 4 MX video card. Thankyou :) EDIT: I just had a friend run the full game with and without FRAPS and it maintains a consistent framerate. Could it just be my hardware? [Edited by - phoenixj on July 12, 2007 4:47:05 PM]

Share this post


Link to post
Share on other sites
Advertisement
GeForce 4 MX is a pretty old card, it wouldn't surprise me if that was the main problem. Overlays in general can be expensive, and then with a window over a window it involves clipping.

I don't think you can do anything to fix the issue (besides force your program to full screen)

Edit: Try turning off VSync in the control panel (assuming windows), and see how it reacts to different window overlays.

~Zix

Share this post


Link to post
Share on other sites
It slows down even in full screen mode (with the FRAPS overlay) and with vertical synch set to Always Off. I suppose it's just a hardware issue-which I'm fine with, since it doesn't have any effect on gameplay unless you're trying to capture video of it. I was just afraid it was an issue with my code.

Thanks for your help :]

Share this post


Link to post
Share on other sites
>_o

F9 is both the 'Record Video' hotkey in FRAPS and the 'Compile and Run' hotkey in Dev-C++. When I hit F9 to run my program it triggered a video capture which definatley would decrease the framerate.

Don't I feel stupid 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!