[SDL] looking for something equivalent to context.translate(x, y)
grimfang4 at gmail.com
Mon Mar 26 18:01:00 PDT 2012
SDL doesn't define a drawing API like those you mention. It is entirely
raster-based and low-level. You get access to the raw pixel data and
there's a blitting routine. Other APIs may use SDL to provide an interface
to graphics primitives (SDL_gfx, SPriG), vector graphics (similar to
Canvas), or matrix transformations on pixel data (similar to OpenGL). You
could even implement the Java2D API on top of SDL. The graphic primitives
need to be aware of this global transformation state, and that is just not
within the scope of SDL proper.
If you're not interested in doing it yourself, you might have a look at
cairo (http://cairographics.org/). I did once try it out with SDL and it
was pretty neat. If you need better performance, you would want to use
OpenGL in the end (and cairo does have an OpenGL backend that can be set up
On Mon, Mar 26, 2012 at 7:46 PM, sombriks <sombriks at gmail.com> wrote:
> Hello everyone,
> On similar drawing api's i have a function which i use to implement camera
> , they are quite similar (not complete equal, but similar)
> But on SDL i had no success on find something similar to this.
> I've solved my issue by using a second buffer to draw the background
> buffer and the sprites and then draw that on the screen. But find a
> solution able to make the 3 research codebases more similar to each other
> would be nice.
> For context, please see the following Cameras and Scenarios (see links,
> not going to pollute the post.)
> SDL version
> Java2D version
> Thanks in advance.
> SDL mailing list
> SDL at lists.libsdl.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SDL