Jump to content
  • Advertisement
Sign in to follow this  
Pipo DeClown

SDL+GL=bugs

This topic is 5131 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

When I use OpenGL with SDL, I find a lot of strange bugs: 1) The Win32 MessageBox() doesn't work. (Even when it returns S_OK, I just hear a bumpbeep) 2) fprintf() crashes with a writing exception at 0000000010. Something like that. (Only when I delete the code, it doesn't crash. It even crashes when commented out) I use VC++.NET and SDL-1.2.7. (Tried the real OpenGL headers instead of SDL_opengl.h, still the same bugs)

Share this post


Link to post
Share on other sites
Advertisement
Have you tried fiddling with the choice of runtime libraries? I think SDL requires that you use Multithreaded DLL, but that's just some distant thing in the back of my head. It's in code generation in C/C++ folder in the project settings.

Share this post


Link to post
Share on other sites
Also, are you running in fullscreen? That might be the reason the Win32 Message Box isn't showing up. In my experience, mixing Win32 stuff with OGL/DX is asking for trouble.

Check your code around yuor fprintf. I would suspect the error there is with something else, and not your OGL code. What are you printing out?

In all likelihood, you're already compiling using the Multithreaded DLL option (I don't think an SDL program will even compile without it).

Hope that helps,
--Brian

Share this post


Link to post
Share on other sites
aren't you not supposed to touch any Win32 functions if your using SDL? i would bet that's why its not working. why do you even need to use it? SDL should handle everything for you..

plus, it un-cross-platformizes (lol) your code.

Share this post


Link to post
Share on other sites
By the way. . .SDL_opengl.h. . .what use

#include <SDL/SDL.h>
#include <GL/GL.h>
#include <GL/GLU.h>

(Only when I delete the code, it doesn't crash. It even crashes when commented out) that doesnt make any sense. . .

Share this post


Link to post
Share on other sites
One reason to use win32 message boxes is if you have an error and you want your user to see it. You can use that temporarily until you make a gui or implement on the other systems you are using your game/app on. Or if its only for the developer.

Share this post


Link to post
Share on other sites
I have had bugs such as these before. THe only solution I have is to create a Win32 console app, instead of a Win32 App, so you can use printf to help you track erros.

[Edited by - Drew_Benton on January 3, 2006 4:04:01 AM]

Share this post


Link to post
Share on other sites
If you use printf in a win32 app with SDL, the output should automatically be directed to a text file which you can read when your program finishes.

Edit: oh sorry, you said fprintf

[Edited by - Kelly G on November 28, 2004 6:35:58 AM]

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!