Rendering a simple colored triangle using shaders
We will now put the
GLSLShader class to use by implementing an application to render a simple colored triangle on screen.
For this recipe, we assume that the reader has created a new empty Win32 project with OpenGL 3.3 core profile as shown in the first recipe. The code for this recipe is in the
In all of the code samples in this book, you will see a macro
GL_CHECK_ERRORS dispersed throughout. This macro checks the current error bit for any error which might be raised by passing invalid arguments to an OpenGL function, or when there is some problem with the OpenGL state machine. For any such error, this macro traps it and generates a debug assertion ...