protected override void OnGLRender(object sender, EventArgs args) { _glsx.SmoothMode = SmoothMode.Smooth; _glsx.StrokeColor = PixelFarm.Drawing.Color.Blue; _glsx.Clear(PixelFarm.Drawing.Color.White); _glsx.ClearColorBuffer(); //------------------------------- if (!isInit) { glbmp = DemoHelper.LoadTexture(RootDemoPath.Path + @"\logo-dark.png"); isInit = true; } if (frameBuffer.FrameBufferId > 0) { if (frameBufferNeedUpdate) { //------------------------------------------------------------------------------------ //framebuffer _glsx.AttachFrameBuffer(frameBuffer); //after make the frameBuffer current //then all drawing command will apply to frameBuffer //do draw to frame buffer here _glsx.Clear(PixelFarm.Drawing.Color.Red); _glsx.DrawImageWithBlurX(glbmp, 0, 300); _glsx.DetachFrameBuffer(); //------------------------------------------------------------------------------------ //framebuffer2 _glsx.AttachFrameBuffer(frameBuffer2); GLBitmap bmp2 = new GLBitmap(frameBuffer.TextureId, frameBuffer.Width, frameBuffer.Height); bmp2.IsBigEndianPixel = true; _glsx.DrawImageWithBlurY(bmp2, 0, 300); _glsx.DetachFrameBuffer(); //------------------------------------------------------------------------------------ //after release current, we move back to default frame buffer again*** frameBufferNeedUpdate = false; } _glsx.DrawFrameBuffer(frameBuffer2, 15, 300); } else { _glsx.Clear(PixelFarm.Drawing.Color.Blue); } //------------------------------- SwapBuffers(); }
protected override void OnGLRender(object sender, EventArgs args) { _glsx.SmoothMode = SmoothMode.Smooth; _glsx.StrokeColor = PixelFarm.Drawing.Color.Blue; _glsx.Clear(PixelFarm.Drawing.Color.White); _glsx.ClearColorBuffer(); //------------------------------- if (!isInit) { glbmp = DemoHelper.LoadTexture(RootDemoPath.Path + @"\leaves.jpg"); isInit = true; } if (frameBuffer.FrameBufferId > 0) { if (frameBufferNeedUpdate) { //------------------------------------------------------------------------------------ //framebuffer _glsx.AttachFrameBuffer(frameBuffer); //after make the frameBuffer current //then all drawing command will apply to frameBuffer //do draw to frame buffer here _glsx.Clear(PixelFarm.Drawing.Color.Red); _glsx.DrawImageWithConv3x3(glbmp, Mat3x3ConvGen.emboss, 0, 300); _glsx.DetachFrameBuffer(); //after release current, we move back to default frame buffer again*** frameBufferNeedUpdate = false; } _glsx.DrawFrameBuffer(frameBuffer, 15, 300); } else { _glsx.Clear(PixelFarm.Drawing.Color.Blue); } //------------------------------- SwapBuffers(); }