SGI Windows NT Toolbox
|Download Files|

MultiOGL project
a multithread multicontext OGL app

This example was inspired by David Yu's cylsproc.c -- a sample program using OGL with pthreads on IRIX. (see https://toolbox.sgi.com/toolbox/src/exampleCode/opengl/sproc/)

On NT, starting with an MFC Multi Document Interface (MDI) and using wgl*, the MultiOGL example begins a thread via AfxBeginThread to do the OGL rendering of a cylinder. Each thread uses its own OGL context.

Main Window allows (some standard MFC features have been disabled):

    File   -> Exit
    Window -> New Window: creates a new MultiOGLView
                          instance and starts an OGL
                          Rendering Thread
                          Each view is cascaded over 
                          the previous view(s).
    Window -> Tile: Tile the views instead of cascading     
    Help   -> About: simple about dialog
MultiOGLView.cpp demonstrates the setting of events and communication with the OGL rendering thread:
    ONSIZE: resizes the view accordingly and resets the viewport
    SETFOCUS: adds blue hightlight to the cylinder
    KILLFOCUS: removes the blue highlight from the cylinder

Files:
MultiOGL.h      MultiOGL.cpp         Application class
                                     (from App Wizard)

MainFrm.h       MainFrm.cpp          MDI main frame

ChildFrm.h      ChildFrm.cpp         MDI child frame

MultiOGLDoc.h   MultiOGLDoc.cpp      Doc 

MultiOGLView.h  MultiOGLView.cpp     View
                All wgl* and OGL code is here.

                Each view instance does an AfxBeginThread
                to start an OGL render procedure,
		OGLRenderThreadProc.

StdAfx.h        StdAfx.cpp           Precompiled Headers

Author:  Mary McQueen
Applications Engineering
SGI Computer Systems
mmcqueen@sgi.com


Web Accessible Files of the src/gfx/opengl/exampleCode/MultiOGL directory:

This is an automatically derived categorization of files of this directory. Only files which can be displayed or heard in some manner are included. Files may be immediately accessed by clicking the corresponding link. The Zip Archive (if present) contains all files in this directory/subtree (including executables, subdirectories, etc.)

Source

Documentation

Reference

Zip Archive


Copyright © 1999, Silicon Graphics, Inc.