spdif-鼠标自动电击器

windows8 1
2023年4月4日发(作者:国际象棋大师11下载)

Windows8.1+VS2013配置OpenGL

分类:编程语言2014-09-1911:262890人阅读评论(0)收藏举报

openGL

目录(?)[+]

转自:/lvhao578041381/article/details/18971691

一.下载OpenGL代码——glut(TheOpenGLUtilityToolkit)

glut下载地址:/resources/libraries/glut/glut_

forwindows的code:

/~nate/

其中:

Ø:GLUTforWin32dll,libandheaderfile(everythingyouneedtogetstartedprogrammingwith

GLUT).

Ø:GLUTsourcecodedistribution(includingawholeslewofgreatexampleprograms+data).

现使用配置环境。

二.VS2013配置

::includeGLglut.h

***putthedrivewhereyouinstalledVC++insteadofthe

***putthedirectorywhereyouinstalledVC++insteadofthe

比如,glut.h--->C:ProgramFiles(x86)MicrosoftVisualStudio12.0VCincludeGL(新建一个GL的文件夹)

:

:

***putthedrivewhereyouinstalledVC++insteadofthe***

***putthedirectorywhereyouinstalledVC++insteadofthe

比如,--->C:ProgramFiles(x86)MicrosoftVisualStudio12.0VClib

oyourwindowsdirectory(windowsorwinnt,dependsonifyouareusingWindows95/98or

WindowsNT)

注意:--->C:WindowsSysWOW64(windows8.164位操作系统)

--->C:WindowsSystem32(windows8.132位操作系统)

比如,本人系统64位,因此--->C:WindowsSysWOW64

4.打开vs2013,随便打开或新建一个项目。选择project->project

property->ConfigurationProperties->Linker->Input->AdditionalDependencies在其中添加

;;

三.测试

在工程中添加如下代码编译(32位)即可。

注意:用x64编译不行,因为是给32位编译用的。

[cpp]viewplaincopyprint?

1.//:Definestheentrypointfortheconsoleapplication.

2.

3.#include

4.

Display(void)

6.{

r(GL_COLOR_BUFFER_BIT);

r3f(1.0,0.0,0.0);

n(GL_LINES);

ex2i(180,15);

ex2i(10,145);

();

f(-0.5f,-0.5f,0.5f,0.5f);

h();

15.}

16.

it(void)

18.{

rColor(1.0,1.0,1.0,0.0);

ixMode(GL_PROJECTION);

ho2D(0.0,200.0,0.0,150.0);

22.}

23.

n(intargc,char*argv[])

25.{

it(&argc,argv);

itDisplayMode(GLUT_RGB|GLUT_SINGLE);

itWindowPosition(50,100);

itWindowSize(400,300);

eateWindow("OpenGL");

();

splayFunc(&myDisplay);

inLoop();

0;

35.}

—————————————————————————————————————————————————

—————————————

编译时出错:

1>c:programfilesmicrosoftvisualstudio8vcincludestdlib.h(406):errorC2381:

'exit':redefinition;__declspec(noreturn)differs

1>c:programfilesmicrosoftvisualstudio

8vcplatformsdkincludeglglut.h(146):seedeclarationof'exit'

搜索到solution:

/Forums/en-US/aeacc105-2f6b-4480-862f-775a24c5e26e/what-means-active-wi

n32-vs-win32?forum=csharpide

Tofixtheerror,rightclickontheprojectnameintheSolutionExplorertabandselectProperties->C/C++->

Preprocessor->PreprocessordefinitionsandappendGLUT_BUILDING_LIBtotheexistingdefinitions,

seperatedbysemicolons.

更多推荐

windows8 1