|
@@ -321,6 +321,8 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
|
|
|
|
|
|
var compressedTextureFormats = null;
|
|
|
|
|
|
+ var currentProgram = null;
|
|
|
+
|
|
|
var currentBlending = null;
|
|
|
var currentBlendEquation = null;
|
|
|
var currentBlendSrc = null;
|
|
@@ -511,6 +513,22 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ function useProgram( program ) {
|
|
|
+
|
|
|
+ if ( currentProgram !== program ) {
|
|
|
+
|
|
|
+ gl.useProgram( program );
|
|
|
+
|
|
|
+ currentProgram = program;
|
|
|
+
|
|
|
+ return true;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
function setBlending( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, premultipliedAlpha ) {
|
|
|
|
|
|
if ( blending !== NoBlending ) {
|
|
@@ -878,6 +896,8 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
|
|
|
currentTextureSlot = null;
|
|
|
currentBoundTextures = {};
|
|
|
|
|
|
+ currentProgram = null;
|
|
|
+
|
|
|
currentBlending = null;
|
|
|
|
|
|
currentFlipSided = null;
|
|
@@ -906,6 +926,8 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
|
|
|
disable: disable,
|
|
|
getCompressedTextureFormats: getCompressedTextureFormats,
|
|
|
|
|
|
+ useProgram: useProgram,
|
|
|
+
|
|
|
setBlending: setBlending,
|
|
|
setMaterial: setMaterial,
|
|
|
|