OpenGL 3 Hello World Demo.
This Windows OpenGL application demonstrates how to render a 2D textured rectangle using OpenGL 3 or a forward compatible OpenGL 3.0 rendering context.
Note:
1. This is an OpenGL 3 demo. This demo will not run on OpenGL 2.x and OpenGL 1.x hardware.
2. This demo requires the Visual C++ 2010 Library Runtimes. Download instructions can be found here.
Download executable, source, and Visual C++ 2010 solution files.
Change History:
10 July 2010.
Added missing .vcxproj.filters file to the project.
13 June 2010.
Updated solution to Microsoft Visual Studio 2010.
26 September 2009.
main.cpp: Moved the vertex and fragment shader compilation and linking logic into the GL3Application class.
application.h:
Changed the type of the Texture2D structure's pixels members from unsigned char to GLubyte. Added the following new methods to the GL3Application class: loadShaderProgram(), programInfoLog(). shaderInfoLog(). Added following new member variables to the GL3Application class: m_shaderInfoLog, m_programInfoLog.
application.cpp:
Added implementation for the new loadShaderProgram() method. Updated the initOpenGL() method to create an OpenGL 3.2 rendering context when supported.
gl.h:
Added initial support for OpenGL 3.2.
gp.cpp:
Added new entry points for OpenGL 3.2.
WGL_ARB_create_context.h:
Updated to include changes for OpenGL 3.2 where a profile can be specified when the GL context is created.
12 August 2009.
application.cpp: Updated initOpenGL() method to use the gl::ExtensionSupported() function to query supported OpenGL extensions.
gl.cpp: Added new private functions: DummyGLWndProc(), CreateDummyGLWindow(), and DestroyDummyGLWindow(). Updated ExtensionSupported() function to cache all of the extensions returned by GL_EXTENSIONS and wglGetExtensionsStringARB(). The ExtensionSupported() function creates a dummy hidden window with an OpenGL rendering context in order to retrieve all supported extensions.
WGL_ARB_extensions_string.h, WGL_ARB_extensions_string.cpp: Removed. Functionality moved into the gl::ExtensionSupported() function in the framework's gl module. |