webgl: Fix texturing

These two tiny changes were making WebGL textures not work.

It was not seen in our texturing test since we render to a texture by
default, and that texture was bound to `gl::TEXTURE_2D`.
This commit is contained in:
Emilio Cobos Álvarez 2015-12-03 02:53:37 +01:00
parent 2be60be062
commit 3af24ed119
2 changed files with 2 additions and 2 deletions

View file

@ -257,7 +257,7 @@ impl WebGLPaintTask {
}
fn create_texture(&self, chan: IpcSender<Option<NonZero<u32>>>) {
let texture = gl::gen_framebuffers(1)[0];
let texture = gl::gen_textures(1)[0];
let texture = if texture == 0 {
None
} else {

View file

@ -70,7 +70,7 @@ impl WebGLTexture {
self.target.set(Some(target));
}
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BindTexture(self.id, target))).unwrap();
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BindTexture(target, self.id))).unwrap();
Ok(())
}