[quote=34799:@stuart s]Here’s a tester I’ve been working on to check performance. Drawing 120 sprites the Canvas runs pretty well, only slowing to 30fps at most, but OpenGL stays locked on 60fps easily, even with 1200 sprites.
http://home.comcast.net/~trochoid/code/blueb.zip
To try the demos set the apps default window to one of these and run.
Window3 uses Canvas and sprites drawn from a precomputed array of the rotated image. Command-R toggles between full-frame redrawing and rect-invalidating.
Window3GL uses an OpenGLSurface subclass with event Paint(g As ezgl), supposedly to be more canvas-like. Command-P toggles between canvas style coordinates and a perspective camera (where dragging and wheeling moves the camera).[/quote]
I finally have to get back to looking at your ezGL subclass and I must say that it is very nice. I am having trouble calling the sprites though.
Following your example, in window Open:
dim g As ezgl = gamewindow.getTheGL
g.texture.genTexBank(1)
g.texture.storeImageAlpha(0, seabed, seabed.mask)
g.texture.storeImageAlpha(1, sharkleft, sharkleft.mask)
//tilt cam a bit
gamewindow.getTheCam.angleY = -0.2
In gamewindow.Paint, I have:
g.projectAsCanvas(me)
//set alpha blending
OpenGL.glEnable OpenGL.GL_BLEND
OpenGL.glBlendFunc OpenGL.GL_SRC_ALPHA, OpenGL.GL_ONE_MINUS_SRC_ALPHA
// Draw seabed background
g.texture.turnOn
g.texture.bindTo(0)
for i as integer = 0 to me.Width/seabed.Width
g.draw2DRectTex(i*seabed.Width, me.Height - seabed.Height, seabed.Width, seabed.Height)
next
// Draw the shark
g.texture.bindto(1)
g.draw2DRect(me.Width/2, me.Height/2, sharkleft.width, sharkleft.height)
The seabed sprites got drawn correctly and shows up, but I can’t seem to get the shark to show up. If I do “g.texture.turnOff” right before drawing the shark, I see that it is drawing boundaries for the shark (white box), just not the shark sprite. How do you add/call sprites? Thanks, very exciting.
Edit: I thought the first sample was OpenGL and when switching to the InvalidateRect sample, it shows regular canvas. I was quit confused, then I went in and commented out everything in “display.Paint” and the animation still ran. So, that means that the tests you provided never used OpenGLSurface, correct? What am I missing? 
Your test does show that invalidating the rects will slow down the animation, which was what I thought and why I went with the 1 sprite layer instead of refreshing individual rects. I thank you for confirming this.