Example #1
0
        public static void Commit(LTexture tex2d, GLCache cache, bool update)
        {
            if (cache.batchCount == 0)
            {
                return;
            }
            GL gl = GLEx.GL;

            gl.GLBind(tex2d);
            if (update)
            {
                if (cache.x != 0 || cache.y != 0)
                {
                    gl.GLPushMatrix();
                    gl.GLTranslate(cache.x, cache.y, 0);
                }
            }
            GLEx.GL.Submit(cache.m_type, cache.batchCount, cache.m_cache, cache.m_quadIndices, null);
            if (update)
            {
                if (cache.x != 0 || cache.y != 0)
                {
                    gl.GLPopMatrix();
                }
            }
        }
Example #2
0
 public void DisposeLastCache()
 {
     if (m_lastCache != null)
     {
         m_lastCache.Dispose();
         m_lastCache = null;
     }
 }
Example #3
0
        public static void CommitQuad(LTexture tex2d, GLCache cache,
                                      LColor c, float x, float y, float sx, float sy, float ax, float ay,
                                      float rotation)
        {
            if (cache.batchCount == 0)
            {
                return;
            }
            GL gl = GLEx.GL;

            gl.GLBind(tex2d);
            gl.GLPushMatrix();
            if (x != 0 || y != 0)
            {
                gl.GLTranslate(x, y, 0);
            }
            if (sx != 0 || sx != 0)
            {
                gl.GLScale(sx, sy, 0);
            }
            if (rotation != 0)
            {
                if (ax != 0 || ay != 0)
                {
                    gl.GLTranslate(ax, ay, 0f);
                    gl.GLRotate(rotation);
                    gl.GLTranslate(-ax, -ay, 0f);
                }
                else
                {
                    gl.GLTranslate(tex2d.width / 2,
                                   tex2d.height / 2, 0f);
                    gl.GLRotate(rotation);
                    gl.GLTranslate(-tex2d.width / 2,
                                   -tex2d.height / 2, 0f);
                }
            }
            GLEx.GL.Submit(cache.m_type, cache.batchCount, cache.m_cache, cache.m_quadIndices, null);
            gl.GLPopMatrix();
        }
Example #4
0
 public void Dispose()
 {
     this.batchCount = 0;
     this.useBegin   = false;
     this.isLocked   = true;
     this.vectors    = null;
     this.colors     = null;
     this.coords     = null;
     if (glbase != null)
     {
         this.glbase.Dispose();
         this.glbase = null;
     }
     if (m_lastCache != null)
     {
         m_lastCache.Dispose();
         m_lastCache = null;
     }
     if (image_colors != null)
     {
         image_colors = null;
     }
 }
Example #5
0
 public static void Commit(LTexture tex2d, GLCache cache)
 {
     Commit(tex2d, cache, true);
 }
Example #6
0
 public GLCache NewGLCache(bool Reset)
 {
     return(m_lastCache = new GLCache(this, Reset));
 }
Example #7
0
 public static void CommitQuad(LTexture tex2d, GLCache cache,
 LColor c, float x, float y, float sx, float sy, float ax, float ay,
 float rotation)
 {
     if (cache.batchCount == 0)
     {
         return;
     }
     GL gl = GLEx.GL;
     gl.GLBind(tex2d);
     gl.GLPushMatrix();
     if (x != 0 || y != 0)
     {
         gl.GLTranslate(x, y, 0);
     }
     if (sx != 0 || sx != 0)
     {
         gl.GLScale(sx, sy, 0);
     }
     if (rotation != 0)
     {
         if (ax != 0 || ay != 0)
         {
             gl.GLTranslate(ax, ay, 0f);
             gl.GLRotate(rotation);
             gl.GLTranslate(-ax, -ay, 0f);
         }
         else
         {
             gl.GLTranslate(tex2d.width / 2,
                     tex2d.height / 2, 0f);
             gl.GLRotate(rotation);
             gl.GLTranslate(-tex2d.width / 2,
                    -tex2d.height / 2, 0f);
         }
     }
     GLEx.GL.Submit(cache.m_type, cache.batchCount, cache.m_cache, cache.m_quadIndices, null);
     gl.GLPopMatrix();
 }
Example #8
0
 public static void Commit(LTexture tex2d, GLCache cache, bool update)
 {
     if (cache.batchCount == 0)
     {
         return;
     }
     GL gl = GLEx.GL;
     gl.GLBind(tex2d);
     if (update)
     {
         if (cache.x != 0 || cache.y != 0)
         {
             gl.GLPushMatrix();
             gl.GLTranslate(cache.x, cache.y, 0);
         }
     }
     GLEx.GL.Submit(cache.m_type, cache.batchCount, cache.m_cache, cache.m_quadIndices, null);
     if (update)
     {
         if (cache.x != 0 || cache.y != 0)
         {
             gl.GLPopMatrix();
         }
     }
 }
Example #9
0
 public static void Commit(LTexture tex2d, GLCache cache)
 {
     Commit(tex2d, cache, true);
 }
Example #10
0
 public void Dispose()
 {
     this.batchCount = 0;
     this.useBegin = false;
     this.isLocked = true;
     this.vectors = null;
     this.colors = null;
     this.coords = null;
     if (glbase != null)
     {
         this.glbase.Dispose();
         this.glbase = null;
     }
     if (m_lastCache != null)
     {
         m_lastCache.Dispose();
         m_lastCache = null;
     }
     if (image_colors != null)
     {
         image_colors = null;
     }
 }
Example #11
0
 public void DisposeLastCache()
 {
     if (m_lastCache != null)
     {
         m_lastCache.Dispose();
         m_lastCache = null;
     }
 }
Example #12
0
 public GLCache NewGLCache(bool Reset)
 {
     return m_lastCache = new GLCache(this, Reset);
 }