Pelles C forum

C language => User contributions => Topic started by: Athlor on April 13, 2005, 11:23:01 AM

Title: DirectDraw Voxel Engine
Post by: Athlor on April 13, 2005, 11:23:01 AM
Yet another conversion, I upgraded it to use DirectDraw7 as well. It starts off in a demo mode where it flys across the landscape.
Title: DirectDraw Voxel Engine
Post by: Athlor on April 13, 2005, 11:33:13 AM
Here is an alternative Heightmap and Colormap for the DD Voxel Engine.
Title: DirectDraw Voxel Engine
Post by: drakoh on April 13, 2005, 09:17:03 PM
hey thx for your work ! I guess a little screenie could bring more people to be interested about it !
Title: DirectDraw Voxel Engine
Post by: JohnF on April 14, 2005, 07:46:24 AM
It doesn't work properly on two machines I have. See image, any ideas why?

John

(http://www.btinternet.com/~john.findlay1/Image1.gif)
Title: DirectDraw Voxel Engine
Post by: Athlor on April 14, 2005, 01:54:40 PM
Do you have directdraw refresh rate changed from the standard 60hz?
You might try recompiling it with a different resolution, like 320x240.
Another thing you might try is forcing a 60 hz refresh rate by changing a parameter in line 245-246 from:
Code: [Select]

  if ((ddrval=IDirectDraw7_SetDisplayMode(DD,SCREEN_WIDTH,SCREEN_HEIGHT,
                                                       SCREEN_BPP,0,0))!=DD_OK)

to:
Code: [Select]

  if ((ddrval=IDirectDraw7_SetDisplayMode(DD,SCREEN_WIDTH,SCREEN_HEIGHT,
                                                       SCREEN_BPP,60,0))!=DD_OK)

As it is it assumes the driver default. It works fine with with my machines. I'm quite puzzled.
Title: DirectDraw Voxel Engine
Post by: Pelle on April 14, 2005, 02:03:39 PM
I got the same problem as John, on my newer development machine, but it works on my older test machine.

I tried your suggestions, but no difference here at least...

Pelle
Title: DirectDraw Voxel Engine
Post by: JohnF on April 14, 2005, 02:07:14 PM
Forcing the refresh rate did not help just like Pelle reported. It's strange because no other DrirectDraw app has ever caused a problem.

John
Title: DirectDraw Voxel Engine
Post by: Ngan Lo on April 15, 2005, 05:48:17 AM
yes, JohnF is right, i having the same problem too.

i havent touch DirectDraw for couple years, since i moved to D3D, i think it's about the memory addressing, the memory pitch (after Locking) seens not correct, b'cuz it may not work on other video cards.  :(

just a guess, hope this help.  :oops:
Title: DirectDraw Voxel Engine
Post by: Athlor on April 15, 2005, 01:55:53 PM
Initially it looked like a refresh problem to me. But now, I think Ngan Lo is right. I'm going to try to address the, ah, memory address problem. I'm sorry to disappoint you but I did only have older machines to test it on.
Title: DirectDraw Voxel Engine
Post by: JohnF on April 15, 2005, 02:50:04 PM
Quote from: "Athlor"
Initially it looked like a refresh problem to me. But now, I think Ngan Lo is right. I'm going to try to address the, ah, memory address problem. I'm sorry to disappoint you but I did only have older machines to test it on.


No worries, just make sure you fix it, or else! javascript:emoticon(':wink:')
Wink

John
Title: DirectDraw Voxel Engine
Post by: Pelle on April 15, 2005, 03:27:01 PM
Yeah, no problems. I just don't know enough about DirectX to fix it myself...

Pelle
Title: DirectDraw Voxel Engine
Post by: Ngan Lo on April 16, 2005, 06:55:29 AM
Hi, Athlor, i just remember the Locking surface rules, u have to use the pitch size (ddsd.lPitch, an offset size of screen memory), b'cuz DDraw is not giving u the exact screen-width when u initial primary/back buffer (i mean different video cards).  :shock:

but i really forgot where to use the pitch size after Locking, sorry...  :oops: