Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

cleves

SetDisplayMode

This topic is 5542 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, I did a simple directx program that sets the program to full screen with the resolution 640x480 the compile goes ok but when i run the program there is a Debug error telling me this: "The value of ESP os not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a diffreant calling convention" ...What the hell that means? Here is a part of my source code int Game_Init(void *parms = NULL, int num_parms = 0) { // create the DirectDraw object if (FAILED(DirectDrawCreate(NULL, &lpdd, NULL))) { // error } // end if // now query for IDirectDraw7 if (FAILED(lpdd->QueryInterface(IID_IDirectDraw7, (LPVOID *)&lpdd7))) { // error } // end if if (FAILED(lpdd7->SetCooperativeLevel(main_window_handle, DDSCL_FULLSCREEN | DDSCL_ALLOWMODEX | DDSCL_EXCLUSIVE | DDSCL_ALLOWREBOOT))) { // error } // end if // set display mode to 640x480x8 if (FAILED(lpdd7->SetDisplayMode(640, 480,8))) { MessageBox(NULL, "Error init SetDisplayMode:Error E/1", "DirectDraw Error", MB_OK | MB_ICONEXCLAMATION); return(0); } // end if // return success or failure return(1); } // end Game_Init Now, i have noticed that the problem happens only when i put the SetDisplayMode. if his not there the problem dosen''t accour. Thanks a lot

Share this post


Link to post
Share on other sites
Advertisement
cleaves you''re reading Tricks of the Windows Game Programing Gurus, aren''t you?
sorry can''t help you with that but if you''re reading the book I mentioned above you''ll have to do a lot of work to make things work. I had to rewrite almost every function in it. But it''s still worth reading. I like it.

The essence of balance is detachment.
To embrace a cause, to grow fond or spiteful, is to lose one''''s balance
after which, no action can be trusted.
Our burden is not for the dependent of spirit.
- Mayar, Third Keeper

Share this post


Link to post
Share on other sites
ya i''m reading that book...the book itself is good but damn i''m always got to change something

Share this post


Link to post
Share on other sites
quote:
Original post by cleves
"The value of ESP os not properly saved across a function call.
This is usually a result of calling a function declared with one calling convention with a function pointer declared with a diffreant calling convention"

...What the hell that means?



I suspect a driver bug, as you''re not (in this code at least) changing the call convention nor using assembly.
Update your gfx (and mainboard?) driver, and see if the problem goes away.
Been there myself...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!