Lecture 2 Overview



The difference between graphics and other applications

Implications of this


Standard OpenGL Program you'll be writing

int main(int argc, char** argv)
{
/* 
 *	this talks to the particular display and opens the relevant window,
 *	sets drawing modes and gets the process started.
*/
        DisplaySetup(argv[0]);
/*
 *	this is a user written program to initialize data structures,
 *	define context, ...
*/
        my_init();
/*
 *	This sets up the necessary user interaction
*/
        MouseSetup();
/*
 *	This is the main loop, the function display() 
 *	is called at every refresh cycle.
*/
        auxMainLoop(display);
}

void DisplaySetup(char *av)     {
/* how to display */
        auxInitDisplayMode (AUX_SINGLE | AUX_RGB);
/* where to display */
        auxInitPosition (0, 0, 100, 100);
/* actually create the window */
        auxInitWindow (av);
/* what to do if the user reshapes */
        auxReshapeFunc (myReshape);
}

void InteractSetup(void)   {
/* if the left button is down and the mouse moves, calls pickLine */
        auxMouseFunc (AUX_LEFTBUTTON, AUX_MOUSELOC, pickLine);
/* if the middle button is down and the mouse moves, calls rotateLine */
        auxMouseFunc (AUX_MIDDLEBUTTON, AUX_MOUSELOC, rotateLine);
/* if the up arrow key is hit, calls hello	*/
        auxKeyFunc (AUX_UP, hello);
}

void hello(AUX_EVENTREC *event) {
    printf("hello there \n");
}

How the hardware works


Pieces of the hardware

Display on a raster graphics system

For this to work, everything that is drawn must be scan converted. That is, converted from a continuous figure into a series of dots (and possibly intensities) to be shown. The dots or intensities are written into the frame buffer and the process proceeds.


User Interaction

User Interaction devices

Logical classes

Physical classes


Making User Interaction meaningful

Guiding principles