Guest User

Untitled

a guest
Jun 6th, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. getLatestImageFromWorld
  2.     "draw the World's texture to a bitmap for use by an OpenGL texture"
  3.  
  4.     |format form  tempTextures|
  5.     pasteUpFormCanvas ifNil: [^self].
  6.     self hide.
  7.     myPasteUp fullDrawOn: pasteUpFormCanvas.
  8.     "myPasteUp drawSubmorphsOn: pasteUpFormCanvas."
  9.     self show.
  10.     form := pasteUpFormCanvas form.
  11.     fPUWidth := form width.
  12.     fPUHeight := form height.
  13.    
  14.     "tempTextures := WordArray with:   (textureIntNames at: 1).
  15.     ogl glDeleteTextures: 1 with: tempTextures."
  16.     ogl glBindTexture: GLTexture2d with: (textureIntNames at: 1).
  17.     ogl checkForError.
  18.     format := ogl textureInternalFormat.
  19.  
  20.     ogl glEnable: GLTexture2d.
  21.    
  22.     "ogl glTexParameteri: GLTexture2d with: GLTextureMinFilter with: GLLinearMipmapLinear."
  23.     ogl glTexParameteri: GLTexture2d with: GLTextureMinFilter with: GLLinear.
  24.     ogl glTexParameteri: GLTexture2d with: GLTextureMagFilter with: GLLinear.
  25.    
  26.     "ogl glTexParameteri: GLTexture2d with: GLGenerateMipmapSGIS with: GLFalse".
  27.    
  28.  
  29.  
  30.     ogl glTexImage2D: GLTexture2d
  31.             with: 0
  32.             with: format
  33.             with: form width
  34.             with: form height
  35.             with: 0
  36.             with: ogl texturePixelFormat
  37.             with: ogl texturePixelType
  38.             with: form bits.
Add Comment
Please, Sign In to add comment