Jump to content
  • Advertisement
Sign in to follow this  
Stutesman

OpenGL resolution

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

I was wondering if anyone new how to raise the resolution of the screen in my game. My bmp images look exatly how i want them when at my desktop resolution (1024 x 768) but when running in my program full screen they are too large, when i move the object further away from the camera to make it the size i want the image has lost some clarity. I am using all the code from NeHe's lesson 7 to open my window and such. http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=07 anyone who could help would be greatly appreciated Stutesman

Share this post


Link to post
Share on other sites
Advertisement
If you are using NeHe code from lesson 7, to raise the resolution simply modify this line (at the beginning of WinMain):


if (!CreateGLWindow("NeHe's Textures, Lighting & Keyboard Tutorial",640,480,16,fullscreen))



Change the 640 (width) and 480 (height) to the desired resolution, like this:


if (!CreateGLWindow("NeHe's Textures, Lighting & Keyboard Tutorial",1024,768,32,fullscreen))



Resolution: 1024x768 32bits

This should make the fullscreen mode the same resolution as your desktop ;)

Share this post


Link to post
Share on other sites
How are you drawing your bitmaps? If they're textures they should scale automatically. If you're using glDrawPixels you might have to scale them manually - I don't know enough about OpenGL.

In Windows you can scale bitmaps using StretchBlt, StretchDIBits, or StretchDIBitsToDevice.

I don't recommend forcing a particular screen resolution.

Share this post


Link to post
Share on other sites
The glPixelZoom() function can be used to scale images in OpenGL. But I think just treating it as a texture would be easier.

Share this post


Link to post
Share on other sites
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!