(Graphic) memory usage
Since i'm porting Goose Chase to 2D from 3D, I decided to take a closer look at how much memory I can allocate for my sprite sheets. I'm interested mostly in performance and hardware support for memory surfaces in DirectDraw3 (tried using the lowest common denominator for win32 systems, so it will run in most systems and in good performance).
I know that once video memory is full, DirectDraw should use system memory - but i had problems with DX and "should" with Direct3D. Also, I'm about to use a nice sum of memory (about 10-15mb) for my sprite sheets (lots of characters, effects, ect.), so I'm quite worried about performance in older machines.
Should anyone have experience with memory allocation in platform/other-graphically-rich games, please share
I don't believe DDraw will manage where your graphic data goes for you. You will have to make those decisions. I don't really understand why you chose DX3 - DX5 is the lowest common denominator for OS's supported by MS, and even that's not going to be the case for too much longer.
And as far as performance - when Derelict was a DirectDraw game, the best performance I saw out of it was when I put basically everything in system memory, blitted it all to a system memory buffer, and then did one blit of that system memory buffer to the back buffer of the card. If you are going to have that much graphic data, this will likely be the case for you, too, and will also allow support of cards with much lower memory sizes.
Last edited by Mark Fassett; 08-14-2004 at 11:08 AM.
Actually, it is DX5 - its DirectDraw version is 3
Originally Posted by Mark Fassett
Thanks for the advice, I was worried about system&video card memory managment. What about performance? was it acceptable (especially in older machines) ?
Speed is best when blitting from graphics card memory to graphics card memory, and next best when blitting from system to system. On AGP cards the speed at which data can cross from system memory to graphics card memory is also very good, (that is the whole point of AGP cards).
Most have PC's are AGP now, but DX5 era machines generally aren't, and in that case blitting from system to graphics card memory is slowest of all.
So for top performance, put everything on the card and make sure the backbuffer is on it too (it generally HAS to be but I think that DirectX will simulate one under some circumstances, specifically in Windowed mode).
After saying all of that, on a modern machine this is all pretty immaterial. No matter where you put your graphics then it's going to be fast. Unless you're writing specifically for 100mhz PC's with DirectX5 then you can safely forget about memory location and just make sure your program will function if for some reason someone with a 1 or 2Mb graphics card tries to run it.