PDA

View Full Version : What the hell does "Use system memory" do????



Huehnerschaender
13-08-2004, 08:12 PM
Hi guys,

here is a question I could not find any answer by myself:

What exactly does the flag "use system memory" ?

I have the following problem:

1st PC:
Laptop, Centrino 1,7 Ghz, ATI Radeon 9000 mobility, 512 MB RAM.
All settings (DxDraw and all images in list) use system memory = true
-> Framerate about 100 (I'm doing lot of graphics at a time)

All settings (DxDraw and all images in list) use system memory = false
-> Framerate about 15-20!!!!

2nd PC:
Desktop, Athlon 2000XP GeForce 4 Ti 4200, 512 MB RAM
All settings (DxDraw and all images in list) use system memory = true
-> Framerate about 50 (I'm doing lot of graphics at a time)

All settings (DxDraw and all images in list) use system memory = false
-> Framerate about 6-10!!!!

In some cases (when doing no blurring, no alpha or something like that about 100), weird, eh?

Why is this setting slowing it all so much down? On other systems it seems that use system memory is more effective when set to FALSE!

I can't image what this really affects. I thought that system memory means loading the graphics to RAM instead of video memory, that would explain why the graphics are fasten on a shared memory graphic card (in laptops). But on my desktop PC it slows the system also down when set to false.

Any hints? Would be very nice, because if I understand the meaning of it, I could get the fastest framerate out of my game on every different PC by letting the user set this flag or not.

Greetings,
Dirk

Paulius
13-08-2004, 09:27 PM
It creates surfaces in system memory if True and in video memory if false, it is slower to blit (Draw, StretchDraw) in system memory but it is horribly slow to read from video memory. Pretty much all that DirectDraw really does is blitting, effects like blending, rotating or whatever requires accessing and fiddling with surfaces pixels directly, so you should generally keep surfaces which will be fiddled with in system memory and in video memory otherwise.

Huehnerschaender
13-08-2004, 10:34 PM
...so you should generally keep surfaces which will be fiddled with in system memory and in video memory otherwise.

So everything I just want to put on the screen should be in video memory and everything I want to blend, rotate etc. should be in system memory, is this right? And there is no difference between shared memory graphic boards and video cards with own memory?
Thanks for the quick answer!!!

Greets,
Dirk

Paulius
14-08-2004, 10:04 AM
You should draw your images with effects on a software surface and then blit that to the backbuffer, it's a pain to organize as you usually want that stuff on top, the simplest alternative is to use pre processed images (like if you want to make some image rotatable, you could store it's variants already rotated is a couple of directions and then use the image closest to your wanted direction when drawing), if you really want eye candy at acceptable speeds then DirectDraw is not the way to go.

Huehnerschaender
14-08-2004, 11:01 AM
Hi Paulius,

thanks for your advices. What would you suggest for programming a 2D game with effects like alphablending, blurring, rotate etc. ?

Greets,
Dirk

Paulius
14-08-2004, 11:30 AM
You can take advantage of 3D hardware which makes blending and any transformations practically free with Direct3d or OpenGL, the later being easier to learn. If you don't want to get deep into 3D API which might seem confusing at first, you might investigate some components like GLXTreem or PowerDraw.

Huehnerschaender
14-08-2004, 08:38 PM
You can take advantage of 3D hardware which makes blending and any transformations practically free with Direct3d or OpenGL, the later being easier to learn. If you don't want to get deep into 3D API which might seem confusing at first, you might investigate some components like GLXTreem or PowerDraw.

Hi Paulius,

I just tested out the GLXtreem components and its demos.
Really nice what comes with the packege, but there is no single demo how to programm 2D applications... Do you know some tutorials on GLXtreem concerning 2D?

Greets,
Dirk

cairnswm
16-08-2004, 05:25 AM
The ImageList example shows how to do 2D in GLXTreem.

cairnswm
16-08-2004, 06:14 AM
Send me an email if you want a template that does 2D game dev at opengl level bypassing all the component levels - I've just got it working - I will probably stick to GLXTreem for the near term but I may use the straight opengl level stuff if GLXTreem starts giving me problems. (Its not VCL based so has a smaller EXE size as well)