Store a reference to the WebGLRenderingContext in WebGLObject

This commit is contained in:
Anthony Ramine 2018-07-24 13:27:33 +02:00
parent 8933a06eb8
commit 661e258b28
10 changed files with 231 additions and 233 deletions

View file

@ -48,15 +48,7 @@ impl OESVertexArrayObjectMethods for OESVertexArrayObject {
fn CreateVertexArrayOES(&self) -> Option<DomRoot<WebGLVertexArrayObjectOES>> {
let (sender, receiver) = webgl_channel().unwrap();
self.ctx.send_command(WebGLCommand::CreateVertexArray(sender));
let result = receiver.recv().unwrap();
result.map(|vao_id| {
WebGLVertexArrayObjectOES::new(
&self.global(),
vao_id,
self.ctx.limits().max_vertex_attribs,
)
})
receiver.recv().unwrap().map(|id| WebGLVertexArrayObjectOES::new(&self.ctx, id))
}
// https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/