Home > Software engineering >  OpenGL blue treasure dian operation problem
OpenGL blue treasure dian operation problem

Time:09-28

I run a blue bible chapter 2 P44 page program, for example, is always wrong, have a great god understand this??
The code is as follows:

# include & lt; GLTools. H>
# include & lt; GLShaderManager. H>

# define FREEGLUT_STATIC
# include & lt; Gl/glut. H>

GLBatch triangleBatch;
GLShaderManager shaderManager;

Void ChangeSize (int w, int h)
{
GlViewport (0, 0, w, h);
}

Void SetupRC ()
{
GlClearColor (0.0 f, f, 0.0 1.0 f, 1.0 f);

ShaderManager. InitializeStockShaders ();

F GLfloat vVerts []={0.5, 0.0 f, 0.0 f,
0.5 f, f 0.0, 0.0 f,
0.0 f, f 0.5, 0.0} f;
TriangleBatch. The Begin (GL_TRIANGLES, 3);
TriangleBatch. CopyVertexData3f (vVerts);
TriangleBatch. End ();
}

Void RenderSence (void)
{
GlClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BITS);

GLfloat vRed []={0.0 1.0 f, f, f 0.0, 1.0} f;
ShaderManager. UseStockShader (GLT_SHADER_IDENTITY vRed);
TriangleBatch. The Draw ();

GlutSwapBuffers ();
}

Int main (int arg c, char * argv [])
{
GlutInit (& amp; Arg c, argv);
GlutInitDisplayMode (GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL);
GlutInitWindowSize (800600);
GlutCreateWindow (" Triangle ");
GlutReshapeFunc (ChangeSize);
GlutDisplayFunc (RenderSence);

GLenum err=glewInit ();

SetupRC ();

GlutMainLoop ();
return 0;
}

The results of the mistakes:
1> LINK: fatal error LNK1104: unable to open file "gltools. Lib, freeglut. Lib, glew32s lib"

CodePudding user response:

Gltools lib, freeglut. Lib, glew32s lib this several files in the project folder

CodePudding user response:

Put, the problem has been solved
  • Related