初学者,想用opengl画些简单地三维点线面的图
由于初学,尝试抄段代码看能不能运行,在一个dialog里面的菜单上加了一项,设想是点了之后在对应的事件函数里面画个简单的图(空想,其实不太知道怎么画图......)
这就是那个对应的时间函数,中间的代码是超来的,前面加了
#include "windows.h"
#include <GL/gl.h>
#include <GL/glaux.h>
void CMSRDLDlg::OnViewGraphic()
{
// TODO: Add your command handler code here
auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
auxInitPosition(0,0,500,500);
auxInitWindow("simple");
glClearColor(0.0,0.0,0.0,0.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glRectf(-0.5,-0.5,0.5,0.5);
glFlush();
_sleep(1000);}
build 出现错误一堆,类似下面这种MSRDL error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "public: void __thiscall CMSRDLDlg::OnViewGraphic(void)" (?OnViewGraphic@CMSRDLDlg@@QAEXXZ)怎么回事啊
由于初学,尝试抄段代码看能不能运行,在一个dialog里面的菜单上加了一项,设想是点了之后在对应的事件函数里面画个简单的图(空想,其实不太知道怎么画图......)
这就是那个对应的时间函数,中间的代码是超来的,前面加了
#include "windows.h"
#include <GL/gl.h>
#include <GL/glaux.h>
void CMSRDLDlg::OnViewGraphic()
{
// TODO: Add your command handler code here
auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
auxInitPosition(0,0,500,500);
auxInitWindow("simple");
glClearColor(0.0,0.0,0.0,0.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glRectf(-0.5,-0.5,0.5,0.5);
glFlush();
_sleep(1000);}
build 出现错误一堆,类似下面这种MSRDL error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "public: void __thiscall CMSRDLDlg::OnViewGraphic(void)" (?OnViewGraphic@CMSRDLDlg@@QAEXXZ)怎么回事啊
#pragma comment (lib, "glaux.lib")
#pragma comment (lib, "Opengl32.lib")