[squeak-dev] speeding up copying World using dirty rectangles?
Lawson English
lenglish5 at cox.net
Fri Jan 20 17:15:16 UTC 2012
in my Gui to OpenGL code, I'm doing a very naive procedure to copy the
World to an OpenGL at every #step. I know that there's many ways to
speed this up (I get only 10fps with a saturated core when I do it the
simplest way). Suggestsion on how to make the following more efficient?
THanks.
getLatestImageFromWorld
|format form tempTextures|
pasteUpFormCanvas ifNil: [^self].
self hide.
myPasteUp fullDrawOn: pasteUpFormCanvas.
self show.
form := pasteUpFormCanvas form.
fPUWidth := form width.
fPUHeight := form height.
tempTextures := WordArray with: (textureIntNames at: 1).
ogl glDeleteTextures: 1 with: tempTextures.
ogl glBindTexture: GLTexture2d with: (textureIntNames at: 1).
ogl checkForError.
format := ogl textureInternalFormat.
ogl glEnable: GLTexture2d.
ogl glTexParameteri: GLTexture2d with: GLTextureMinFilter with:
GLLinear.
ogl glTexParameteri: GLTexture2d with: GLTextureMagFilter with:
GLLinear.
ogl glTexImage2D: GLTexture2d
with: 0
with: format
with: form width
with: form height
with: 0
with: ogl texturePixelFormat
with: ogl texturePixelType
with: form bits.
More information about the Squeak-dev
mailing list
|