[SDL] Graphics without X-Server
Ryan C. Gordon
icculus at clutteredmind.org
Mon Jul 29 01:27:01 PDT 2002
> So, i want to write my App. with svgalib and SDL.
I'd use the Linux framebuffer device instead of svgalib, if I were you.
> My Question: Can Anyone tell me, how to Code a app, that displays simple
> Graphics (such as Lines, Triangles, etc) on the screen, without running the
> XServer ???
Look for examples of rendering graphic primitives on the SDL website's
libraries page. Generally, you have to do all the rendering by hand, pixel
by pixel, into the surface's framebuffer. The libraries on that page do it
for you, or at least will give you an idea of how to do it.
Also do a websearch for Michael Abrash's Graphics Programming Black
Book...there are legal copies of it in PDF floating around the net. That
will give you some wicked fast, dark voodoo magic ways to render
primitives to a framebuffer.
In terms of SDL, you write to a linear framebuffer, and SDL gets it to the
screen. It handles the X-server, or svgalib, or whatever, behind the
scenes. If there's no X-server, it will try to fall back to other means of
display...you just need to set up your video mode and see if SDL could
accomodate it. Then you interact with SDL the same regardless of the
actual video target.
More information about the SDL