Skip to main content
gamedev.net
🔒 Locked

SetDisplayMode problems

Started by Psychocatt Sep 12, 2000 at 12:06 PM 2 replies 600+ views
Original Post
Psychocatt
Psychocatt
I don''t know if this is a DX or compiler issue, so I try here first. When ever I try to compile my code, I get a ''SetDisplayMode does not take 5 param'' error. Now, I have looked into the DirectX help documents and unless I don''t know how to read, SetDisplayMode DOES take 5 parameters. Now, I played around with it and tried taking out the last two parameters. It compiles when I do that, but then DirectX returns with an Invaild Param error. I am using the 6.0 SDK. I just upgraded my video drivers and it looks like I have DX 7.0 runtime installed. Could there be some problems having it set up like this? Any clues? Thanks
ComputrJam
ComputrJam
Hmm, SetDisplayMode does take 5 parameters. And I don''t think having DX7 runtime will be a problem. Can you post some of your code?
Psychocatt
Psychocatt
Opps... I figured out what it was. I was using QueryInterface to get the version 4 of DD, but I was using a pointer to version 1 to hold it. Here is what I had

LPDIRECTDRAW lpDD; // Actual DD Object
LPDIRECTDRAW lpDDT; // Temp DD object

DirectDrawCreate(NULL,&lpDDT,NULL);
lpDDT->QueryInterface(IID_IDirectDraw4,(LPVOID *)&lpDD);
lpDD->SetDisplayMode(640,480,8,0,0);
// Using the prototype for ver.1, but the function for ver.4

Thanks for the quick reply though!
ComputrJam
ComputrJam
LOL, I''ve done that exact same thing before...

Glad you found your problem, there will be many more!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.