video memory - ddraw

Started by
3 comments, last by stevenmarky 23 years, 11 months ago
I''ve heard that direct draw runs a lot faster if you load your bitmaps into video memory, but I don''t know how to do this, and would''nt direct draw do this by default anyway? //end
Advertisement
It would not be a good thing if Direct Draw loaded bitmaps into video memory as default. Why? Because not everyone has a graphics accelerator.

Just add the following flag to your dwCaps under DDSCAPS.

DDSCAPS_VIDEOMEMORY.

ie.

DDSURFACEDESC2 mysurface;//insert stuff heremysurface.ddsCaps.dwCaps|=VIDEOMEMORY;
actually, if you:

    DDSURFACEDESC2 myddsd;myddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;    


and then CreateSurface(), it will automatically put the surface in videoram unless you use the flag DDSCAPS_SYSTEMMEMORY. (at least on my banshee/bro''s Vodoo3/friend''s TNT... etc)

just a note....


http://www.ill-lusion.com
laxdigital.com
[email=ziggy@laxdigital.com]ziggy@laxdigital.com[/email]
Anonymous Poster - you DON'T need a graphics accelerator (i assume you mean 3d accelerator card) to load bitmaps into video memory, all you need is a video card with enough memory to hold more than just the primary and back buffer. Any vid card with more than 2 megs (depends on bit depth and resolution of app) of video memory can usually hold more stuff in video memory.

Also, to force direct draw to put a surface in video memory i believe you have to put:

DDSCAPS_OFFSCREENPLAIN / DDSCAPS_VIDEOMEMORY
(that shouldn't be a slash but the vertical line thing, the key below backspace, damn HTML)

this will never put a surface in system memory even if there is no video memory and the call will fail, which will most likely cause your app to crash, so DDSCAPS_OFFSCREENPLAIN is usually good enough.

+AA_970+

Edited by - +AA_970+ on June 11, 2000 4:43:54 PM
Hi!

If you just specify DDSCAPS_OFFSCREENPLAIN in dwCaps, DirectDraw will by default create you surface in videomemory. But, if DirectDraw cant find enough free videomemory, it will create your surface in systemmemory.

Yes, it''s faster to have your bitmaps in videomemory if all you''re doing is blitting them to the screen.
But remember that if you want to apply effects like aplhablending or other effects where reading from your surfaces is nessecary, it is faster having them in SYSRAM...

/ Tooon


This topic is closed to new replies.

Advertisement