Esempio n. 1
0
 public static void SetClearColor(GL20 gl, LColor c)
 {
     GLUtils.SetClearColor(gl, c.r, c.g, c.b, c.a);
 }
Esempio n. 2
0
 public static void SetBlendMode(GL20 gl, int mode)
 {
     if (currentBlendMode == mode)
     {
         return;
     }
     currentBlendMode = mode;
     if (gl == null)
     {
         return;
     }
     if (currentBlendMode == BlendMethod.MODE_NORMAL)
     {
         GLUtils.EnableBlend(gl);
         gl.GLColorMask(true, true, true, false);
         gl.GLBlendFunc(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA);
         return;
     }
     else if (currentBlendMode == BlendMethod.MODE_SPEED)
     {
         GLUtils.EnableBlend(gl);
         gl.GLColorMask(true, true, true, true);
         gl.GLBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
         return;
     }
     else if (currentBlendMode == BlendMethod.MODE_ALPHA_MAP)
     {
         GLUtils.DisableBlend(gl);
         gl.GLColorMask(false, false, false, true);
         return;
     }
     else if (currentBlendMode == BlendMethod.MODE_ALPHA_BLEND)
     {
         GLUtils.EnableBlend(gl);
         gl.GLColorMask(true, true, true, false);
         gl.GLBlendFunc(GL20.GL_DST_ALPHA, GL20.GL_ONE_MINUS_DST_ALPHA);
         return;
     }
     else if (currentBlendMode == BlendMethod.MODE_COLOR_MULTIPLY)
     {
         GLUtils.EnableBlend(gl);
         gl.GLColorMask(true, true, true, true);
         gl.GLBlendFunc(GL20.GL_ONE_MINUS_SRC_COLOR, GL20.GL_SRC_COLOR);
         return;
     }
     else if (currentBlendMode == BlendMethod.MODE_ADD)
     {
         GLUtils.EnableBlend(gl);
         gl.GLColorMask(true, true, true, true);
         gl.GLBlendFunc(GL20.GL_ONE, GL20.GL_ONE);
         return;
     }
     else if (currentBlendMode == BlendMethod.MODE_SCREEN)
     {
         GLUtils.EnableBlend(gl);
         gl.GLColorMask(true, true, true, true);
         gl.GLBlendFunc(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_COLOR);
         return;
     }
     else if (currentBlendMode == BlendMethod.MODE_ALPHA_ONE)
     {
         GLUtils.EnableBlend(gl);
         gl.GLColorMask(true, true, true, true);
         gl.GLBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE);
         return;
     }
     else if (currentBlendMode == BlendMethod.MODE_ALPHA)
     {
         GLUtils.EnableBlend(gl);
         gl.GLBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
         return;
     }
     else if (currentBlendMode == BlendMethod.MODE_MASK)
     {
         GLUtils.EnableBlend(gl);
         gl.GLBlendFunc(GL20.GL_ZERO, GL20.GL_SRC_ALPHA);
         return;
     }
     else if (currentBlendMode == BlendMethod.MODE_LIGHT)
     {
         GLUtils.EnableBlend(gl);
         gl.GLBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE);
         return;
     }
     else if (currentBlendMode == BlendMethod.MODE_ALPHA_ADD)
     {
         GLUtils.EnableBlend(gl);
         gl.GLBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_DST_ALPHA);
         return;
     }
     else if (currentBlendMode == BlendMethod.MODE_MULTIPLY)
     {
         GLUtils.EnableBlend(gl);
         gl.GLBlendFunc(GL20.GL_DST_COLOR, GL20.GL_ONE_MINUS_SRC_ALPHA);
         return;
     }
     else if (currentBlendMode == BlendMethod.MODE_NONE)
     {
         GLUtils.DisableBlend(gl);
         gl.GLColorMask(true, true, true, false);
         return;
     }
     return;
 }
Esempio n. 3
0
 public static void Reset(GL20 gl)
 {
     GLUtils.Reload();
 }