#include<windows.h>
#include<iostream>
#include<math.h>
#include<gl/glut.h>
const float pi=3.1415926;
//setWindow
void setWindow(GLdouble left,GLdouble right,GLdouble buttom,GLdouble top)
{
//定义我们自己的函数设置窗口
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(left,right,buttom,top);
}
//setViewport
void setViewport(GLint left,GLint right,GLint bottom,GLint top)
{
//定义我们自己的函数设置窗口
glViewport(left,bottom,right-left,top-bottom);
printf("glViewprot");
}
//myDisplay
void myDisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glViewport(0,0,200,200); //在gluttInitWindowSize()和glutInitWindowP
#include<iostream>
#include<math.h>
#include<gl/glut.h>
const float pi=3.1415926;
//setWindow
void setWindow(GLdouble left,GLdouble right,GLdouble buttom,GLdouble top)
{
//定义我们自己的函数设置窗口
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(left,right,buttom,top);
}
//setViewport
void setViewport(GLint left,GLint right,GLint bottom,GLint top)
{
//定义我们自己的函数设置窗口
glViewport(left,bottom,right-left,top-bottom);
printf("glViewprot");
}
//myDisplay
void myDisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glViewport(0,0,200,200); //在gluttInitWindowSize()和glutInitWindowP