Example #1
0
        public void PreDrawSetup(DisplayShader shader, BlendOptions blendOptions, Matrix4 transform)//, Texture texture, int textureMatrixLocation)
        {
            Activate();

            GL.BlendEquation(blendOptions.BlendEquation);
            GL.BlendFunc(blendOptions.BlendSource, blendOptions.BlendDestination);

            shader.Bind();

            GL.UniformMatrix4(shader.UniformProjectionMatrixLocation, false, ref m_projectionMatrix);

            if (m_cameraNeedUpdate)
            {
                ApplyCameraGL(shader.UniformProjectionMatrixLocation);
                m_cameraNeedUpdate = false;
            }

            GL.UniformMatrix4(shader.UniformModelViewMatrixLocation, false, ref transform);
        }
Example #2
0
 public void ApplyCameraGL(DisplayShader shader)
 {
     GL.Viewport((int)m_currentCamera.Viewport.Position.X, (int)m_currentCamera.Viewport.Position.Y, (int)m_currentCamera.Viewport.Size.X, (int)m_currentCamera.Viewport.Size.Y);
     m_projectionMatrix = m_currentCamera.GetTransform() * m_defaultOrtho;
     GL.UniformMatrix4(shader.UniformProjectionMatrixLocation, false, ref m_projectionMatrix);
 }