PDA

Click to See Complete Forum and Search --> : Strange DD prob.


git
Apr 16th, 2001, 12:09 AM
Hiyas,

My Directdraw game is mostly working...but something very strange I came across :


Set DXTUnits = Nothing
DDsd3.lFlags = DDSD_CAPS Or DDSD_HEIGHT Or DDSD_WIDTH
DDsd3.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN
DDsd3.lWidth = 2300
DDsd3.lHeight = 50
Set DXTUnits = DD.CreateSurfaceFromFile(App.Path & "\DXTUnits.bmp", DDsd3)
DXTUnits.SetColorKey DDCKEY_SRCBLT, Key


That surface-loading code works perfectly on my Duron 800/GeForce 2 MX based machine. I run it at 1024x768 resolution, and I can run the game at virtually any resolution (usually at 640x480 or 800x600)...

However... On my P200, which runs at 800x600 (max supported res is 1024x768) and 640x480 in-game, I cannot get the game to work. When I debuged it, I found that it does not like the width being 2300: it dies on that line. I changed it to 640, it works. 641 and it dies.

What is wrong, how do I fix it, and how do I avoid it in happening again in the future? (btw I'd really prefer to keep the ability to have surfaces above 640x480...otherwise it will create a major pain for my game's development!)

-Git

PsychoMark
Apr 16th, 2001, 05:09 AM
It's not that strange, a lot of video cards can't handle surfaces wider than the screen. I think a solution is to add the SYSTEMMEMORY flag when creating the surface, this'll stop the surface from being created in Video Memory, but I think it'll be a little bit slower when performing blitting operations...

git
Apr 16th, 2001, 06:26 AM
Thanks - fixed it. =) I can't see any bad speed difference either...

-Git