Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Examples

# Gdk::GL::Drawable Class Reference

`#include <drawable.h>`

Inheritance diagram for Gdk::GL::Drawable:

[legend]
List of all members.

## Public Member Functions
virtual | ~Drawable ()
GdkGLDrawable * | gobj ()
| Provides access to the underlying C GObject.
const GdkGLDrawable * | gobj () const
| Provides access to the underlying C GObject.
bool | make_current (const Glib::RefPtr< Context > &glcontext)
bool | is_double_buffered () const
void | swap_buffers ()
void | wait_gl ()
void | wait_gdk ()
bool | gl_begin (const Glib::RefPtr< Context > &glcontext)
void | gl_end ()
Glib::RefPtr< Config > | get_gl_config ()
Glib::RefPtr< const Config > | get_gl_config () const
void | get_size (int &width, int &height)
## Static Public Member Functions
static void | add_interface (GType gtype_implementer)
static Glib::RefPtr< Drawable > | get_current ()
static void | draw_cube (bool solid, double size)
static void | draw_sphere (bool solid, double radius, int slices, int stacks)
static void | draw_cone (bool solid, double base, double height, int slices, int stacks)
static void | draw_torus (bool solid, double inner_radius, double outer_radius, int nsides, int rings)
static void | draw_tetrahedron (bool solid)
static void | draw_octahedron (bool solid)
static void | draw_dodecahedron (bool solid)
static void | draw_icosahedron (bool solid)
static void | draw_teapot (bool solid, double scale)
## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gdk::GL::Drawable > | wrap (GdkGLDrawable *object, bool take_copy=false)

## Detailed Description

OpenGL rendering surface abstract class.

## Constructor & Destructor Documentation

virtual Gdk::GL::Drawable::~Drawable | ( |  | ) | `[virtual]`

## Member Function Documentation

static void Gdk::GL::Drawable::add_interface | ( | GType | gtype_implementer | ) | `[static]`

static void Gdk::GL::Drawable::draw_cone | ( | bool | solid,
|  | double | base,
|  | double | height,
|  | int | slices,
|  | int | stacks
| ) | `[static]`

  | Renders a cone oriented along the Z axis. The base of the cone is placed at Z = 0, and the top at Z = height . The cone is subdivided around the Z axis into slices , and along the Z axis into stacks . Parameters:
  | solid | `true` if the cone should be solid.
  | base | The radius of the base of the cone.
  | height | The height of the cone.
  | slices | The number of subdivisions around the Z axis.
  | stacks | The number of subdivisions along the Z axis.

static void Gdk::GL::Drawable::draw_cube | ( | bool | solid,
|  | double | size
| ) | `[static]`

  | Renders a cube. The cube is centered at the modeling coordinates origin with sides of length size . Parameters:
  | solid | `true` if the cube should be solid.
  | size | Length of cube sides.

static void Gdk::GL::Drawable::draw_dodecahedron | ( | bool | solid | ) | `[static]`

  | Renders a dodecahedron centered at the modeling coordinates origin with a radius of the square root of 3. Parameters:
  | solid | `true` if the dodecahedron should be solid.

static void Gdk::GL::Drawable::draw_icosahedron | ( | bool | solid | ) | `[static]`

  | Renders a icosahedron. The icosahedron is centered at the modeling coordinates origin and has a radius of 1.0. Parameters:
  | solid | `true` if the icosahedron should be solid.

static void Gdk::GL::Drawable::draw_octahedron | ( | bool | solid | ) | `[static]`

  | Renders a octahedron centered at the modeling coordinates origin with a radius of 1.0. Parameters:
  | solid | `true` if the octahedron should be solid.

static void Gdk::GL::Drawable::draw_sphere | ( | bool | solid,
|  | double | radius,
|  | int | slices,
|  | int | stacks
| ) | `[static]`

  | Renders a sphere centered at the modeling coordinates origin of the specified radius . The sphere is subdivided around the Z axis into slices and along the Z axis into stacks . Parameters:
  | solid | `true` if the sphere should be solid.
  | radius | The radius of the sphere.
  | slices | The number of subdivisions around the Z axis (similar to lines of longitude).
  | stacks | The number of subdivisions along the Z axis (similar to lines of latitude).

static void Gdk::GL::Drawable::draw_teapot | ( | bool | solid,
|  | double | scale
| ) | `[static]`

  | Renders a teapot. Both surface normals and texture coordinates for the teapot are generated. The teapot is generated with OpenGL evaluators. Parameters:
  | solid | `true` if the teapot should be solid.
  | scale | Relative size of the teapot.

static void Gdk::GL::Drawable::draw_tetrahedron | ( | bool | solid | ) | `[static]`

  | Renders a tetrahedron centered at the modeling coordinates origin with a radius of the square root of 3. Parameters:
  | solid | `true` if the tetrahedron should be solid.

static void Gdk::GL::Drawable::draw_torus | ( | bool | solid,
|  | double | inner_radius,
|  | double | outer_radius,
|  | int | nsides,
|  | int | rings
| ) | `[static]`

  | Renders a torus (doughnut) centered at the modeling coordinates origin whose axis is aligned with the Z axis. Parameters:
  | solid | `true` if the torus should be solid.
  | inner_radius | Inner radius of the torus.
  | outer_radius | Outer radius of the torus.
  | nsides | Number of sides for each radial section.
  | rings | Number of radial divisions for the torus.

static Glib::RefPtr<Drawable> Gdk::GL::Drawable::get_current | ( |  | ) | `[static]`

| Returns the current Gdk::GLDrawable. Returns: The current Gdk::GLDrawable or `0` if there is no current drawable.

Glib::RefPtr<const Config> Gdk::GL::Drawable::get_gl_config | ( |  | ) | const

| Gets Gdk::GLConfig with which the gldrawable is configured. Returns: The Gdk::GLConfig.

Glib::RefPtr<Config> Gdk::GL::Drawable::get_gl_config | ( |  | ) |

| Gets Gdk::GLConfig with which the gldrawable is configured. Returns: The Gdk::GLConfig.

void Gdk::GL::Drawable::get_size | ( | int & | width,
|  | int & | height
| ) |

  | Fills *width and *height with the size of GL drawable. width or height can be `0` if you only want the other one. Parameters:
  | width | Location to store drawable's width, or `0`.
  | height | Location to store drawable's height, or `0`.

bool Gdk::GL::Drawable::gl_begin | ( | const Glib::RefPtr< Context > & | glcontext | ) |

  | Delimits the begining of the OpenGL execution. Parameters:
  | glcontext | A Gdk::GLContext.
Returns: `true` if it is successful, `false` otherwise.

void Gdk::GL::Drawable::gl_end | ( |  | ) |

| Delimits the end of the OpenGL execution.

const GdkGLDrawable* Gdk::GL::Drawable::gobj | ( |  | ) | const`[inline]`

| Provides access to the underlying C GObject. Reimplemented in Gdk::GL::Pixmap, and Gdk::GL::Window.

GdkGLDrawable* Gdk::GL::Drawable::gobj | ( |  | ) | `[inline]`

| Provides access to the underlying C GObject. Reimplemented in Gdk::GL::Pixmap, and Gdk::GL::Window.

bool Gdk::GL::Drawable::is_double_buffered | ( |  | ) | const

| Returns whether the gldrawable supports the double-buffered visual. Returns: `true` if the double-buffered visual is supported, `false` otherwise.

bool Gdk::GL::Drawable::make_current | ( | const Glib::RefPtr< Context > & | glcontext | ) |

  | Attach an OpenGL rendering context to a gldrawable . Parameters:
  | glcontext | A Gdk::GLContext.
Returns: `true` if it is successful, `false` otherwise.

void Gdk::GL::Drawable::swap_buffers | ( |  | ) |

| Exchange front and back buffers.

void Gdk::GL::Drawable::wait_gdk | ( |  | ) |

| Complete GDK drawing execution prior to subsequent OpenGL calls.

void Gdk::GL::Drawable::wait_gl | ( |  | ) |

| Complete OpenGL execution prior to subsequent GDK drawing calls.

## Friends And Related Function Documentation

Glib::RefPtr< Gdk::GL::Drawable > wrap | ( | GdkGLDrawable * | object,
|  | bool | take_copy = `false`
| ) | `[related]`

  | Parameters:
  | object | The C instance
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns: A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gdkmm/gl/drawable.h