Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' of github.com:fserb/glix

Conflicts:
	TODO
  • Loading branch information...
commit 00082bd6a7a93c5595a0cb8b1c024b191bc9dda2 2 parents 02dd07c + 7b1aad2
Fernando Serboncini authored August 28, 2011

Showing 2 changed files with 7 additions and 5 deletions. Show diff stats Hide diff stats

  1. 5  objects.js
  2. 7  shader.js
5  objects.js
@@ -5,4 +5,9 @@ glix.module.objects = function(gl) {
5 5
     b.bind();
6 6
     return b.assign();
7 7
   };
  8
+  gl.remove = function(objectName) {
  9
+    delete gl._objects[objectName];
  10
+    return gl;
  11
+  };
  12
+
8 13
 };
7  shader.js
... ...
@@ -1,7 +1,4 @@
1 1
 glix.module.shader = function(gl) {
2  
-  // contains all programs currently loaded.
3  
-  var programs = {};
4  
-
5 2
   var loadShader = function(type, name) {
6 3
     var data;
7 4
     if (name[0] == "#") {
@@ -102,9 +99,9 @@ glix.module.shader = function(gl) {
102 99
 
103 100
   gl.program = function(shaderName) {
104 101
     if (shaderName === undefined) shaderName = "";
105  
-    var p = programs[shaderName];
  102
+    var p = gl._objects[shaderName];
106 103
     if (!p) {
107  
-      p = programs[shaderName] = {
  104
+      p = gl._objects[shaderName] = {
108 105
         _attached: 0,
109 106
         val: gl.createProgram(),
110 107
         attrib: {},

0 notes on commit 00082bd

Please sign in to comment.
Something went wrong with that request. Please try again.