[SDL] need to write directly to video memory, can I do it with SDL ?

Benno Senoner sbenno at gardena.net
Sat Apr 7 17:48:20 PDT 2001


On Saturday 07 April 2001 21:00, you wrote:
> > On Saturday 07 April 2001 04:09, you wrote:
> > > It is quite possible to write directly to video memory; that's what the
> > > XFree86 DGA extension is used for. You need write access to /dev/mem to
> > > do this, however.
> >
> > Yes, as said I can run the app as root, this is not a problem.
> >
> > The problem is to figure out the startaddress (offsets between row etc),
> > pixel layout etc etc. (eg if it is RGB, 8bit colormapped etc)
>
> No, the real problem is that the X server uses the hardware's accelerator,
> and if you try to access the video memory at the same time, you can lock
> up many modern video cards.  So, direct pixel access while the X server
> is still active handling windows is not practical.  You mentioned that a
> fullscreen application wasn't practical, so no, there's no way to do what
> you want.

Omk, thanks for the explanation, I haven't thought about the lockup issues, 
you are right. (modern gfx cards do have command queues and similar magic 
stuff).

So meanwhile I will use standard APIs (SDL & co),and I'm looking forward to 
support for hw-accelerated surfaces in windowed mode within SDL.

Sam, is this planned for the upcoming versions ?

AFAIK, the DRI kernel stuff allows one to share a gfx card (using low-level 
access methods) in a lockup-safe fashion among several apps, including the X 
server.
But I'm not informed what the actual status of the DRI APIs looks like.

Anyway, thank you again guys for all your infos.

cheers,
Benno.


>
> See ya,
> 	-Sam Lantinga, Lead Programmer, Loki Entertainment Software



More information about the SDL mailing list