Jump to content
  • Advertisement
Sign in to follow this  
AkylaQD

Please help me to understand (SDL).

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

[font="arial, verdana, tahoma, sans-serif"]I try to use SDL, to study and test, wrote the simple tetris, but there was a strange bug. I write it under Linux, compile and everything work fine and you can play. I decide to check it on Windows, compiled fine, run the game, but the figures are not shown. Can someone tell me why it's happened? Please help.




http://depositfiles....files/c2vo21m5n - windows version.

http://depositfiles....files/sji6fpt1e - sources[/font]

Share this post


Link to post
Share on other sites
Advertisement
1. What version of SDL are you using?

2. What are you using for rendering? Software blitting? SDL 1.3's hardware-accelerated rendering? OpenGL outside of SDL?

3. Are you checking for errors?

Share this post


Link to post
Share on other sites

1. What version of SDL are you using?

2. What are you using for rendering? Software blitting? SDL 1.3's hardware-accelerated rendering? OpenGL outside of SDL?

3. Are you checking for errors?



1. Latest stable version SDL-1.2.14


2.I use only SDL, I don't use OpenGl in this project. I try compile with flag SDL_HWSURFACE and without.

3.I don't know about errors,maybe it is errors, but under Linux all works fine.

Share this post


Link to post
Share on other sites
I haven't looked at the project, but two things you'll want to do are error-checking, and debugging.

What development environment are you using? (That is, what program or programs did you use to build the application in Windows?)

Regarding error-checking, ideally you would check the return values of all SDL functions that can potentially fail. Error-checking can be kind of tedious (especially with C or C-like libraries), but it's more or less a necessity. (Assuming you want to know if something goes wrong, at least.) For example, the problem could be images failing to load due to a current working directory problem, but without error-checking, if the failed loads don't result in a crash of some sort, you won't have any way of knowing what's gone wrong.

Another option (which should really be used in addition to checking for errors, but can also be used in place of it) is to step through the code in the debugger, provided you're working in an environment that has one. In particular, you'll want to look for things like SDL 'load' functions returning null pointers and so forth.

Share this post


Link to post
Share on other sites
Move your image files/folders elsewhere on Linux, and see if you get the same result. If so, then it is probably errors while loading the images that you aren't handling.

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!