This is a discussion on Video memory buffer allocation in windowed mode - Questions ; Hi everyone. Maybe you can redirect me to another more specialized group if I seem irrelevant! My problem: I want to allocate a video memory buffer of user-specified size (given it fits in memory) that will be displayed in a ...
Maybe you can redirect me to another more specialized group if I seem
My problem: I want to allocate a video memory buffer of user-specified
size (given it fits in memory) that will be displayed in a window on X
using a recent distro, like Mandrake, Gentoo or Redhat. I also want to
do it NOT in fullscreen mode. The purpose of this is to write directly
in video memory the result of a graphical operation without having to
copy it from processor to video afterwards, thus gaining a very good
performance leap. I can do it in Windows using DirectDraw, which will
allocate a buffer in physical address and map it in logical address. I
can then blit my data from the hardware buffer to the screen buffer
with the hardware only, use almost no cpu or bus bandwith for the
blitting. And in the event the window is moved around, I don't have to
track it to make sure everything is redrawn (like other windows and
the background) or handle the fact that the taskbar may show up, since
I'm not drawing directly on the screen memory, but somewhere else in
Now here's the investigation I've made for X, and feel free to correct
-SDL won't allow this unless you're in fullscreen. If you create a
surface or window with the SDL_HWSURFACE attribute, you will get a
surface with SDL_SWSURFACE instead. I tried the X11 driver (won't work
of course) and the directfb driver, which allocates a SDL_HWSURFACE it
(yea!) but then steals the whole screen.
-DirectFB itself does not seem to support this, unless you use it's
own window manager.
-The DRI allows for direct hardware access too, but then again I can't
tell Opengl to give me some memory and a pointer to mapped logical
-I can't find if the FrameBuffer device gives me access to offscreen
memory, and then how I would blit that to a specified coordinate in
So, is there another library out there to manage video memory with X
and not be limited to fullscreen, map a buffer to usable logical
addresses, so I can work on that buffer directly and not have to copy
it after a first copy is made into processor memory?
Thank you very much.