Live data from Hacker News

SDL 2.0.0 is out after many years in development

lists.libsdl.org

1–10 of 62 posts

Re: SDL 2.0.0 is out after many years in development

#4
Lately I started using SFML instead of SDL for C++ Game Development. However, I'll still use SDL on future projects I hope. It's a brilliant library, so compact and portable that the games you write will be able to be compiled to a lot of platforms, even high school graphing calculators[1].

The SDL development still impresses me and 2.0.0 is a major milestone and multiple windows, new OpenGL, touch support, Android and iOS support are here to keep SDL alive with all the new frameworks and "engines". I hope it does well!

[1]: http://www.omnimaga.org/index.php?topic=12378.0

Re: SDL 2.0.0 is out after many years in development

#5

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!

SDL_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.

Re: SDL 2.0.0 is out after many years in development

#7

I never understood SDL vs OpenGL. As somebody who does OpenGL why should I use SDL?

OpenGL is a platform-independent API for graphics. SDL is a platform-independent API for everything else relevant to the game development, and also provides an initialization procedure for OpenGL (which OpenGL itself does not provide, so you needed to use platform-specific APIs like WGL and AGL or later standards like EGL).

Re: SDL 2.0.0 is out after many years in development

#8

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!

> 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.

Re: SDL 2.0.0 is out after many years in development

#10

I never understood SDL vs OpenGL. As somebody who does OpenGL why should I use SDL?

Isn't SDL the simplest, most portable way to use OpenGL?

OpenGL by itself is useless, it just does 3D graphics, and its GLUT library is too bare-bones to be of much use. SDL is a good, portable chassis for OpenGL application that don't need native GUI integration. An SDL OpenGL app will compile and run almost anywhere, with minimal fuss. Compare that to using OpenGL contexts inside platform-specific toolkits.

Post reply on HN