Skip to main content
GameDev.net gamedev.net
🔒 Locked

VRAM Management

Started by turtle1776 Mar 12, 2003 at 7:34 AM 2 replies 2k views
Original Post
turtle1776
turtle1776
This question is from a C++ newbie who is approaching DX for the first time. Is it possible to quickly and easily swap images back and forth between VRAM and RAM using C++ with Direct X? I have an older laptop with just 8 MB of VRAM. It easily runs some older titles like Starcraft and Diablo. Those games, it seems, use way more than my 8MB limit. (I have been making a game of my own using those graphics as temporary placeholders until I draw my own, so I know). That tells me that since these games are using Direct X, and I assume they were programmed in C++, they are somehow getting around my VRAM limitations. But how? Patrick Lester - Blitz Basic User Compaq Laptop AMD-K6(tm)-2/ at 350 MHz : Memory 160 Megabytes Video = ATI RAGE LT PRO AGP Graphics Controller
thona
thona
quote:
Is it possible to quickly and easily swap images back and forth between VRAM and RAM using C++ with Direct X?


MAYBE on older cards, not on newer ones.

NOW - the no is regarding the one of the directions. UPLOADING data to the card is normally blazing fast, DOWNLOADING is SLOW.

They are just not optimisedto get data out of them.

Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
RegardsThomas TomiczekTHONA Consulting Ltd.(Microsoft MVP C#/.NET)
turtle1776
turtle1776
Thank you for the quick response. I was more concerned about uploading to the video card from RAM anyway. On my own, admittedly dated laptop, I have over 100MB of RAM and just 8MB of VRAM. If I need to "swap" images between them, I can just keep copies of everything in RAM, and "upload" images as needed to VRAM, delete them from VRAM when they aren''t needed, and then upload again when needed, and so on.

At least that is how I understood your response. Which commands should I be looking for in the DirectX SDK to do this?

thona
thona
quote:
Which commands should I be looking for in the DirectX SDK to do this?


Not sure - I only use C#. You would basically create a rendertarget and lock it, to get a pointer to the byte array you can push your data to, then unlock.

Make sure your lock flags say that the data is discardable, otherwise you get the transfer down :-)


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
RegardsThomas TomiczekTHONA Consulting Ltd.(Microsoft MVP C#/.NET)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.