2.下載Opencv 2.1.0 win32 vs2008
第二個打勾 目錄不要改
設定 Compiler
程式碼:
#include <GL/glut.h>
#include <opencv/highgui.h>
void myTexture()
{
IplImage * img = cvLoadImage("sova.png");
cvShowImage("opencv",img);
#include <GL/glut.h>
#include <opencv/highgui.h>
void myTexture()
{
IplImage * img = cvLoadImage("sova.png");
cvShowImage("opencv",img);
///cvWaitKey(0);
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glutSolidTeapot(0.3);
glutSwapBuffers();
}
int main(int argc,char** argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
glutCreateWindow("week09 texture");
glutDisplayFunc(display);
myTexture();
glutMainLoop();
}
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glutSolidTeapot(0.3);
glutSwapBuffers();
}
int main(int argc,char** argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
glutCreateWindow("week09 texture");
glutDisplayFunc(display);
myTexture();
glutMainLoop();
}
沒有留言:
張貼留言