direct access to video memory

Started by
12 comments, last by supagu 21 years, 2 months ago
is it possible to get direct access to video memory in opengl, as in directx direct draw? so i can plot my data strait to the memory so it gets displayed into the screen, would save some pain :D thanks
Advertisement
No, and it''s a good thing too

You can use glWritePixels if you must.
You have to use DirectDraw under Windows and GLX (AFAIK) under Linux to get direct frame buffer access

"No, and it''s a good thing too"
Wrong, indirect transfers are slower
It''s a pain for the gaphic card when you write directly to its memory...

It''s better when it''s painfull for you rather than the hardware.
Obviously it''s better when it''s painfull for noone/nothing.


-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
okay so to display a texture on i just have to loop through and use glWritePixel, any ideas on its parameters, cuz i did a quick search with google, and there are no examples or definitions of glWritePixel that came up
To display a texture you map the texture to a quad and display that. Check out the NeHe tutorials.

http://nehe.gamedev.net/
quote:Original post by supagu
okay so to display a texture on i just have to loop through and use glWritePixel, any ideas on its parameters, cuz i did a quick search with google, and there are no examples or definitions of glWritePixel that came up



Look in MSDN. msdn.microsoft.com
Member of the Shove Pouya Off A Cliff club, SPOAC. (If you wish to join, add this line to your signature.)Member of "Un-Ban nes8bit" association, UNA (to join put this in your sig)"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"
It''s glDrawPixels. There is no glWritePixel.

If you want to draw a texture straight the to the screen without any geometry glDrawPixels can be used:

glDrawPixels( imagewidth, imageheight, GL_PIXEL_FORMAT, GL_DATA_FROMAT, pointer_to_data ); 


where GL_PIXEL_FORMAT is something like GL_RGB and GL_DATA_FORMAT is something like GL_BYTE_UNSIGNED. The last parameter is a pointer the the texture data you have loaded. This will draw the entire texture to screen in one go.
Sorry, yeah, my bad

This topic is closed to new replies.

Advertisement