Ejemplo n.º 1
0
        /// <summary>
        /// Create, update, use and delete a renderbuffer object.
        /// </summary>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <param name="internalformat"></param>
        /// <param name="bufferType"></param>
        public Renderbuffer(int width, int height, uint internalformat, RenderbufferType bufferType)
        {
            if (glGenRenderbuffers == null)
            {
                glGenRenderbuffers    = OpenGL.GetDelegateFor <OpenGL.glGenRenderbuffers>();
                glBindRenderbuffer    = OpenGL.GetDelegateFor <OpenGL.glBindRenderbuffer>();
                glRenderbufferStorage = OpenGL.GetDelegateFor <OpenGL.glRenderbufferStorage>();
            }

            this.Width      = width;
            this.Height     = height;
            this.BufferType = bufferType;

            glGenRenderbuffers(1, renderbuffer);
            glBindRenderbuffer(OpenGL.GL_RENDERBUFFER, renderbuffer[0]);
            glRenderbufferStorage(OpenGL.GL_RENDERBUFFER,
                                  internalformat,// TODO: add comment about OpenGL.GL_DEPTH24_STENCIL8, OpenGL.GL_RGBA,
                                  width, height);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create, update, use and delete a renderbuffer object.
        /// </summary>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <param name="internalformat"></param>
        /// <param name="bufferType"></param>
        public Renderbuffer(int width, int height, uint internalformat, RenderbufferType bufferType)
        {
            if (glGenRenderbuffers == null)
            {
                glGenRenderbuffers = OpenGL.GetDelegateFor<OpenGL.glGenRenderbuffers>();
                glBindRenderbuffer = OpenGL.GetDelegateFor<OpenGL.glBindRenderbuffer>();
                glRenderbufferStorage = OpenGL.GetDelegateFor<OpenGL.glRenderbufferStorage>();
            }

            this.Width = width;
            this.Height = height;
            this.BufferType = bufferType;

            glGenRenderbuffers(1, renderbuffer);
            glBindRenderbuffer(OpenGL.GL_RENDERBUFFER, renderbuffer[0]);
            glRenderbufferStorage(OpenGL.GL_RENDERBUFFER,
                internalformat,// TODO: add comment about OpenGL.GL_DEPTH24_STENCIL8, OpenGL.GL_RGBA,
                width, height);
        }