Problems with SDL

Started by
15 comments, last by RuneLancer 20 years ago
quote:
It most certainly does! To think I used to believe DirectDraw was better.


wait untill you see how easy SDL_mixer is to use. god bless Sam Lantingua (sp?)
FTA, my 2D futuristic action MMORPG
Advertisement
AHA! So there IS a way to get a handle to an SDL window! Seeing as I'm writing Windows-only code, this will come quite in handy! Thank you very much, bobstevens!

I'm still going to use sdl_ttf, for the sake of seeing what it can do. I use my own font engine in all of my projects (well, more recent ones at least) and if this'll save me time, so much the better.

I'm done converting my first C game from DirectDraw to SDL. The code isn't 100% error-free and doesn't check for a lot of stuff (it assumes you WILL be able to provide 640x480x32 res, which isn't necessarily the case) but it works. The only thing SDL are the graphics; the rest is dumb Windows API usage (like GetAsyncKeyState; yuck). Here's a link to it. I'll post the fully-SDL-converted version if anyone wants it.

(Hit enter to start. Move with the arrows, shoot with space. You can only go up and down and yes, there's no sound. I didn't know how to use DirectSound and DirectMusic back then Probably choke-full of bugs but eh. If the timing's off, it's probably because I use GetTickCount as a timer... for now. Oh, and there's no text yet. Kinda bland because you can't see your score. Hit escape when you've had enough.)

Edit: screwed up the link.

[edited by - RuneLancer on March 28, 2004 6:30:28 PM]
my only complaint is that it wasn''t implemented in C++ using namespaces to get rid of those SDL_, and using object for things like surfaces.

sdl::surface t;
t.LoadBMP(...);
t.blit(screen,sdl::rect(50,50,0,0));

mmmm, i wish ;-)
quote:Original post by C-Junkie
my only complaint is that it wasn''t implemented in C++ using namespaces to get rid of those SDL_, and using object for things like surfaces.


Well that''s an odd request for someone named C-Junkie, but maybe SDLmm is a little bit like what you''re looking for: http://sdlmm.sourceforge.net/

just a little update. i just added text to my game, and i must strongly recommend using SDL_ttf for making text. i honestly thought it would be at least a little bit complicated, but it is an absolute breeze. like the rest of SDL, its only a couple function calls to start up the system and right any text you want to the screen. i googled and discovered a wonderfull library called stringstream which converts integers to strings, and my scoring system is complete. use SDL_ttf! it rocks!
FTA, my 2D futuristic action MMORPG
i wrote an C++ sdl wrapper a while ago, i didn''t like the way SDLmm handled events. Mine uses boost''s signal-slots library. It''s not hard to understand once you open it, there''s not much to it. Give me a shout if anyone want to look at it.
isnt a wrapper basically just a framework? like a set of classes that organize and use SDL functions? bah, id rather write my own. thats where all the learning happends besides SDL is sooooo simple, theres no reason to use someone else''s wrapper
FTA, my 2D futuristic action MMORPG

This topic is closed to new replies.

Advertisement