public ICubismTexture CreateTexture(byte[] texture_bytes) { var bitmap = new Bitmap(new MemoryStream(texture_bytes)); var texture = new CubismAvaloniaTexture(gl, bitmap); Textures.Add(texture); return(texture); }
public void Resize(int width, int height) { gl.BindFramebuffer(GL_FRAMEBUFFER, FrameBufferId); gl.FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); Texture.Dispose(); Texture = new CubismAvaloniaTexture(gl, width, height); gl.FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, TextureId, 0); gl.BindFramebuffer(GL_FRAMEBUFFER, 0); }
public CubismAvaloniaClippingMask(GlInterfaceEx gl, int width, int height) { this.gl = gl; Texture = new CubismAvaloniaTexture(gl, width, height); int[] fbos = new int[1]; this.gl.GenFramebuffers(1, fbos); FrameBufferId = fbos[0]; this.gl.BindFramebuffer(GL_FRAMEBUFFER, FrameBufferId); this.gl.FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, TextureId, 0); this.gl.BindFramebuffer(GL_FRAMEBUFFER, 0); }