Beispiel #1
0
        public ContextGL3x(GameWindow gameWindow, int width, int height)
        {
            Vector4 clearColor = new Vector4();
            GL.GetFloat(GetPName.DepthClearValue, out _clearDepth);
            GL.GetInteger(GetPName.StencilClearValue, out _clearStencil);
            GL.GetFloat(GetPName.ColorClearValue, out clearColor);
            _clearColor = Color.FromArgb(
                Convert.ToInt32(clearColor.W * 255.0), 
                Convert.ToInt32(clearColor.X * 255.0), 
                Convert.ToInt32(clearColor.Y * 255.0),
                Convert.ToInt32(clearColor.Z * 255.0));

            _renderState = new RenderState();
            _textureUnits = new TextureUnitsGL3x();

            //
            // Sync GL state with default render state.
            //
            ForceApplyRenderState(_renderState);

            Viewport = new Rectangle(0, 0, width, height);
            _gameWindow = gameWindow;
        }
Beispiel #2
0
        public ContextGL3x(GameWindow gameWindow, int width, int height)
        {
            Vector4 clearColor = new Vector4();

            GL.GetFloat(GetPName.DepthClearValue, out _clearDepth);
            GL.GetInteger(GetPName.StencilClearValue, out _clearStencil);
            GL.GetFloat(GetPName.ColorClearValue, out clearColor);
            _clearColor = Color.FromArgb(
                Convert.ToInt32(clearColor.W * 255.0),
                Convert.ToInt32(clearColor.X * 255.0),
                Convert.ToInt32(clearColor.Y * 255.0),
                Convert.ToInt32(clearColor.Z * 255.0));

            _renderState  = new RenderState();
            _textureUnits = new TextureUnitsGL3x();

            //
            // Sync GL state with default render state.
            //
            ForceApplyRenderState(_renderState);

            Viewport    = new Rectangle(0, 0, width, height);
            _gameWindow = gameWindow;
        }