Jump to content
  • Advertisement
Sign in to follow this  
bcsoft

Window setup in PopCap framework

This topic is 3257 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

Any Popcap framework gurus out there? I used the popcap framework for my recent game release a couple months ago and I've been getting reports back that the graphics look pretty bad. It sounds like there's some funky things going on with the window creation and scaling on the variety of displays out there. My window also failed various testing having too low of a dpi for some portals and upcoming windows 7 requirements. I'm wondering if there's any popcap framework gurus out there who've run into the same thing, and already reworked the window setup and can suggest some adjustments to me. I've haven't had need to look at it until now, and there appears to be some wacky code here (and hardcoded numbers which always sets off a red flag) that doesn't make a lot of sense to me (though I have a history of console programming so I'm not a PC pro). Here's what it looks like: DWORD aWindowstyle = WS_CLIPCHILDREN | WS_POPUP | WS_BORDER | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX; if (mEnableMaximizeButton) aWindowstyle |= WS_MAXIMIZEBOX; RECT aRect; aRect.left = 0; aRect.top = 0; aRect.right = mWidth; aRect.bottom = mHeight; //GetSystemMetrics() ??? BOOL worked = AdjustWindowRect(&aRect, aWindowstyle, FALSE); int aWidth = aRect.right - aRect.left; int aHeight = aRect.bottom - aRect.top; // Get the work area of the desktop to allow us to center RECT aDesktopRect; ::SystemParametersInfo(SPI_GETWORKAREA, NULL, &aDesktopRect, NULL); int aPlaceX = 64; int aPlaceY = 64; if (mPreferredX != -1) { aPlaceX = mPreferredX; aPlaceY = mPreferredY; int aSpacing = 4; if (aPlaceX < aDesktopRect.left + aSpacing) aPlaceX = aDesktopRect.left + aSpacing; if (aPlaceY < aDesktopRect.top + aSpacing) aPlaceY = aDesktopRect.top + aSpacing; if (aPlaceX + aWidth >= aDesktopRect.right - aSpacing) aPlaceX = aDesktopRect.right - aWidth - aSpacing; if (aPlaceY + aHeight >= aDesktopRect.bottom - aSpacing) aPlaceY = aDesktopRect.bottom - aHeight - aSpacing; } if (CheckFor98Mill()) { mHWnd = CreateWindowExA( 0, "MainWindow", SexyStringToStringFast(mTitle).c_str(), aWindowstyle, aPlaceX, aPlaceY, aWidth, aHeight, NULL, NULL, gHInstance, 0); } else { mHWnd = CreateWindowEx( 0, _S("MainWindow"), mTitle.c_str(), aWindowstyle, aPlaceX, aPlaceY, aWidth, aHeight, NULL, NULL, gHInstance, 0); } Any suggestions? Thanks! -Bryce

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • 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!