?? linetask1.c
字號:
/* lineTask1.c */
/* illustrates rubberband line drawing */
#include <GL/glut.h>
/* attention 1-3
/* attention 1 Please add your global variables here! */ /* ...*/
void init(){
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D (0.0, 1.0, 0.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
/* attention 2 Please finish initialization here! */
/* 1. to set the background color */
/* 2. to enable color logic operation */
/* 3. to set the mode to COPY mode*/
/* ...*/
}
void display(){ glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0, 0.0, 0.0);
glRectf(0.25, 0.25, 0.75, 0.75);
glLogicOp(GL_XOR); glColor3f(1.0, 1.0, 0.0); glFlush();}
void mouse(int btn, int state, int x, int y){ /* attention 3 Please add your code here! */
/* ...*/
}
int main(int argc, char** argv){ glutInit(&argc,argv); glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(500,500); glutInitWindowPosition(0,0); glutCreateWindow("rubberband"); glutDisplayFunc(display); glutMouseFunc(mouse); init(); glutMainLoop();}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -