Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards


Class opengl_buffer



// In header: <boost/compute/interop/opengl/opengl_buffer.hpp>

class opengl_buffer : public buffer {
  // construct/copy/destruct
  explicit opengl_buffer(cl_mem, bool = true);
  opengl_buffer(const context &, GLuint, cl_mem_flags = read_write);
  opengl_buffer(const opengl_buffer &);
  opengl_buffer & operator=(const opengl_buffer &);

  // public member functions
  GLuint get_opengl_object() const;
  cl_gl_object_type get_opengl_type() const;


A OpenCL buffer for accessing an OpenGL memory object.

opengl_buffer public construct/copy/destruct

  1. opengl_buffer();
    Creates a null OpenGL buffer object.
  2. explicit opengl_buffer(cl_mem mem, bool retain = true);
    Creates a new OpenGL buffer object for mem.
  3. opengl_buffer(const context & context, GLuint bufobj, 
                  cl_mem_flags flags = read_write);

    Creates a new OpenGL buffer object in context for bufobj with flags.

    See the documentation for

  4. opengl_buffer(const opengl_buffer & other);
    Creates a new OpenGL buffer object as a copy of other.
  5. opengl_buffer & operator=(const opengl_buffer & other);
    Copies the OpenGL buffer object from other.
  6. ~opengl_buffer();
    Destroys the OpenGL buffer object.

opengl_buffer public member functions

  1. GLuint get_opengl_object() const;

    Returns the OpenGL memory object ID.

    See the documentation for

  2. cl_gl_object_type get_opengl_type() const;

    Returns the OpenGL memory object type.

    See the documentation for