Guest User

Untitled

a guest
Mar 9th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. drawsObject: anObject
  2.  
  3.  
  4.  
  5.     |  shape  mode vertexBuffer normalBuffer texCoordBuffer  displayList |
  6.    
  7.    
  8.    
  9.         shape := anObject shipShape.
  10.         displayList := shape cachedDisplayList.
  11.         displayList ifNil: [
  12.            
  13.     mode := shape shapeMode.
  14.    
  15.     vertexBuffer := shape vertexBuffer.
  16.     normalBuffer := nil. "Vector3Array ofSize: 24."
  17.     texCoordBuffer := nil. "Vector2Array ofSize: 24."
  18.    
  19.     displayList := self getNextDisplayList.
  20.     ogl glNewList: displayList with: GLCompile.
  21.  
  22.     ogl beginVertices: (vertexBuffer) normals: (normalBuffer) colors: shape colors texCoords: (texCoordBuffer).
  23.  
  24.     ogl glPushMatrix.
  25.  
  26.     1 to: shape fgSize by: 2
  27.  
  28.         do:[ :i | ogl drawIndexed: mode faces: (shape faceBuffers at: i+1//2)].
  29.  
  30.    
  31.         ogl glPopMatrix.
  32.         ogl glEndList.
  33.         shape cachedDisplayList: displayList.
  34.         ].
  35.         ogl glCallList: displayList.
Add Comment
Please, Sign In to add comment