Background

  • A major feature of the OpenGL spec is that it is windowing system independent
  • Responsibilities of the windowing system:
    • Creation of the window
    • Handling of windowing system events (maximize, minimize, resize, move, ...)
  • Interactions between OpenGL and the windowing system are separate from OpenGL
  • GLX is an example which specifies the interaction between a windowing system (Xwindows) and OpenGL

 
 
 
 
 
 
 
 
 
 
 
 

 

Background (cont'd)
  • IRIS GL was the predecessor to OpenGL (back when dinosaurs ruled)
  • IRIS GL does specify the interaction between the window manager and rendering
    • defcursor()
    • winpop()
    • ringbell()
    • getvaluator(dev)
    • noborder()  I miss this one!
  • OpenGL assumes that other libraries will handle this interaction
    • Upside:  Opportunity to run of lots of different platforms
    • Downside:  Need to know the details that were previously hidden from you

 
 
 
 
 
 
 
 
 
 
 
 

 

Design Philosophy
  • GLUT simplifies the implementation of OpenGL applications
  • GLUT is "stateful" like OpenGL
    • The initial state is reasonable for most applications
  • Very few pointers are passed (pointers to strings)
  • NO window manager pointers are returned (a good thing)
  • Fonts are supplied by GLUT to avoid window system dependencies (limited but portable)
  • Simple menu sub-API is provided for pop-up menus

  •  

 
 
 
 
 
 
 
 
 
 
 
 

 

The GLUT API
  • Mixing GLUT with other APIs can be challenging 
  • Eventloop processing is the major obstacle
  • GLUT routines are organized into several sub-APIs:
    • Initialization. 
    • Beginning Event Processing.
    • Window Management. 
    • Overlay Management. 
    • Menu Management. 
    • Callback Registration. 
    • Color Index Colormap Management. 
    • State Retrieval. 
    • Font Rendering. 
    • Geometric Shape Rendering. 

 
 
 
 
 
 
 
 
 

 

  • Examples!
    • You will run these in the lab

     
     
     
     
     
     
     
     
     
     
     
     

     

    Versions
    • Current version is 3.7
    • Downloadable from http://www.opengl.org
    • Pre-compiled binaries are available

     
     
     
     
     
     
     
     
     
     
     
     

     

    Conventions
    • GLUT window and screen coordinates are expressed in pixels
    • The upper left hand corner

    • of the screen or a window is (0,0)
    • Note: This is inconsistent with OpenGL's

    • coordinate scheme that  (the lower left hand coordinate is (0,0)) but is consistent with most popular window systems.
    • All GLUT programs should have the following header
    • #include <GL/glut.h>
    • Portable ANSI C GLUT programs should not directly include <GL/gl.h>
    • Example compile line:
    • cc -o foo foo.c -lglut -lGLU -lGL -lXmu -lXi -lXext -lX11 -lm
       

     
     
     
     
     
     
     
     
     
     
     
     

     

    Session 2

     
     
     
     
     
     
     
     
     
     
     
     

     

    Title
    • Bullet 1
    • Bullet 2

     
     
     
     
     
     
     
     
     
     
     
     

     

    Title
    • Bullet 1
    • Bullet 2