SetOrthographicProjection

Advanced function

int screenWidth = SCREEN_W,
int screenHeight = SCREEN_H );

Sets the orthographic projection as the active OpenGL projection mode. Ortographic projection is used by default.

If you've selected a different projection mode in your OpenGL code you may wish to revert to ortographic projection by calling this function. The old projection mode is stored in the matrix stack and can be restored by calling RestoreOldProjection().

Note that you can choose the actual width and height of the screen. If the size of the program window is different from the given width and height the contents of the screen are stretched to fill the program window.

Note: There's an evil typo in the function name in the earlier versions of OpenLayer, where it's called SetOrtographicProjection.

Examples

// Reverts back to the orthographic projection mode if you've changed //
// the projection mode somewhere //
Settings::SetOrthographicProjection();

// If your program is supposed to run with 800 x 600 resolution but the actual resolution //
// is something else you can do this to make everything appear in the screen as if the //
// resolution was 800 x 600 //
Settings::SetOrthographicProjection800600 );


Other functions of the class Settings
SetAntialiasing
Turns the anti-aliasing on or off
SetCircleAccuracy
Sets the accuracy of the circle drawing functions
SetCollisionPolyAccuracy
Sets the accuracy of the generated collision polygons
SetCollisionPolyAlphaLimit
Sets the maxium alpha value which is considered transparent by the collision polygon generation

Advanced functions

SetTextureMapping
Turns the OpenGL texture mapping on or off
TextureMappingUsed
Returns true if texture mapping is turned on
SetOrthographicProjection
Sets the orthographic projection as the active OpenGL projection mode
RestoreOldProjection
Restores the old projection mode
StoreMemoryBitmaps
Choose the Bitmaps to be stored in the memory
MemoryBitmapsStored
Returns true if the Bitmaps are stored in the memory


Questions about SetOrthographicProjection? Click here.