예제 #1
0
        internal override void Apply()
        {
            GLStateManager.Projection(Projection);
            GLStateManager.World(World);
            GLStateManager.View(View);
            base.Apply();

            // set camera
            Matrix _matrix = Matrix.Identity;

            GL.MatrixMode(MatrixMode.Projection);
            GL.LoadIdentity();
            GL.Ortho(0, 320, 480, 0, -1, 1);
            GL.MatrixMode(MatrixMode.Modelview);
            GL.LoadMatrix(ref _matrix.M11);
            GL.Viewport(0, 0, 320, 480);

            // Initialize OpenGL states (ideally move this to initialize somewhere else)
            GL.Disable(EnableCap.DepthTest);
            GL.TexEnv(TextureEnvTarget.TextureEnv, TextureEnvParameter.TextureEnvMode, (int)All.BlendSrc);
            GL.Enable(EnableCap.Texture2D);
            GL.EnableClientState(ArrayCap.VertexArray);
            GL.EnableClientState(ArrayCap.ColorArray);
            GL.EnableClientState(ArrayCap.TextureCoordArray);

            GL.Disable(EnableCap.CullFace);
        }
예제 #2
0
        internal override void Apply()
        {
            // May need to be moved elsewhere within this method
            OnApply();

            GLStateManager.Projection(Projection);
            GLStateManager.World(World);
            GLStateManager.View(View);

            base.Apply();

            GLStateManager.Textures2D(Texture != null);

            GLStateManager.ColorArray(VertexColorEnabled);
        }