コード例 #1
0
ファイル: OctreeRenderer.cs プロジェクト: veggielane/OpenCAD
        public BackgroundRenderer(OpenGL gl)
        {
            _gl = gl;

            _program = new BackgroundShader(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 BackgroundRenderer(OpenGL gl)
        {
            _gl = gl;

            _program    = new BackgroundShader(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);
                }
        }