Opengl - Control Functions
Opengl - Control Functions
The position of the window is with reference to the origin. The origin (0,0) is the top
left corner of the screen.
glutInit allows application to get command line arguments and initializes system
glutWindowSize in pixels
glutWindowPosition from top-left corner of display
glutCreateWindow create window with a particular title
We may obtain undesirable output if the aspect ratio of the viewing rectangle
(specified by glOrtho), is not same as the aspect ratio of the window (specified by
glutInitWindowSize)
Viewport – A rectangular area of the display window, whose height and width can be
adjusted to match that of the clipping window, to avoid distortion of the images.
void glViewport(Glint x, Glint y, GLsizei w, GLsizei h) ;
The main, display and myinit functions
In our application, once the primitive is rendered onto the display and the application
program ends, the window may disappear from the display.
Event processing loop :
void glutMainLoop();
Control Functions
glutInit(int *argc, char **argv) initializes GLUT and processes any command line
arguments (for X, this would be options like -display and -geometry). glutInit() should be
called before any other GLUT routine.
If you want a window with double buffering, the RGBA color model, and a depth buffer,
you might call
glutInitWindowPosition(int x, int y) specifies the screen location for the upper-left
corner of your window
glutInitWindowSize(int width, int size) specifies the size, in pixels, of your window.
Source : http://elearningatria.files.wordpress.com/2013/10/cse-vi-computer-graphics-and-
visualization-10cs65-notes.pdf