Example #1
0
        private void InternalBegin(BlendState blendState, ref Matrix matrix)
        {
            if (inBatch || disposed)
            {
                throw new InvalidOperationException("SpriteBatch is in incorrect state");
            }
            inBatch = true;

            // Set up OpenGL projection matrix (client to projection)
            device.SetupClientProjection();

            // Set up user matrix (world to client)
            GL.MatrixMode(All.Modelview);
            GL.LoadMatrix(ref matrix.M11);             // would you believe that this is legal?

            // Initialize OpenGL states
            GL.Disable(All.DepthTest);
            GL.TexEnv(All.TextureEnv, All.TextureEnvMode, (int)All.BlendSrc);
            GL.EnableClientState(All.VertexArray);

            blendState.Apply();

            lastTexture = null;
        }