Wgl–windows OpenGL Expansion Layer
The WGL extension consists of a set of functions (Wglcreatecontext, Wgldeletecontext etc.) and structures (such as Pixelfo Rmatdescriptor, glyphmetricsfloat) etc. Thus every OpenGL implementation has a platform-specific portion which has to is set up and used according to the Particul AR platform.
Device context
The Windows graphical Device Interface (GDI) is capable of drawing to screens, to memory, to printers or to no other Devic E that provides a GDI interface layer and that can process GDI calls. GDI accomplishes this by a rendering handle to the currently selected device, or DC, which the called.
Drawing context
A rendering context is the OpenGL equivalent of the GDI DC. All OpenGL calls are rendered to the device through a RC. The rendering context maintains OpenGL state variables such as current background color, current color etc. just as the DC Maintains GDI state variables such as current pen, current brush etc.
Pixel format
Pixel formats are the translation layer between OpenGL calls and the rendering operation that Windows performs.
For example, if the pixel format supports only a very small number of color values, OpenGL may draw with the converted value (128,128,128) when it draws a pixel with an RGB value (128,120,135).
The pixel format selected essentially describes such things as how colors are, displayed of field depth and resolution T additional capabilities are supported by the rendering context created.
The first OpenGL application based on MFC
Development environment: VC6.0
1, first download the required Glut header file, DLL and lib file, download link: glutdlls37beta.zip (149 kilobytes), decompression after the gltu.h into the "VC98/INCLUDE/GL", Put Glut.lib and Glut32.lib under "Vc9/lib", Glut32.dll and Glut.dll into the running directory of the application you created
2, create an MFC SDI application, add the required linked library files to the project properties
1, add the following statement to the stdafx.h:
OpenGL Headers
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glut.h>
#include <gl/glaux.h>