where to put the back buffer?

Started by
3 comments, last by bingo 23 years, 5 months ago
I use directdraw and direct3d simultaneously. Most drawing is done with ddraw,some special effects useing d3d. So I don''t know where to put the back buffer,system memory or video memory? When in system memory,the d3d is very slowly,but if I put the back buffer in video memory,the speed is not good because too many drawing with ddraw. How can I do?
Advertisement
I don''t know what you mean by ''too much drawing'' but anyway:
put it in video RAM. Always!
If there is not enough video RAM free, DX will put it in system mem anyway, but always request it in videoRAM.

This way the flip operation can be performed by simply changing a pointer in the videocard''s hardware (DirectX does this for you), in stead of copying the contents of a backbuffer in systemmem into the display buffer.

Greetings,
Sven Vermeulen, Netherlands.

Would it make a difference if you did all your ddraw stuff on a buffer in system memory, then blitted it to a backbuffer in video memory and did the d3d stuff there? Let the two systems do their stuff in the optimal environment and just have one big data transfer in the middle.

Is it possible for you to separate the two stages out in this way? Or are the d3d ops intermingled with draw ones?

This is the best solution I can think of.

ro
Like you said, bingo, it''s going to be slow regardless of where you put it, because by accessing the surface with both D3D (GPU) and DDraw (CPU), you''re generating a lot of bus traffic. (I''m assuming that by "many drawing with DDraw" you mean doing lots of per-pixel stuff)

What I would try is to somehow emulate the DDraw stuff with D3D. Or you could try switching to DX8, which merges DDraw and D3D into a single API...

Good luck,

- Tom
Tom Nuydens delphi3d@gamedeveloper.org www.gamedeveloper.org/delphi3d
Thanks for everybody.
My english is poor,I''m sorry I can''t write clear.

I''m writing a 2D game,I define the image data format myself,
I write code for specially good effect:colorkey,alpha blending,
lighting,shading etc.But I can''t achieve some effect,so I use D3D.As much as I know,the Diablo II just like this.
Please give me more ideas. Thanks.

This topic is closed to new replies.

Advertisement