Live data from Hacker News

SDL 2.0.0 is out after many years in development

lists.libsdl.org

11–20 of 62 posts

Re: SDL 2.0.0 is out after many years in development

#11
post #9

Looks like they changed their license from LGPL to zlib as well. I wonder if this will increase adoption, or if it just was so Valve could use it in Steam for Linux.

Also pretty much required to get applications sdl to ios/android store.

The Play Store is pretty much license-agnostic. At least there is no policy preventing GPL works that I know of.

Re: SDL 2.0.0 is out after many years in development

#12
post #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.

GLFW is an excellent library:

http://www.glfw.org/

It's very, very barebones (just enough to GL up to do a thing), but it's quite good in that role.

Re: SDL 2.0.0 is out after many years in development

#14
post #10

Earlier quoted context omitted.

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.

GLFW is an excellent library: http://www.glfw.org/ It's very, very barebones (just enough to GL up to do a thing), but it's quite good in that role.

SDL exists, is tiny, modular and efficient. Not to mention has loads of extensions.

Re: SDL 2.0.0 is out after many years in development

#15

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.

That's great news, I always felt the whole SDL_main thing to be quite evil.

Re: SDL 2.0.0 is out after many years in development

#16

Looks like they changed their license from LGPL to zlib as well. I wonder if this will increase adoption, or if it just was so Valve could use it in Steam for Linux.

Given that Starcraft 2 have LGPL code in it, I sincerely doubt that games stores had any part in the decision.

Re: SDL 2.0.0 is out after many years in development

#17
post #14

Earlier quoted context omitted.

GLFW is an excellent library: http://www.glfw.org/ It's very, very barebones (just enough to GL up to do a thing), but it's quite good in that role.

SDL exists, is tiny, modular and efficient. Not to mention has loads of extensions.

  #include 

  int main(void)
  {
    GLFWwindow* window;

    if (!glfwInit())
        return -1;

    window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
    if (!window) {
        glfwTerminate();
        return -1;
    }

    glfwMakeContextCurrent(window);

    while (!glfwWindowShouldClose(window)) {
        /* Render here */


        glfwSwapBuffers(window);
        glfwPollEvents();
    }

    glfwTerminate();
    return 0;
  }
VS

   #include 
   #include 

  /* Our program's entry point */
  int main(int argc, char *argv[])
  {
    SDL_Window *mainwindow;
    SDL_GLContext maincontext;
    SDL_Event event;
    int running = 1;

    if (SDL_Init(SDL_INIT_VIDEO) 
It's got SDL beat a bit in simplicity for OpenGL, sorry dude.

Re: SDL 2.0.0 is out after many years in development

#18
From the About:

"Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games."

http://www.libsdl.org/index.php

Re: SDL 2.0.0 is out after many years in development

#19
post #14

Earlier quoted context omitted.

SDL exists, is tiny, modular and efficient. Not to mention has loads of extensions.

#include int main(void) { GLFWwindow* window; if (!glfwInit()) return -1; window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL); if (!window) { glfwTerminate(); return -1; } glfwMakeContextCurrent(window); while (!glfwWindowShouldClose(window)) { /* Render here */ glfwSwapBuffers(window); glfwPollEvents(); } glfwTerminate(); return 0; } VS #include #include /* Our program's entry point */ int main(int argc,…

Yep, because main-loop boilerplate is all one ever does with graphics programming.

Re: SDL 2.0.0 is out after many years in development

#20
post #14

Earlier quoted context omitted.

SDL exists, is tiny, modular and efficient. Not to mention has loads of extensions.

#include int main(void) { GLFWwindow* window; if (!glfwInit()) return -1; window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL); if (!window) { glfwTerminate(); return -1; } glfwMakeContextCurrent(window); while (!glfwWindowShouldClose(window)) { /* Render here */ glfwSwapBuffers(window); glfwPollEvents(); } glfwTerminate(); return 0; } VS #include #include /* Our program's entry point */ int main(int argc,…

As someone who's used neither, I'd call that a draw. Neither of that boilerplate looks particularly scary or insane.
Post reply on HN