2
votes

I have this little SDL/OpenGL game that I am working on. It runs great, but only on one computer. If I compile it and run it on my desktop, it just pops up a blank screen. If I run it on my netbook, it works just fine and I am able to see what I am trying to render. My question is: What could be causing these inconsistent rendering results? Why is one program running perfectly while the other suffers?

3
Different video cards, different drivers. Your solution is probably going to be hardware specific. Welcome to OpenGL.i_am_jorf
Post the hardware specs of both, along with some things your code does (shaders, extensions, etc.) and we might be able to pinpoint it.GManNickG

3 Answers

0
votes

I take it that when you initialise SDL with SDL_Init and ask for other resources through the API that you are actually checking that your requests were successful? If not and you plough on regardless then this may explain why you are getting a blank screen.

0
votes

Depending on the systems you're using, SDL may or may not be returning a hardware surface if you request one, and you may or may not have to call SDL_Flip(screen) to swap video buffers. This is especially true on, say, Mac OS X, where windowed applications can only use software surfaces. If you want to enable double-buffering using SDL with OpenGL, call SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1) instead of passing SDL_DOUBLEBUF in the flags of SDL_SetVideoMode().

0
votes

Thanks for all the replies, but it turned out to be some combination of hardware/window manager bizarreness. I added the ability to configure the client a bit more and made it run in a window, and now at least I am getting something. If you want to take a look at the code, feel to browse it here.