IDirectDraw.SetDisplayMode not supported at all...

Started by
3 comments, last by Muhammad Haggag 19 years, 7 months ago
SetDisplayMode's signiture is: int SetDisplayMode(this, int width, int height, int bpp); I can't get it to return DD_OK (0) for any value of bpp. Ie, it won't work for 32 bpp to 0 bpp; it will onlly return DDERR_UNSUPPORTED (080004001h). I'm calling SetCooperativeLevel with the corresponding parameters as well. That is, the api says the flags must be DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN. The only other parameters are width and height, which I set both to 400 pixels for testing. I want to know if the SetDisplayMode returning DD_OK is needed before you start drawing. Why I question?: I'm using the source code of a working app, and I'm following the api calls exactly. Yet the app, a simple plasma demo, works. I know, the logical thing is to try continuing even with DDERR_UNSUPPORTED, but it still bugs me, so to speak. Thanks for any reply. add: And no i'm not passing in the this pointer as is in the signiture. I'm doing this in assembly, so passing this is done explicitly, and i'm doing that correctly too. If you change the way i pass this SetDisplayM will return DDERR_INVALIDPARAMS... add0: Extra info: I'm on a laptop with a mobility radeon (don't know what model), and i've dedicated 32MB of ram to it. Is there a newer version of DirectDraw I should try? I think the DD i'm using that's in ddraw.dll is DD7.
"I study differential and integral calculus in my spare time." -- Karl Marx
Advertisement
There is no fullscreen resolution of 400x400 on any card. Stick to 640x480, 800x600 etc. or enumerate the display modes and select one from there.
Wow, thx Prototype. I'll go try that now. But the thing that still bugs me is that the demo source i'm looking at uses 200 x 200 with no problem. They are even drawing the images at .... *looks at the demo source again* Duh! I see it now, the demo uses width= 320, height = 200!!!! I'm such an idiot! OGM. Note to self: never pick arbitrary display heigh/width whne testing!
"I study differential and integral calculus in my spare time." -- Karl Marx
OMG! It works now! REjoiCE! Thanks all/
"I study differential and integral calculus in my spare time." -- Karl Marx
On the lower end of resolutiosn you have:
320x200
320x240
400x300
512xdon't-remember
640x400
640x480
800x600
...etc

This topic is closed to new replies.

Advertisement