Example #1
0
        public virtual void Resize(RenderParameters parameters)
        {
            cameraInfo.RenderWidth  = parameters.RenderWidth;
            cameraInfo.RenderHeight = parameters.RenderHeight;

            GL.Viewport(0, 0, parameters.RenderWidth, parameters.RenderHeight);
        }
Example #2
0
        public virtual void Initialize(RenderParameters parameters)
        {
            // Enable OpenGL functions
            GL.Enable(EnableCap.DepthTest);
            GL.Enable(EnableCap.AlphaTest);
            GL.Enable(EnableCap.Texture2D);
            GL.Enable(EnableCap.CullFace);
            GL.CullFace(CullFaceMode.Back);
            GL.ClearColor(Color.DarkGray);

            // Create Vertex Array
            GL.GenVertexArrays(1, out vertexArray);
            GL.BindVertexArray(vertexArray);

            // Create the blit vertex buffer
            GL.GenBuffers(1, out blitVertexBuffer);
            GL.BindBuffer(BufferTarget.ArrayBuffer, blitVertexBuffer);
            GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(VertexArrayData.BlitData.Length * sizeof(float)),
                          VertexArrayData.BlitData, BufferUsageHint.StaticDraw);

            cameraInfo = new Graphics.CameraInfo(parameters.RenderWidth, parameters.RenderHeight);
        }