public override void BeginDrawControl(Rectangle unflippedControlRect, int windowSizeY) { if (fbo > 0) { GLES11Ext.GlBindFramebufferOES(GLES11Ext.GlFramebufferOes, fbo); } base.BeginDrawControl(unflippedControlRect, windowSizeY); }
public override void EndDrawControl() { base.EndDrawControl(); if (fbo > 0) { GLES11Ext.GlBindFramebufferOES(GLES11Ext.GlFramebufferOes, 0); } }
public override void Dispose() { if (texture != 0) { GLES11.GlDeleteTextures(1, new[] { texture }, 0); } if (fbo != 0) { GLES11Ext.GlDeleteFramebuffersOES(1, new[] { fbo }, 0); } base.Dispose(); }
private GLOffscreenGraphics(int imageSizeX, int imageSizeY, bool allowReadback) : base(1.0f, 1.0f) { resX = imageSizeX; resY = imageSizeY; if (!allowReadback) { texture = CreateEmptyTexture(imageSizeX, imageSizeY, false); var fbos = new int[1]; GLES11Ext.GlGenFramebuffersOES(1, fbos, 0); fbo = fbos[0]; GLES11Ext.GlBindFramebufferOES(GLES11Ext.GlFramebufferOes, fbo); GLES11Ext.GlFramebufferTexture2DOES(GLES11Ext.GlFramebufferOes, GLES11Ext.GlColorAttachment0Oes, GLES11.GlTexture2d, texture, 0); GLES11Ext.GlBindFramebufferOES(GLES11Ext.GlFramebufferOes, 0); } }