Beispiel #1
0
        public void update(float timeSec, int mouseX, int mouseY, bool leftButton, int width, int height)
        {
            surface = GLTools.Texture.Resize(ref surface, width, height);
            surface.BeginUpdate();

            var resolution = new Vector2(width, height);
            GL.Viewport(0, 0, width, height);
            shader.Begin();
            GL.Uniform1(shader.GetUniformLocation("iGlobalTime"), timeSec);
            GL.Uniform2(shader.GetUniformLocation("iResolution"), resolution);
            GL.Uniform3(shader.GetUniformLocation("iMouse"), new Vector3(mouseX, mouseY, leftButton ? 1.0f : 0.0f));
            GL.Clear(ClearBufferMask.ColorBufferBit);
            GL.BindVertexArray(bufferQuad);
            GL.DrawArrays(PrimitiveType.TriangleStrip, 0, 4);
            GL.BindVertexArray(0);
            shader.End();

            surface.EndUpdate();
        }