Jump to content
  • Advertisement
Sign in to follow this  
knobby67

OpenGL mesa3d, SDL and Nvidia

This topic is 4672 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'm hoping someone can help me with this problem. I've been running the nehe opengl examples from the web site, when I run the SDL opengl code examples I get very low frame rates. I thought this was something to do with my nvidia or mesa3d set ups. After several days and no luck I decided try one of the glx code examples. After compiling this ran at a great speed. I would use this except I'm use to useing SDL and would like to stick with this. Can anyone give advise, I presume I have to set something up in SDL. I'm using a nvidia card. And as an example nehe project 18 using SDL runs at 5FPS with GLX build nearly 2000FPS. Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
I'm willing to bet it's because the NeHe SDL Opengl examples use the SDL_OPENGLBLIT flag (check to see if they do), in which case if so, that flag is now depracted and should no longer be used. It's kind of a little hack that lets you draw via SDL's drawing functions onto an OpenGL context - which is great except for the fact the performance is worse than SDL's default graphics. So if that's the case, you'd need to basically port over the code so it uses pure OpenGL drawing calls rather than SDL's and that flag, which should just be SDL_OPENGL.

Share this post


Link to post
Share on other sites
No it seems to use SDL_OPENGL


CODE#
videoFlags = SDL_OPENGL; /* Enable OpenGL in SDL */
videoFlags |= SDL_GL_DOUBLEBUFFER; /* Enable double buffering */
videoFlags |= SDL_HWPALETTE; /* Store the palette in hardware */
videoFlags |= SDL_RESIZABLE; /* Enable window resizing */
#


Is it possible when I install SDL I have to use a make switch? Or do I need to set something in a cofigure file? Or has anyone heard of some SDL nvidia compatabillity problem? I've serached the net but to no availe

Share this post


Link to post
Share on other sites
Quote:
Original post by knobby67
Is it possible when I install SDL I have to use a make switch? Or do I need to set something in a cofigure file? Or has anyone heard of some SDL nvidia compatabillity problem? I've serached the net but to no availe


Oh, hmmm, well I'm thinking this problem has came up a looong time ago, but I can't remember what happened, but, if you are willing to try out another cross playform OpenGL library, such as GLFW or GLUT and compare performances, it just might be SDL in this specific case and issues with either your Mesa Drivers or O/S. It's been known to happen in the past, so I can't specifically say to do this or that (I've never used Mesa), but here are other threads that don't seem resolued: Link, Link(when using software mode, performance is slower), and Link, so see if you can find anything that might hint you towards a solution. You could also try using the latest official Nvidia's drivers to see if that fixes it as well. Good luck!

Share this post


Link to post
Share on other sites
Quote:
Original post by knobby67
No it seems to use SDL_OPENGL


CODE#
videoFlags = SDL_OPENGL; /* Enable OpenGL in SDL */
videoFlags |= SDL_GL_DOUBLEBUFFER; /* Enable double buffering */
videoFlags |= SDL_HWPALETTE; /* Store the palette in hardware */
videoFlags |= SDL_RESIZABLE; /* Enable window resizing */
#


Is it possible when I install SDL I have to use a make switch? Or do I need to set something in a cofigure file? Or has anyone heard of some SDL nvidia compatabillity problem? I've serached the net but to no availe


i believe SDL_GL_DOUBLEBUFFER needs to be passed toSDL_GL_SetAttibute(), rather than a flag to give to SetVideoMode.

i also think that SDL_HWPALETTE is used only if you are using 8 bit surfaces, but im not sure...

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!