예제 #1
0
        public override void BeginDrawControl(Rectangle unflippedControlRect, int windowSizeY)
        {
            if (fbo > 0)
            {
                GLES11Ext.GlBindFramebufferOES(GLES11Ext.GlFramebufferOes, fbo);
            }

            base.BeginDrawControl(unflippedControlRect, windowSizeY);
        }
예제 #2
0
        public override void EndDrawControl()
        {
            base.EndDrawControl();

            if (fbo > 0)
            {
                GLES11Ext.GlBindFramebufferOES(GLES11Ext.GlFramebufferOes, 0);
            }
        }
예제 #3
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();
        }
예제 #4
0
        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);
            }
        }