groans, rubbing my temples a little
This is gonna be all sorts of fun to update my Delphi headers for the
new rendering API. The less stateful API is going to reduce bugs,
though, so that’s worthwhile I guess.
By “fixed the feature set” I certainly hope you don’t mean that the
feature set is now locked down (fixed) and won’t be added to. I still
don’t see anything about render targets here, and that’s absolutely
essential.
Also, if we’re supposed to use OpenGL directly to get at useful effects
such as rotation, there needs to be some way to query a texture for
its OpenGL handle. I need to rotate less than 1% of the images I’m
rendering, but those ones that do need rotation do need rotation,
and it’s not worth giving up all the high-level image management
routines that the rendering API provides just to deal with that <1% case.
I’d basically just end up reimplementing most of SDL’s rendering in
my own codebase, which is kinda pointless.
Mason> ----- Original Message -----
From: slouken@libsdl.org (Sam Lantinga)
Subject: [SDL] SDL 1.3 progress updateThis week is a massive update on the rendering systems, simplifying
and improving them:
http://www.libsdl.org/tmp/SDL-1.3.zipThe theme has been focusing and streamlining the 2D rendering API so
that it is clear and easy to use.
To that end, I’ve fixed the feature set for this release, and removed
all partially functional renderers. I’ve also added the ability to
create an SDL surface for windows which aren’t using rendering or 3D
functionality, and made it possible to create a software renderer for
arbitrary SDL surfaces. Possibly the largest API change is that all
the rendering functions now take a rendering context as their first
parameter, so it’s clear what context they’re acting on.You can also now create a texture of any format including YUV and SDL
will automatically take care of converting it into the formats
supported by the accelerated renderers. This means that new
accelerated renderers need only advertise the optimal texture formats.
Doing this resulted in a 50% speed boost on Mac OS X.I’ve also simplified the driver interfaces so if you are porting to a
new platform you only have to implement 3 functions to get SDL 1.2
functionality and a software renderer, and you only have to implement
them if your platform doesn’t already support OpenGL or OpenGL ES.As you might imagine, this update has reams of new code. I’ve done a
bunch of testing but I’m sure there are bugs. If you run into them,
please report them at http://bugzilla.libsdl.org/On the up side, I’m very comfortable with this API set and am going on
to other areas that need love before release.Here is the intro to the new SDL_render.h, and a complete list of API changes:
This API supports the following features:
* single pixel points
* single pixel lines
* filled rectangles
* texture imagesThe primitives may be drawn in opaque, blended, or additive modes.
The texture images may be drawn in opaque, blended, or additive modes.
They can have an additional color tint or alpha modulation applied to
them, and may also be stretched with linear interpolation.This API is designed to accelerate simple 2D operations. You may
want more functionality such as rotation and particle effects and
in that case you should use SDL’s OpenGL/Direct3D support or one
of the many good 3D engines.New functions:
SDL_AddEventWatch()
SDL_DelEventWatch()
SDL_GetWindowPixelFormat()
SDL_CreateSoftwareRenderer()
SDL_GetWindowSurface()
SDL_UpdateWindowSurface()
SDL_UpdateWindowSurfaceRects()Removed functions:
SDL_SetTexturePalette()
SDL_GetTexturePalette()
SDL_SetDisplayPalette()
SDL_GetDisplayPalette()
SDL_RenderWritePixels()
SDL_DrawPoint()
SDL_DrawPoints()
SDL_BlendPoint()
SDL_BlendPoints()
SDL_DrawLine()
SDL_DrawLines()
SDL_BlendLine()
SDL_BlendLines()
SDL_DrawRect()
SDL_DrawRects()
SDL_BlendRect()
SDL_BlendRects()
SDL_BlendFillRect()
SDL_BlendFillRects()Changed functions:
Most SDL_Render* functions now take a context as their first parameter.
SDL_CreateTextureFromSurface() no longer needs a format, it
automatically converts to the optimal texture format.
SDL_SetWindowData() and SDL_GetWindowData() handle arbitrary named pointers.A full log can be found here:
http://hg.libsdl.org/SDLSee ya!
-Sam Lantinga, Founder and CEO, Galaxy Gameworks
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org