Permalink
Browse files

remove object, put shader on global object

  • Loading branch information...
1 parent 94c9b83 commit 7b1aad24b80ceaa0a62a29b12891237ce136f570 @fserb committed Aug 28, 2011
Showing with 11 additions and 8 deletions.
  1. +4 −3 TODO
  2. +5 −0 objects.js
  3. +2 −5 shader.js
View
7 TODO
@@ -1,10 +1,11 @@
TODO
- remove dependency on external ajax
-- delete/remove object
-- delete/remove program
-- support for extra parameter in requestAnimationFrame
- support for TEXTURE_CUBE
- meshes (basic meshes, load formats)
+- program library
+- blending
+- stencil buffer example
+- lights
- include glmatrix?
- pop/push matrix on glmatrix?
View
@@ -5,4 +5,9 @@ glix.module.objects = function(gl) {
b.bind();
return b.assign();
};
+ gl.remove = function(objectName) {
+ delete gl._objects[objectName];
+ return gl;
+ };
+
};
View
@@ -1,7 +1,4 @@
glix.module.shader = function(gl) {
- // contains all programs currently loaded.
- var programs = {};
-
var loadShader = function(type, name) {
var data;
if (name[0] == "#") {
@@ -102,9 +99,9 @@ glix.module.shader = function(gl) {
gl.program = function(shaderName) {
if (shaderName === undefined) shaderName = "";
- var p = programs[shaderName];
+ var p = gl._objects[shaderName];
if (!p) {
- p = programs[shaderName] = {
+ p = gl._objects[shaderName] = {
_attached: 0,
val: gl.createProgram(),
attrib: {},

0 comments on commit 7b1aad2

Please sign in to comment.