OpenGL之画三角形 openGL具有很多扩展,方便进行操作 确保已经安装必要的库,进行正确的链接 glut #include <GL/glut.h> void display() { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_TRIANGLES); glColor3f(1.0, 0.0, 0.0); glVertex2f(0.0, 0.5); glVertex2f(-0.5, -0.5); glVertex2f(0.5, -0.5); glEnd(); glFlush(); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(400, 400); glutCreateWindow("Red Triangle"); glClearColor(1.0, 1.0, 1.0, 1.0); glutDisplayFunc(display);...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile