webgl: Refactor implementation to move logic inside the DOM interfaces

This improves the encapsulation and consistency in our WebGL
implementation.

Also allows to implement new methods such as `getShaderSource()`.

It will also allow us to use `delete()` in the destructors of them (note
that we will want to keep track of them from the context).
This commit is contained in:
ecoal95 2015-06-14 22:55:50 +02:00
parent c022262826
commit b1765c6882
11 changed files with 452 additions and 130 deletions

View file

@ -28,11 +28,11 @@ impl WebGLUniformLocation {
}
pub trait WebGLUniformLocationHelpers {
fn get_id(self) -> i32;
fn id(self) -> i32;
}
impl<'a> WebGLUniformLocationHelpers for &'a WebGLUniformLocation {
fn get_id(self) -> i32 {
fn id(self) -> i32 {
self.id
}
}