Hello all. It's been quite a while now since I've visited. I guess moving, and not having internet at home really makes a dent in your online life. :)
I'd like to know how to obtain a raw linear chunk of video memory.
I'm trying to make my own Surface class, and memory managment is a bit of an issue, so I can't just rely on a surface structure provided by, for example, the SDL, DirectX, or what not.
I need a chunk of raw video memory that I can divide between a number of surfaces myself. How do I do this?
I'm at work now, and I may not respond for a day or so. Feel free to make a few assumptions, and suggest anything that comes to mind. I'll answer any questions when I get the chance.
Video Memory Access in C++
Started by roboticforest, May 19 2009 02:48 PM
5 replies to this topic
#1
Posted 19 May 2009 - 02:48 PM
Dave
|
|
|
#2
Posted 19 May 2009 - 03:10 PM
Off hand, it seems like it would depend on the video card.
#3
Posted 27 May 2009 - 02:10 PM
Indeed. I'm sure it does. However it's the OS's job to abstract those details away. DirectX, and SDL each provide a "surface", but my problem is that I'm trying to design my own surface object.
I could just make use of the raw memory pointer in an SDL_Surface, but that sounds unsafe and stupid considering its supposed to be a private data member. What I need is to obtain such a pointer myself, yet I don't know how the SDL got one.
I could just make use of the raw memory pointer in an SDL_Surface, but that sounds unsafe and stupid considering its supposed to be a private data member. What I need is to obtain such a pointer myself, yet I don't know how the SDL got one.
Dave
#4
Posted 28 May 2009 - 06:40 PM
It depends on the operating system. Either way you'd have to make some system-dependent calls. The actual layout of the memory is device-dependent and would require the use of a device driver. Why is memory such an issue? Is this for an embedded system or something? Because that's the only thing I can think of that would require such stringent requirements on your part. Libraries such as DX and OGL are pretty highly optimized for this kind of thing.
#5
Posted 01 July 2009 - 02:24 PM
I know it's system dependant, so lets assume I'm on Windows. (I would also like to know about Linux and Mac at some point.)
I'm trying to get a pointer to a chunk of video memory in some form. I'm not trying to get a pointer to anything in the monitor, or currently on the screen. Specifically, I'm trying to get a pointer to any memory the video card says that it has.
How do I get such a pointer?
I'm trying to get a pointer to a chunk of video memory in some form. I'm not trying to get a pointer to anything in the monitor, or currently on the screen. Specifically, I'm trying to get a pointer to any memory the video card says that it has.
How do I get such a pointer?
Dave


Sign In
Create Account


Back to top









