5 ms·
I remember using SDL more than a decade ago and in general it was a pleasant experience. My only gripe was that it needs to hijacked the main loop. Nevertheles
by bloodorange 13y ago
I remember using SDL more than a decade ago and in general it was a pleasant experience. My only gripe was that it needs to hijacked the main loop.
Nevertheless, I will give it a shot again.
Good work Sam!
- lifthrasiir 13y agoSDL_main is no longer mandatory (though it is still there); #define-ing SDL_MAIN_HANDLED and calling SDL_SetMainReady once before SDL_Init is sufficient now. Edit: Ah, if the main loop you refer is SDL_Event loop, as exDM69 said, SDL always supported passive event functions that can be called at your original idle function. SDL 2.0 adds an active event watcher (SDL_AddEventWatch etc.) as an alternative though.
- pgz 13y agoThat's great news, I always felt the whole SDL_main thing to be quite evil.
- exDM69 13y ago> That's great news, I always felt the whole SDL_main thing to be quite evil. Evil or not, it solves a practical problem that you would have to work around if SDL did not. And AFAIK, you have always had the option of not using SDL_main if you wish to solve the problem on your own. On desktop platforms the program entry point is pretty easy to solve (main vs. WinMain) with an SDL_main-style macro or command line args on win32 compilers. But when you start working with iOS and Android, it gets more hairy.
- pgz 13y agoOn OS X main was wrapped in a function that made it work with the Finder (manipulating an argv containing --psn). It was annoying to me because I worked on a application that did the same thing internally and where SDL was not a hard dependency. But well, it's not that bad as I make it sound.
- lclarkmichalek 13y agoIt did make writing bindings for other languages rather interesting
- exDM69 13y ago> My only gripe was that it needs to hijacked the main loop. SDL has never hijacked the main loop, unlike e.g. GLUT. SDL has SDL_WaitEvent and SDL_PollEvent and leaves the main loop to you.
- reidrac 13y agoI wrote a silly (unfinished) game about 10 years ago, and SDL portability never ceases to amaze me. The game has been ported to devices I didn't even know they existed. It's amazing because I did it for fun and I used some data structures I would have never expect to be so portable (ie. using a double linked list of objects in static memory instead of alloc/free). I wonder if that's why it works even in very limited hardware. My favourite, the game running on a TI-Nspire calculator: http://www.youtube.com/watch?&v=acdAqxiwG7I&t=15 http://www.youtube.com/watch?&v=acdAqxiwG7I&t=15