PDA

View Full Version : How to compile and run the examples of blue book?



zybjtu
08-21-2014, 01:15 AM
I'm very new to OpenGL. I want to learn it from the Blue Book (OpenGL superbible 6th edition).

When I compile the first program with Visual Studio 2013, everything goe well, except that a white window appears and then the program quit with code 0.

The program is:


// Include the "sb6.h" header file
#include "sb6.h"
// Derive my_application from sb6::application
class my_application : public sb6::application
{
public:
// Our rendering function
void render(double currentTime)
{
// Simply clear the window with red
static const GLfloat red[] = { 1.0f, 0.0f, 0.0f, 1.0f };
glClearBufferfv(GL_COLOR, 0, red);
}
};
// Our one and only instance of DECLARE_MAIN
DECLARE_MAIN(my_application);

I think both the compiling and building process are working fine because the result code 0. But I cannot figure out why I don't see a red output window. Please help me.

Ruggero Visitnin
08-21-2014, 04:35 AM
I'm very new to OpenGL. I want to learn it from the Blue Book (OpenGL superbible 6th edition).

When I compile the first program with Visual Studio 2013, everything goe well, except that a white window appears and then the program quit with code 0.

The program is:

I think both the compiling and building process are working fine because the result code 0. But I cannot figure out why I don't see a red output window. Please help me.

i don't know if you included lib and include files but seems this is your error so
if you are using VisualStudio you have to go in Project/(your project's name)Properties:
1401

then in "Include Directiories" you have to put the include folder and the extern/glwf folder downloaddable from here: http://openglsuperbible.com/files/sb6code_2013_11_10.zip
and in "Library Directiories" you have to put the lib folder