Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "..."
- displayListsDictionary at: 'gridList' ifAbsent: [
- self drawsObject: aShip.
- gridList := self getNextDisplayList.
- ogl glNewList: gridList with: GLCompile.
- 1 to: 150 do: [:i|
- 1 to: 150 do: [:j|
- ogl glPushMatrix.
- ogl glTranslatef: (i*0.35) -25 with: (j *0.35) -25 with: -75.
- self drawsObject: aShip.
- ogl glPopMatrix.
- ]].
- ogl glEndList.
- displayListsDictionary at: 'gridList' put: gridList.
- ].
- ogl glCallList: (displayListsDictionary at: 'gridList').
- "..."
- drawsObject: anObject
- | shape mode vertexBuffer normalBuffer texCoordBuffer displayList |
- shape := anObject shipShape.
- displayList := shape cachedDisplayList.
- displayList ifNil: [
- mode := shape shapeMode.
- vertexBuffer := shape vertexBuffer.
- normalBuffer := nil. "Vector3Array ofSize: 24."
- texCoordBuffer := nil. "Vector2Array ofSize: 24."
- displayList := self getNextDisplayList.
- ogl glNewList: displayList with: GLCompile.
- ogl beginVertices: (vertexBuffer) normals: (normalBuffer) colors: shape colors texCoords: (texCoordBuffer).
- ogl glPushMatrix.
- 1 to: shape fgSize by: 2
- do:[ :i | ogl drawIndexed: mode faces: (shape faceBuffers at: i+1//2)].
- ogl glPopMatrix.
- ogl glEndList.
- shape cachedDisplayList: displayList.
- ].
- ogl glCallList: displayList.
Add Comment
Please, Sign In to add comment