commit b42b19f10e174e1b4b63800e29b720316b139af0 Author: biss Date: Sun Apr 5 20:25:00 2026 +0800 实验一 1.1 diff --git a/freeglut.dll b/freeglut.dll new file mode 100644 index 0000000..1feaac4 Binary files /dev/null and b/freeglut.dll differ diff --git a/lab1/1.cpp b/lab1/1.cpp new file mode 100644 index 0000000..82b1c05 --- /dev/null +++ b/lab1/1.cpp @@ -0,0 +1,48 @@ +#include +using namespace std; + +void myDisplay() +{ + glClearColor(0.0, 0.0, 0.0, 0.0); + glClear(GL_COLOR_BUFFER_BIT); + glMatrixMode(GL_PROJECTION); + gluOrtho2D(0.0, 500.0, 0.0, 500.0); + glColor4f(0.0, 1.0, 0.0, 0.0); + glRectf(50.0, 50.0, 400.0, 400.0); + + glColor3f(1.0, 1.0, 0.0); + glBegin(GL_LINES); + glVertex2f(50.0, 50.0); + glVertex2f(400.0, 400.0); + glVertex2f(400.0, 50.0); + glVertex2f(50.0, 400.0); + glEnd(); + + glColor3f(1.0, 0.0, 0.0); + glPointSize(20.0); + glBegin(GL_POINTS); + glVertex2f(15.0, 15.0); + glEnd(); + + glBegin(GL_TRIANGLES); + glColor3f(0.0, 0.0, 1.0); + glVertex2i(200, 300); + glVertex2i(100, 100); + glVertex2i(300, 100); + glEnd(); + + + glFlush(); + +} +int main(int argc, char* argv[]) +{ + glutInit(&argc, argv); + glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE); + glutInitWindowPosition(100, 100); + glutInitWindowSize(500, 500); + glutCreateWindow("ÀÖÒâ"); + glutDisplayFunc(&myDisplay); + glutMainLoop(); + return 0; +} \ No newline at end of file diff --git a/lab1/1.exe b/lab1/1.exe new file mode 100644 index 0000000..b90f12a Binary files /dev/null and b/lab1/1.exe differ