SDL 2.0 remarks so far

First off, going to http://www.libsdl.org/ should at least say something about SDL 2.0 going into Release Candidate stage–the more eyes, the better!

Upon cloning the repo, lots of the tests for SDL2.0 are missing from the main project file for VS2010. It seems that those were removed because the source files they rely on have been deleted. (like testcursor.c).
The tests that don’t have code anymore should have their project solution files removed from the repo, until there is working code. Otherwise, nosy people like me will stumble upon the ‘missing’ tests and try to add them back in.

Looking at the wiki, the migration page is … quite minimal, in fact, too minimal to be used as a source of information.
It needs many more examples of the old way vs the new way.

Getting on to SDL 2 itself, it seems you now support openGL or openGL ES or openGL ES 2, or directX (obviously windows only).
Does this mean that, you can query the user and ask them which one they prefer?
This will solve the issue of people who own intel gear, and have had to use intel’s horrible openGL drivers. I am assuming intel’s direct3D drivers are better, and if SDL 2 can seamlessly switch, then nice!
Of course, this assumes that you use the built-in SDL calls to do the drawing.

SDL 2 is supposed to support OpenGL 3.0+, but I can’t find any documentation on how to actually handle things like shaders and what not if we are using the built-in SDL drawing calls. Is there some kind of special sauce to convert openGL shaders to DX shaders?
Or does this fall into custom drawing, that you need to home-brew everything yourself?

I don’t see any tests that will open multiple windows and/or screens, and I was hoping to see a hardware colored cursor test as well. I assume that this should have been part of the tests to make sure SDL 2 is working correctly?

I don’t even see a full example (keyboard & mouse input, setting up screen/window, and the draw calls and so on) of a old SDL project converted to SDL2, and this would be very useful to have on the wiki!

I have notice that Valve/Steam is using SDL 2 over something like Qt 5.
Is this because of performance reasons, or does this fall into Qt has everything but the kitchen sink, and SDL is minimal?

Thanks for the feedback!

I added a quick blurb to the front page, thanks!

Andreas, can you update the project files appropriately? Also if you want
to add a color cursor test, that would be great.

Sparks, the documentation is community contributed. If you would like to
contribute (and please do!), just send me your wiki username and I’ll give
you write access.

For rendering, if you using SDL’s 2D render API you can query the available
renderers and let the user pick one if you want. It defaults to D3D on
Windows, OpenGL on Linux and Mac OS X and OpenGL ES 2.0 on the mobile
platforms. SDL can seamlessly switch between them with no changes to your
application code.

Once you want shaders or advanced rendering techniques, I highly recommend
using SDL just to create the context and then using OpenGL directly. You
can see an example of using shaders with SDL in test/testshader.c There’s
no special sauce to do shader conversion, but you can find tools to do this
for you, like mojo shader: http://icculus.org/mojoshader/

All the tests using the new framework have a gazillion command line options
to test various options:
Usage: ./testsprite2 [–video driver] [–renderer driver] [–gldebug]
[–info all|video|modes|render|event] [–log
all|error|system|audio|video|render|input] [–display N] [–fullscreen |
–fullscreen-desktop | --windows N] [–title title] [–icon icon.bmp]
[–center | --position X,Y] [–geometry WxH] [–min-geometry WxH]
[–max-geometry WxH] [–logical WxH] [–scale N] [–depth N] [–refresh R]
[–vsync] [–noframe] [–resize] [–minimize] [–maximize] [–grab]
[–blend none|blend|add|mod] [–cyclecolor] [–cyclealpha]

The one you want for multiple windows is --windows N

One of the Google Summer of Code projects is to add more automated testing
so we can make sure all the combinations of options work correctly. Of
course, if you find any bugs, please report them to bugzilla.libsdl.org

As for examples of programs converted to SDL 2.0, you can check out the
test program. You can compare testsprite and testsprite2:
1.2: http://hg.libsdl.org/SDL/raw-file/f7fd5c3951b9/test/testsprite.c
2.0: http://hg.libsdl.org/SDL/raw-file/3bb309bb6bfe/test/testsprite2.c

These aren’t quite fair comparisons since the 2.0 version adds a bunch of
functionality for feature testing.

Here’s a simpler example:
2.0: http://hg.libsdl.org/SDL/raw-file/3bb309bb6bfe/test/testspriteminimal.c

Does anyone else have examples of an old project converted to SDL 2.0?

Valve is using SDL 2 because it’s really well suited for porting full
engines. It’s minimal and covers the low level functionality you need
really well and then gets out of your way so you can code to the metal.
That’s how SDL got its start and where it really shows its strengths.

Qt is really well suited for cross-platform tools where you want lots of UI
functionality.

Cheers!On Sat, Jun 1, 2013 at 5:34 PM, Sparks wrote:

**
First off, going to http://www.libsdl.org/ should at least say something
about SDL 2.0 going into Release Candidate stage–the more eyes, the better!

Upon cloning the repo, lots of the tests for SDL2.0 are missing from the
main project file for VS2010. It seems that those were removed because the
source files they rely on have been deleted. (like testcursor.c).
The tests that don’t have code anymore should have their project solution
files removed from the repo, until there is working code. Otherwise, nosy
people like me will stumble upon the ‘missing’ tests and try to add them
back in.

Looking at the wiki, the migration page is … quite minimal, in fact, too
minimal to be used as a source of information.
It needs many more examples of the old way vs the new way.

Getting on to SDL 2 itself, it seems you now support openGL or openGL ES
or openGL ES 2, or directX (obviously windows only).
Does this mean that, you can query the user and ask them which one they
prefer?
This will solve the issue of people who own intel gear, and have had to
use intel’s horrible openGL drivers. I am assuming intel’s direct3D drivers
are better, and if SDL 2 can seamlessly switch, then nice!
Of course, this assumes that you use the built-in SDL calls to do the
drawing.

SDL 2 is supposed to support OpenGL 3.0+, but I can’t find any
documentation on how to actually handle things like shaders and what not if
we are using the built-in SDL drawing calls. Is there some kind of special
sauce to convert openGL shaders to DX shaders?
Or does this fall into custom drawing, that you need to home-brew
everything yourself?

I don’t see any tests that will open multiple windows and/or screens, and
I was hoping to see a hardware colored cursor test as well. I assume that
this should have been part of the tests to make sure SDL 2 is working
correctly?

I don’t even see a full example (keyboard & mouse input, setting up
screen/window, and the draw calls and so on) of a old SDL project converted
to SDL2, and this would be very useful to have on the wiki!

I have notice that Valve/Steam is using SDL 2 over something like Qt 5.
Is this because of performance reasons, or does this fall into Qt has
everything but the kitchen sink, and SDL is minimal?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org