OglSample sample application

OglSample application objectives

The OglSample application source code demonstrates the way of using the COpenGL objects together with Microsoft Foundation Classes. The OglSample application code should be considered as a template application for writing custom applications, which uses the COpenGL class library. It also delivers the COpenGLView and COpenGLWnd classes implementation source code files. The COpenGLView and COpenGLWnd classes have closer MFC concept and they can be easily used to derive custom classes intended for the OpenGL graphics output.

OglSample application specification

 The OglSample application is a multiple document MFC application available in the source code form. It provides the toolbar and menu generated by the MFC Application Wizard. Along with that, it provides toolbars and menu entries for view navigation control and rendering context settings. The source code was originally generated by the MFC Application Wizard and then the specific source code was added to join the generic MFC application code with the COpenGL class functionality. The COpenGL class related source code is well commented to enable an easy understanding of how the COpenGL class is designed to work.

The OglSample application is delivered with several VRML (Virtual Reality Model Language) files which it is possible to open and view. Note that the OglSample application is not intended to be a VRML viewer and it understands only a small subset of the VRML. The VRML specific code is not provided with OglSample applications source files form and it is linked as a DLL (VRM.DLL). The reason for this is because the OglSample application does not focus on the VRML and therefore the VRML related source code would complicate the application objectives.

The OglSample application allows to print, zoom all graphic data, to zoom in, to zoom out, zoom to window, to pan, to rotate, to specify view angle, to specify perspective versus orthographic projection, to specify how the OpenGL window resizing events should be handled, to turn lighting on/off, to turn lighting mode local viewer on/off, to perform scene antialiasing.

To start customization of the OglSample application you need to implement your own COglSampleView::DrawScene method function. Add or modify existing OglSample user interface if desired.

See Also

COpenGL class, COpenGLView class, COpenGLWnd class