Gimme that video-memory address!

BlitzMax Forums/OpenGL Module/Gimme that video-memory address!

ImaginaryHuman(Posted 2005) [#1]
Does anyone know if there is a way to find out the memory address in video ram at which the backbuffer is currently located? Even if it might change with each Flip, if I could find out the memory location then maybe I could directly render pixels to it rather than have the GFX card have to go via the OpenGL driver?


Damien Sturdy(Posted 2005) [#2]
...effectively using software rendering then... WHy would you need to do this? I dont know of a way- Dont think its even possible with modern hardware....


*(Posted 2005) [#3]
brings me back to the old days of C when you had to poke $B800 to change video ram, oh happy days ;)


ozak(Posted 2005) [#4]
Eh. I don't think that's possible anymore :)


AntonyWells(Posted 2005) [#5]
You can 'blit' directly to software memory and upload it to the backbuffer.

There's supposed to be a way of setting up gl's pixel pipelines so that such copies are pretty much direct without any processing, but it's still going to be relatively slow.


Damien Sturdy(Posted 2005) [#6]
EdzUp- Yeah..

My conversion of Den bros 3 to pc (half ass finished) still uses its original media- and the backgrounds are dumps of Vid Mem :D


ImaginaryHuman(Posted 2005) [#7]
I know you can render to memory and then upload it to the backbuffer, and that it's slow. I also know that plotting a lot of individual pixels requires setting up vertexes and colors for each one, which I'm sure must be slower than just getting the CPU to render `pixels` directly into the backbuffer, of a given color.

I know that somewhere in the system there is some kind of management of the video memory, ie by OpenGL, as to where the buffers are and at what address etc. It would be nice to get a `lock` on that for direct access over the bus, and not in a way that has to save it off to a pixmap first.


Dreamora(Posted 2005) [#8]
The only way to paint directly to the graphics hardware are pBuffers which needs something around a real GeForce4 (think it is the same in technic as Render to Texture support in DX)

Link from the superbitmapsthread: http://www.opengl.org/documentation/extensions/EXT_framebuffer_object.txt

Don't think you really can access the backbuffer without a slugish "hack" which risks to be very graphics card specific (especially the standard NVIDIA - ATI problems in opengl)