예제 #1
0
        private int GenerateVertices()
        {
            // Generate vertex positions
            uint halfWidth  = Image.GetResolution().X / 2;
            uint halfHeight = Image.GetResolution().Y / 2;

            List <float> vertexPositions = new List <float>
            {
                -halfWidth, halfHeight,
                halfWidth, halfHeight,
                -halfWidth, -halfHeight,
                halfWidth, -halfHeight
            };

            // Buffer the generated vertices in the GPU
            int bufferID;

            GL.GenBuffers(1, out bufferID);

            GL.BindBuffer(BufferTarget.ArrayBuffer, bufferID);
            GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(vertexPositions.Count * sizeof(float)), vertexPositions.ToArray(), BufferUsageHint.StaticDraw);

            return(bufferID);
        }
예제 #2
0
 /// <inheritdoc />
 protected override Resolution GetResolution()
 {
     return(_image.GetResolution());
 }