Skip to main content
gamedev.net
🔒 Locked

Changing resolution

Started by Stranimondi 4 replies 3.5k views
Original Post
Stranimondi
Stranimondi
Hi, I'm writing an application using OGL and I would like to know how to change the resolution in which the image is drawed. I also link the code that I've been using as a base for my application in which the resolution is specificied (I donnow where..). http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=01
Fahrenheit451
Fahrenheit451
There should be two lines in a NeHe example. One that performs the initial window creation (somwhere near the start of the WinMain function), and one when the screen is toggled between window and fullscreen modes (somewhere near the end of the WinMain function). Look for this line:

CreateGLWindow("NeHe's OpenGL Framework",640,480,16,fullscreen)

The 640, 480, and 16 are the screen width, height, and bits per pixel.

hth
F451
Stranimondi
Stranimondi
Thanks a lot! But this just rise me a question (excuse my ignoance): what is pixel bitsize useful for?
Cheers!
Hesterumpe
Hesterumpe
Bits per pixel (BPP) or bitdepth is how many bits you use per pixel (duh!), divide by four (three if no alpha) and you have bits per color channel. So in 24bit you get 8 bits per color, and no alpha. It simply amounts to how many colors you can display: 2^24 = 16,777,216 distinct colors. More colors means less banding, but requires more RAM and CPU/GPU power.

Usualy the choice is 16 or 32 (8bit is all but dead). 32 means 8bits per color, and 8 bit "wasted", so actually 24 bits.
lc_overlord
lc_overlord
Quote:
Original post by HesterumpeMore colors means less banding, but requires more RAM and CPU/GPU power.


Not on todays hardware, 16 bit is emulated in 32 bit mode, so it doesn't take less ram/cpu, it takes the same amount(save for the texturespace) if not more.
infact, today 16 bit is all but dead and 32 bit is soon to follow.
the extra 8 bits in 32 bits are not wasted, it's just not renderd, but it is used internaly.

Stranimondi
Stranimondi
Cheers guys, now I got everithing I need to enter endless debug sessions! :-)
Your help's been very useful.

Topic Locked

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

Sign in to reply to this topic.