예제 #1
0
        public PostProcesser(OpenGL gl, int width, int height)
        {
            _gl  = gl;
            _fbo = new FBO(gl, width, height);

            _flatProgram = new FlatShader(gl);

            _flat       = new VAO(gl);
            _flatBuffer = new VBO(gl);

            using (new Bind(_flat))
                using (new Bind(_flatBuffer))
                {
                    var flatData = new float[] { -1, -1, 1, -1, -1, 1, 1, 1, };
                    _flatBuffer.Update(flatData, flatData.Length * sizeof(float));
                    gl.EnableVertexAttribArray(0);
                    gl.VertexAttribPointer(0, 2, OpenGL.GL_FLOAT, false, 0, new IntPtr(0));
                    gl.BindVertexArray(0);
                }
        }
예제 #2
0
        public PostProcesser(OpenGL gl,int width,int height)
        {
            _gl = gl;
            _fbo = new FBO(gl, width, height);

            _flatProgram = new FlatShader(gl);

            _flat = new VAO(gl);
            _flatBuffer = new VBO(gl);

            using (new Bind(_flat))
            using (new Bind(_flatBuffer))
            {
                var flatData = new float[] { -1, -1, 1, -1, -1, 1, 1, 1, };
                _flatBuffer.Update(flatData, flatData.Length * sizeof(float));
                gl.EnableVertexAttribArray(0);
                gl.VertexAttribPointer(0, 2, OpenGL.GL_FLOAT, false, 0, new IntPtr(0));
                gl.BindVertexArray(0);
            }
        }