Lecture 1:
Windows

Contents

Lecture Objectives

1-1

OpenGL is for Rendering, not Windowing

1-2

The Three Requirements

1-3

GLUT to the Rescue!

1-4

Initializing the GLUT Library

1-5

Retrieving GLUT State Information

1-6

Initializing the Window Size and Position

1-7

Configuring a Window

1-8

Creating a Window

1-9

Registering a Display Function

1-10

The Main Loop

1-11

Example: window.c

1-12

Clearing the Window

1-13

How Many Colors Are Available?

1-14

Setting the Clear Color

1-15

Making Sure Everything Is Drawn

1-16

Really Making Sure Everything Is Drawn

1-17

Checking For Errors

1-18

Example: background.c

1-19

Input Processing

1-20

Keyboard Callback for ASCII Input

1-21

Keyboard Callback for Special Keys

1-22

Forcing a Redisplay

1-23

Example: input.c

1-24

Lab: Color and Input

1-25

OpenGL C Quick Reference

1-26