Configure OpenGL in vs2013 (absolutely reliable!) )

Source: Internet
Author: User

The first thing to download is glut.h Glut32.dll glut32.lib. (This is in Glut-3.7.6-bin's bag, can be downloaded directly)

And then:

Glut.h: Put it in D:\vs2013\VC\include\GL (create a new one without the GL folder)

Glut32.dll: Put in the D:\vs2013\VC\bin inside (recommended in C:windows\system32 also put one)

Glut32.lib: Put it inside the D:\vs2013\VC\lib.

Then directly suggest a Win32 console program, select Project->project property-> configurationproperties->linker->input-> Additional Dependencies in which to add opengl32.lib;glu32.lib;glut32.lib note that each. lib file is separated from each other, must not have a space, if error LNK1104: Cannot open File " ; Opengl32.lib "Such a mistake, very

This may be the result of a space.

Attach a simple OpenGL program, if the output of a red rectangle, then the configuration is successful.

//draw rectangle. CPP: Defines the entry point of the console application. //#include"stdafx.h"#include"gl/glut.h"voidInitialvoid) {Glclearcolor (1.0f,1.0f,1.0f,1.0f);    Glmatrixmode (gl_projection); Gluortho2d (0.0,200.0,0.0,150.0);}voidDisplay (void) {glclear (gl_color_buffer_bit); glcolor3f (1.0f,0.0f,0.0f); GLRECTF (50.0f,100.0f,150.0f,50.0f); Glflush ();}intMainintargcChar*argv[]) {Glutinit (&argc, argv); Glutinitdisplaymode (Glut_single|Glut_rgb); Glutinitwindowsize ( -, -); Glutinitwindowposition ( -, -); Glutcreatewindow ("really is no language ... ");    Glutdisplayfunc (Display);    Initial ();    Glutmainloop (); return 0;}
View Code

Configure OpenGL in vs2013 (absolutely reliable!) )

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.