⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linetask1.c

📁 图形学课件 图形学课件 图形学课件
💻 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();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -