Download Lecture 3: Computer Graphics - Graphics System and Input/Output Devices and more Study notes Computer Graphics in PDF only on Docsity! Introduction to Computer Graphics Farhana Bandukwala, PhD Lecture 3: Graphics System Outline • Raster system architecture • Input and Output Devices & Interaction (Angel, Section 3.2) • Client/Server operating model(Angel, Section 3.3) • Graphics pipeline Input devices: others • Keyboard • Choice devices: function keys • Voice recognizers • 3D devices – Joysticks – Spaceball – Data Glove Common output devices • CRT – Electrons directed towards phosphor-coated screen which emits light at discrete points • LCD – Polarizing crystalline molecules • Active matrix panels – LCD with a transistor at each point • Plasma panels – Array of tiny neon bulbs -> no refresh! Interaction tasks • Positioning – Coordinate systems, resolution • Selection – Choice sets: objects, properties,commands • Text input – Application does not interpret input • Quantification – Numeric range Event processing (example) 1. Create menu & Register callback glutCreateMenu(void (*func)(int entryType)) 2. Add Menu Entries glutAddMenuEntry(char *name, int entryType) 3. Implement callback function • Performs different actions depending on value of entryType #define MENU_DISPLAY 1 #define MENU_EXIT 2 // Menu callback function void menuCB(int menuEntry) { switch (menuEntry) { case MENU_DISPLAY: ... break; case MENU_EXIT: ... exit(0); break; } } int main(int argc, char ** argv) { ... // Create menu and register callback int menuID = glutCreateMenu(menuCB); // Add Menu Entries glutAddMenuEntry(“Display”,MENU_DISPLAY); glutAddMenuEntry(“Exit”,MENU_EXIT); // Process events glutMainLoop(); } Client server model • Window management system – Window manager: • interacts with applications requesting operations on windows • Allocates screen space for applications (windows) • Routes events to appropriate applications – Window system: • Low level functions which manipulate windows (Xwindows) • Window management system is a server • Applications which use system are clients Communications for Client/Server • Interprocess communication protocol • Need to minimize communication delays – Asynchronous messages (events) – Design single message to replace multiple messages – Move more functionality into server Application 1 Application 2 High level graphics pkg (Open GL) Window System (& Basic Graphics) Operating System (& Video Controller) System Hardware (& Graphics accelerator) Clients Server