Jump to content
  • Advertisement
Sign in to follow this  
Geno the Great

Can't figure out SDL problem...

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

I'm trying to make a Nintendo DS inspired SDL app - That is, (For now) just 2 240x160 surfaces that will get drawn onto the screen surface and can be drawn on seperately. I've spent a good 4 hours debugging this, but so far no errors and no solution. all the source code is here, as well as all the source code, images, makefile, and binary in a zip file (Linux users use the makefile, Windows users would have to create a new VC++ or Dev-C++ project and add the files) It's using SDL, SDL_image and SDL_ttf. www.xnull.net/SDLDS/ The problem is, images that I blit onto the individual "screens" don't seem to show up when I blit those "screens" onto the main screen surface. I've tried skipping my functions and blitting directly to them, then blitting them directly to screen, but no luck. The only way that seems to work is to blit everything directly onto screen, which makes the code horribly ugly AND fairly useless. So, if you don't mind, take a look at the code, it's farily early in so there isn't a great deal of it. Can you spot the problem that I can't?

Share this post


Link to post
Share on other sites
Advertisement
Hi Geno,

I don't think you can simply say:

surface = new SDL_Surface;

There are a lot of things that end up not being set, like the color format and such.

Look into SDL_CreateRGBSurface to create your surface. It's mentioned in the documentation.

Hope that helps,
--Brian

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!