摘要:
Command-basedImmediate modeDisplay listsArray-basedVertex arrayVertex buffer objects1. Immediate modeglBegin(GL_TRIANGLES)glColor3f(0, 1, 1)glVertex3f(0, 0, 0)#...glEnd()● Very slow; for each function call:– argument marshalling– C function call– glGetError handling● ...millions of vertices in a sce 阅读全文
摘要:
View Code 1 import pygame$ 2 from OpenGL.GL import *$ 3 $ 4 def initGL():$ 5 glClearColor(0.0, 0.0, 0.0, 0.0)$ 6 $ 7 def resizeGL((w, h)):$ 8 glViewport(0, 0, w, h)$ 9 $10 def paintGL():$11 glClear(GL_COLOR_BUFFER_BIT)$12 glBegin(GL_TRIANGLES)$13 # vertices here$14 $15 pygame.init()$16 pygame.displa 阅读全文