public ICubismTexture CreateTexture(byte[] texture_bytes)
        {
            var bitmap  = new System.Drawing.Bitmap(new MemoryStream(texture_bytes));
            var texture = new CubismOpenTKTexture(bitmap);

            Textures.Add(texture);
            return(texture);
        }
 public void Resize(int width, int height)
 {
     GL.BindFramebuffer(FramebufferTarget.Framebuffer, FrameBufferId);
     GL.FramebufferTexture2D(FramebufferTarget.Framebuffer, FramebufferAttachment.ColorAttachment0, TextureTarget2d.Texture2D, 0, 0);
     Texture.Dispose();
     Texture = new CubismOpenTKTexture(width, height);
     GL.FramebufferTexture2D(FramebufferTarget.Framebuffer, FramebufferAttachment.ColorAttachment0, TextureTarget2d.Texture2D, TextureId, 0);
     GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);
 }
        public CubismOpenTKClippingMask(int width, int height)
        {
            Texture = new CubismOpenTKTexture(width, height);

            int[] fbos = new int[1];
            GL.GenFramebuffers(1, fbos);
            FrameBufferId = fbos[0];
            GL.BindFramebuffer(FramebufferTarget.Framebuffer, FrameBufferId);
            GL.FramebufferTexture2D(FramebufferTarget.Framebuffer, FramebufferAttachment.ColorAttachment0, TextureTarget2d.Texture2D, TextureId, 0);
            GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);
        }