Live data from Hacker News

SDL 2.0.0 is out after many years in development

lists.libsdl.org

51–60 of 62 posts

Re: SDL 2.0.0 is out after many years in development

#51
post #49

Earlier quoted context omitted.

#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,…

That doesn't show that GLFW is simpler than SDL. It just shows that GLFW has some simple defaults. How much complexity is added to the GLFW code if you want to require a minimum GL version and depth buffer size? Or a fulllscreen window?

Sure. Fullscreen mode:

      window = glfwCreateWindow(640, 480, "Hello World", glfwGetPrimaryMonitor(), NULL);
Requesting a specific version with a particular depth:

  glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
  glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
  glfwOpenWindowHint(GLFW_DEPTH_BIT, 24);
There you go.

Re: SDL 2.0.0 is out after many years in development

#52
post #35

Let me guess: it's still impossible to minimize a full screen game on Linux or alt-tab etc., and the joystick will still not be recognized if you plug it in after the game starts.

> it's still impossible to minimize a full screen game on Linux or alt-tab

I'm not sure how it handles it, but kerbal space program doesn't have this problem in linux.

Re: SDL 2.0.0 is out after many years in development

#53

If I start a new multimedia project today and aim to support the widest range of devices should I use this version of SDL or 1.x?

Use SDL2, much better and official support for mobile platforms. The only platforms that were killed in SDL2 are old ones like MacOS9 etc.

Re: SDL 2.0.0 is out after many years in development

#54
post #52
post #35

Let me guess: it's still impossible to minimize a full screen game on Linux or alt-tab etc., and the joystick will still not be recognized if you plug it in after the game starts.

> it's still impossible to minimize a full screen game on Linux or alt-tab I'm not sure how it handles it, but kerbal space program doesn't have this problem in linux.

I know it works, and I'm very happy for it. Would have taken me a lot more time to land on the Mun otherwise ;)

Re: SDL 2.0.0 is out after many years in development

#57
Woo! I have been using SDL for years to build all sorts of projects (games, touch screen interfaces, etc.).

But as others here have noted I migrated over to use SFML, mainly because of its nice object-oriented implementation as well as the additional convenience features such as rotation and better alpha support.

Re: SDL 2.0.0 is out after many years in development

#58
post #34

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.

Unfortunately, it is not yet available on Android and iOS. Also http://www.glfw.org/faq.html#12__what_is_glfw_not

The amount of code necessary to wire up a well-written application into iOS and Android is pretty minor. I'd rather do that where I can't use GLFW (I mean, GLEW does most of the hard work anyway, and that is portable). GLFW epitomizes a good library for this stuff, in that it's minimal and minimizes the amount of stuff you have to wrestle with when writing C++; on the other hand, SDL forces you to come to grips with its weight and its own dubious design decisions (and a lot of plumbing code to make it sane in C++).

When wrapping OpenGL code myself, at least the dubious design decisions are my own and I understand them intuitively.

Re: SDL 2.0.0 is out after many years in development

#59
post #28

Earlier quoted context omitted.

Hey, no reason to get snippy--you asked "Isn't SDL the simplest, most portable way to use OpenGL?", and asserted that it's a smaller library. I showed you a still-smaller alternative, and even dug up code to substantiate that point. There's nothing wrong with using SDL for making a game (well, maybe a couple of things, but that's not relevant here), but it simply isn't the smallest GL scaffolding library out there.

Heh, you're right, I got a little snarky. Sorry :-P But I got bit by half-assed "GL" ways of doing things before. SDL has everything, in layers, so you can grow into it. Unlike "portable GL" libraries which are discrete, isolate dead-ends.

Calling GLFW a "dead end" is misleading and unfair.

GLFW does not attempt to handle OpenGL for you, it handles windowing and input for you. I personally really don't want SDL anywhere near my projects because it imposes its own structure upon me. (I don't use Allegro, even for 2D code, for similar reasons.) I am simply not all that fussed by writing up a VBO handler and some pretty simple OpenAL code myself--it isn't difficult enough for me to warrant the huge blob of extraneous SDL stuff.

Re: SDL 2.0.0 is out after many years in development

#60

Earlier quoted context omitted.

I really like SFML, I've been using for a small game project of mine as well. The API is just nice and beautiful. I was wondering how SDL 2.0 stacks up against SFML? Does anyone know much about it? I'm only doing 2D game development, so SDL's " simple 2D rendering API that can use Direct3D, OpenGL, OpenGL ES, or software rendering behind the scenes " is perfect for my needs. However it needs to support two basic thin…

There's a decent post on SO about it... http://stackoverflow.com/questions/2842198/which-is-better-s...

And naturally, it has been closed.
Post reply on HN