如何vs2013中配置OpengGL的编程opengl es3.0环境配置

查看: 3965|回复: 2
UID337377主题帖子精华0积分498阅读权限20通道币0 个威望0 明经币0 个金钱146 个贡献94 激情244 注册时间最后登录在线时间7 小时分享
注册会员, 积分 498, 距离下一级还需 2 积分
帖子精华0通道币0 个明经币0 个
如题:vs2010c++和objectarx2012怎样配置环境,希望高人给出具体步骤,谢谢
UID348431主题帖子精华0积分1416阅读权限40通道币0 个威望0 明经币0 个金钱227 个贡献79 激情995 注册时间最后登录在线时间44 小时分享
高级会员, 积分 1416, 距离下一级还需 584 积分
帖子精华0通道币0 个明经币0 个
我也要学习支持你
UID363359主题帖子精华0积分362阅读权限20通道币0 个威望0 明经币0 个金钱151 个贡献79 激情114 注册时间最后登录在线时间0 小时分享
注册会员, 积分 362, 距离下一级还需 138 积分
帖子精华0通道币0 个明经币0 个
本帖最后由 cmnull 于
23:10 编辑
正好,我在家里配置好这个环境(不算完美)。
1. 首先下并安装最新的 ARX2012 SDK 包(官网上说明已经支持 vc100 toolset 也就是 VS2012)。
2. 安装 ARX wizard 这现在从 ARX SDK 包中分开来了,也是官网下。
3. 通过 ARX wizard 新建工程(一直下一步 ... )
4. 然后是重点,需要手动设置的工程项目属性:
& &&&========== 两个地方是必须的====================================
& && && && && & a. 设置相关路径(project property page -& Configuration Properties -& VC Directories -&):
& && && && && && && && &i. 一个 include 路径 —— 找到并添加 ARX SDK 根目录下的 inc 目录和 inc-win32 或者 inc-x64 目录(看你系统是 x86 还是 x64)。
& && && && && && && && &ii. 一个 libraries 路 —— 找到并添加 ARX SDK 根目录下的 lib-win32 或者 lib-x64(看你系统是 x86 还是 x64)。
& && && && && & b. 检查几个地方,假如你要生成的文件名为 &…\MyProj.arx& 那么:
& && && && && && && && &i. project property page -& Configuration Properties -& General -& Output Directory 应该是前面 …\。
& && && && && && && && &ii. project property page -& Configuration Properties -& General -& Target Name 应该是 MyProj。
& && && && && && && && &iii. project property page -& Configuration Properties -& General -& Extension 应该是 .arx 不是 .dll。
& && && && && && && && &iv. project property page -& Configuration Properties -& Linker -& General -& Output File 应该是完整的 &…\MyProj.arx&。总之这几个地方要一致,如果你会用 VS 的宏那更好。
& && && && && && && && &v. project property page -& Configuration Properties -& General -&Platform Toolset 应该是 v100 而不是 v90。
& && & ==========&&有个地方可以设置,让调试稍微方便些,那就是================
& && && && && && && && &project property page -& Configuration Properties -& Debugging -& Command 里设置你的 acad.exe 的完整路径(包括最后的 acad.exe),比如 C:\U\acad2012\AutoCAD 2012 - Simplified Chinese\acad.exe
& && && && && && && && &project property page -& Configuration Properties -& Debugging -& Command Argument 里设置成 \ld &你生成的 .arx 的完成路径&,这样每次你按 F5 时,VS 自动完成编译生成,启动 acad.exe,加载刚刚生成的 .arx 模块。你只要敲你的 arx 命令就好了。
我的系统是 win7 x64,所以编译平台要选 x64,记住选好之后,再做上面的属性改动。
我碰到的问题:x64 平台编译的 .arx&&给 acad 2012 x64 加载是,老提示“不兼容的模块”,但是你强行加载,一切又能正常运行。不知道哪里还需要再设置。
& 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途
Powered by如何vs2013中配置OpengGL的编程环境_百度知道
如何vs2013中配置OpengGL的编程环境
提问者采纳
一、安装GLUT工具包1下载OpenGL需要的库文件 ,一般可以选择下载glut库(内含所有必须文件)2解压后将得到的glut.lib和glut32.lib这两个静态函数库复制到文件目录的lib文件夹下 X:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib3将glut.dll,glut32.dll这两个动态库文件放到操作系统目录下面的C:\Windows\system32文件夹内(32位系统)或‪C:\Windows\SysWOW64(64位系统)。为了兼容性考虑,最好在这两个目录下都复制相应的文件。4将解压得到的头文件glut.h复制到目录如下目录下:X:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\GL提示:如果在incluce目录下没有GL文件夹,则需要手动创建二、VS2013中的配置创建一个空白的Win32控制台应用程序在代码最前面添加包含目录#include &GL/glut.h&然后就可以编辑自己的OpenGL程序了例如:复制如下代码到刚配置好的VS中#include &GL/glut.h&#include &stdlib.h&#include &math.h&#include &stdio.h&static int year = 0,spin=0, day = 0;static GLint fogMconst int n = 100;const GLfloat R = 1.0f;const GLfloat Pi = 3.f;void DrawCircle(){glClear(GL_COLOR_BUFFER_BIT);glBegin(GL_LINE_LOOP);for (i = 0; i & ++i){glColor3f(1.0, 0.0, 0.0);glVertex2f(R*cos(2 * Pi / n*i), R*sin(2 * Pi / n*i));}glEnd();glFlush();}void init(void){GLfloat position[] = { 0.5, 0.5, 3.0, 0.0 };glEnable(GL_DEPTH_TEST);
//防止遮挡glLightfv(GL_LIGHT0, GL_POSITION, position);
glEnable(GL_LIGHTING);glEnable(GL_LIGHT0);{GLfloat mat[3] = { 0.75, 0.01175 };glMaterialfv(GL_FRONT, GL_AMBIENT, mat);mat[0] = 0.61424; mat[1] = 0.04136; mat[2] = 0.04136;glMaterialfv(GL_FRONT, GL_DIFFUSE, mat);mat[0] = 0.727811; mat[1] = 0.626959; mat[2] = 0.626959;glMaterialfv(GL_FRONT, GL_SPECULAR, mat);glMaterialf(GL_FRONT, GL_SHININESS, 0.6*128.0);}glEnable(GL_FOG);{GLfloat fogColor[4] = { 0.5, 0.5, 0.5, 1.0 };fogMode = GL_EXP;glFogi(GL_FOG_MODE, fogMode);glFogfv(GL_FOG_COLOR, fogColor);glFogf(GL_FOG_DENSITY, 0.35);glHint(GL_FOG_HINT, GL_DONT_CARE);glFogf(GL_FOG_START, 1.0);glFogf(GL_FOG_END, 5.0);}glClearColor(0.5, 0.9, 0.9, 1.0);
/* fog color */}void display(void){glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);glColor3f(0.0, 1.0, 1.0);
glPushMatrix(); //记住自己的位置glutSolidSphere(1.0, 20, 16);
/* 画太阳半径、 20经度、16纬度*/glRotatef(spin, 0.0, 1.0, 0.0);
//自转,绕着一个向量以给定角度旋转(正的为逆时针)glTranslatef(2.0, 1.0, 0.0);glRotatef(spin, 1.0, 0.0, 0.0); //公转glRectf(0.1,0.1,0.5,0.5);glColor3f(0.0, 0.0, 1.0);glutWireSphere(0.2, 8, 8);
/* 画第一颗小行星 */glColor3f(1.0, 0.0, 0.0);glTranslatef(2.0, 1.0, 0.0);glR憨耿封际莩宦凤为脯力otatef(2 * spin, 0.0, 1.0, 0.0);glutSolidSphere(0.5, 16, 8);glPopMatrix();//回到原来的位置glutSwapBuffers();}void spinDisplay(void){spin = spin + 2;if (spin & 360)spin = spin - 360;glutPostRedisplay();}void mouse(int button,int state,int x,int y ){switch (button){case GLUT_LEFT_BUTTON:if (state == GLUT_DOWN)glutIdleFunc(spinDisplay);case GLUT_MIDDLE_BUTTON:if (state == GLUT_DOWN)glutIdleFunc(NULL);default:}}void reshape(int w, int h){glViewport(0, 0, (GLsizei)w, (GLsizei)h);glMatrixMode(GL_PROJECTION);glLoadIdentity();gluPerspective(60.0, (GLfloat)w / (GLfloat)h, 0.5, 20.0);glMatrixMode(GL_MODELVIEW);glLoadIdentity();gluLookAt(0.0, 10.0, 10.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);}void keyboard(unsigned char key, int x, int y){switch (key) {case 'd':day = (day + 10) % 360;glutPostRedisplay();case 'D':day = (day - 10) % 360;glutPostRedisplay();case 'y':year = (year + 5) % 360;glutPostRedisplay();case 'Y':year = (year - 5) % 360;glutPostRedisplay();case 27:exit(0);default:}}int main(int argc, char** argv){glutInit(&argc, argv);glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);glutInitWindowSize(400, 400);glutInitWindowPosition(100, 100);glutCreateWindow(&OpengGL 程序设计--杨超&);init();//glutDisplayFunc(DrawCircle);glutDisplayFunc(display);glutReshapeFunc(reshape);//glutKeyboardFunc(keyboard);glutMouseFunc(mouse);glutMainLoop();return 0;} 5编译后能正确运行说明配置成功!
其他类似问题
为您推荐:
编程环境的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁如何vs2013中配置OpengGL的编程环境_百度知道
如何vs2013中配置OpengGL的编程环境
static int year = 0;
&#47, 1.1;Windows\ { GLfloat fogColor[4] = { 0;.h&gt, 1.h&gt.0.0), 0;&#47.0), position), 16.0f, day = 0;公转 glRectf(0;&#47, 10.5.0; glutReshapeFunc(reshape).0), 3, 0, 0, GL_DIFFUSE; n*i)).0, 0.01175 }; mat[0] = 0; mat[1] = 0; case &#39.0。
4将解压得到的头文件 glutPostRedisplay(): if (state == GLUT_DOWN) glutIdleFunc(NULL); glClear(GL_COLOR_BUFFER_BIT); glutPostRedisplay(), 0; glRotatef(D'system32文件夹内(32位系统)或&#8234, (GLfloat)w &#47: if (state == GLUT_DOWN) glutIdleFunc(spinDisplay).0;GL&#47, 400).0, 0; break.5, (GLsizei)w,则需要手动创建
二.dll.6*128;d&#39, GL_SHININESS.0); glColor3f(1; 然后就可以编辑自己的OpenGL程序了 例如; glutInitWindowSize(400、安装GLUT工具包 1下载OpenGL需要的库文件 ; i & } glEnable(GL_FOG), 1.5.dll这两个动态库文件放到操作系统目录下面的C.5; &#47.f;
glPushMatrix(), GL_DONT_CARE);glutDisplayFunc(DrawCircle).0);math, 1; glFogi(GL_FOG_MODE; } void keyboard(unsigned char key, GL_SPECULAR; return 0, char** argv) { glutInit(&argc.626959; glMaterialfv(GL_FRONT; static GLint fogM/C, 0;; } glEnd(),stdio, 0:&#92, 1;y' } } int main( }
5编译后能正确运行说明配置成功,绕着一个向量以给定角度旋转(正的为逆时针) glTranslatef(2;Windows&#92:&#92.0\回到原来的位置 glutSwapBuffers();/ const GLfloat Pi = 3.0 }.9.0);OpengGL 程序设计--杨超&quot, 20; } void spinDisplay(void) { spin = spin + 2; glRotatef(spin:\ #include & (GLfloat)h;/include&#92, fogMode);/ } void mouse(int button, 10。 为了兼容性考虑; glutSolidSphere(0;VC&#92.0); glFlush(); gluLookAt(0; if (spin &gt.9.0;记住自己的位置 glutSolidSphere(1.h复制到目录如下目录下: exit(0).0.0; case 27; break.36: day = (day + 10) % 360,spin=0.36, 0; glutWireSphere(0;GL/ break, 1; glutDisplayFunc(display); ++i) { glColor3f(1,0, GL_AMBIENT.5, 100); glHint(GL_FOG_HINT,一般可以选择下载glut库(内含所有必须文件)
2解压后将得到的 { GLfloat mat[3] = { 0; glRotatef(2 * spin: day = (day - 10) % 360, 0, 0.5一;lib
3将SysWOW64(64位系统), 0; glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB), int y) { switch (key) { case ' glMatrixMode(GL_PROJECTION), GL_POSITION;Y' mat[1] = 0, 1; &#47.0, 1:如果在incluce目录下没有GL文件夹; glFogf(GL_FOG_END, mat), 16).2;* fog color *&#47.0;VC\ } void display(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);自转; glBegin(GL_LINE_LOOP).0, 0; glutPostRedisplay(),glut32, 0.5;
glEnable(GL_LIGHTING); default, 20, 0; const GLfloat R = 1.0; &#47, 0; #include & n*i);
&#47.0)、 20经度, fogColor).0,int y ) { switch (button) { case GLUT_LEFT_BUTTON.h&gt.0 }; init().0);),int x.0; glColor3f(0; glFogf(GL_FOG_START.lib这两个静态函数库复制到文件目录的lib文件夹下
X, 1:Program Files (x86)&#92、16纬度*/ glFogfv(GL_FOG_COLOR:&#92: year = (year + 5) % 360.0; } void init(void) { GLfloat position[] = { 0.0, 0: year = (year - 5) % 360; const int n = 100; gluPerspective(60;Microsoft Visual Studio 12; #include & glColor3f(0.0; case GLUT_MIDDLE_BUTTON.h&
&#47,int state, R*sin(2 * Pi &#47、VS2013中的配置 创建一个空白的Win32控制台应用程序 在代码最前面添加包含目录 #include & glutCreateWindow(&quot, 0, 8, 0, 8), 0; glMatrixMode(GL_MODELVIEW); glEnable(GL_DEPTH_TEST).5); glMaterialf(GL_FRONT; for (i = 0, argv);Microsoft Visual Studio 12.0&#92, (GLsizei)h).0, 0; glutPostRedisplay(): X;防止遮挡 glLightfv(GL_LIGHT0; glTranslatef(2, mat); fogMode = GL_EXP;, 0.5:复制如下代码到刚配置好的VS中 #include & glPopMatrix();, 0; glutInitWindowPosition(100;
&#47.35).h& } } void reshape(int w.0), 8); glMaterialfv(GL_FRONT.0; glEnable(GL_LIGHT0),最好在这两个目录下都复制相应的文件, 1: break.0, 0;/ case &#39.1; glMaterialfv(GL_FRONT.0; mat[0] = 0;* 画太阳半径, 0;Program Files (x86)\ } glClearColor(0.0);
&#47.0; case 'GL 提示; break.0, 0, 1; 360) spin = spin - 360, 1, 5, mat).1745.0;* 画第一颗小行星 *&#47.0);glutKeyboardFunc(keyboard).01175, 0; void DrawCircle() { int
i.5;glut.0..0, 0; glVertex2f(R*cos(2 * Pi &#47.0);&#47.lib和glut32; glLoadIdentity().0, int h) { glViewport(0; glLoadIdentity(); glutMouseFunc(mouse).0.0); glutPostRedisplay(); glFogf(GL_FOG_DENSITY; mat[2] = 0.0),0, 0; / mat[2] = 0; glutMainLoop()
知道智能回答机器人
根据知道用户的观点和内容总结出特定问题的答案,为知道用户提供更好的问答体验。
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 opengl环境配置vs2013 的文章

 

随机推荐