clan::GraphicContext Class Reference - ClanLib SDK
Description: clan::GraphicContext Class Reference

Public Member Functions | Friends | List of all members
clan::GraphicContext Class Reference
clanDisplay Display

Interface to drawing graphics. More...

`#include <graphic_context.h>`

## Public Member Functions
| GraphicContext ()
| Constructs a null instance.
| GraphicContext (GraphicContextProvider *provider)
| ~GraphicContext ()
void | clear (const Colorf &color=StandardColorf::black())
| Clears the whole context using the specified color.
void | clear_depth (float value=0)
void | clear_stencil (int value=0)
GraphicContext | clone () const
| Create a new default graphic context cloned with this one.
GraphicContext | create () const
| Create a new default graphic context compatible with this one.
GraphicContext | create (FrameBuffer &buffer) const
| Create a new default graphic context with a frame buffer selected.
void | dispatch (int x=1, int y=1, int z=1)
| Execute a compute shader.
void | draw_primitives (PrimitivesType type, int num_vertices, const PrimitivesArray &array)
| Draw primitives on gc.
void | draw_primitives_array (PrimitivesType type, int num_vertices)
| Draws primitives from the current assigned primitives array.
void | draw_primitives_array (PrimitivesType type, int offset, int num_vertices)
void | draw_primitives_array_instanced (PrimitivesType type, int offset, int num_vertices, int instance_count)
void | draw_primitives_elements (PrimitivesType type, int count, ElementArrayBuffer &element_array, VertexAttributeDataType indices_type, size_t offset=0)
void | draw_primitives_elements (PrimitivesType type, int count, ElementArrayVector< unsigned char > &element_array, size_t offset=0)
void | draw_primitives_elements (PrimitivesType type, int count, ElementArrayVector< unsigned int > &element_array, size_t offset=0)
void | draw_primitives_elements (PrimitivesType type, int count, ElementArrayVector< unsigned short > &element_array, size_t offset=0)
void | draw_primitives_elements (PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset=0)
void | draw_primitives_elements_instanced (PrimitivesType type, int count, ElementArrayBuffer &element_array, VertexAttributeDataType indices_type, size_t offset, int instance_count)
void | draw_primitives_elements_instanced (PrimitivesType type, int count, ElementArrayVector< unsigned char > &element_array, size_t offset, int instance_count)
void | draw_primitives_elements_instanced (PrimitivesType type, int count, ElementArrayVector< unsigned int > &element_array, size_t offset, int instance_count)
void | draw_primitives_elements_instanced (PrimitivesType type, int count, ElementArrayVector< unsigned short > &element_array, size_t offset, int instance_count)
void | draw_primitives_elements_instanced (PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset, int instance_count)
void | flush ()
| Flush the command buffer.
ClipZRange | get_clip_z_range () const
| Returns in what range clip space z values are clipped.
float | get_dip_height () const
Sizef | get_dip_size () const
float | get_dip_width () const
int | get_height () const
| Returns the current actual height of the context.
int | get_major_version () const
Size | get_max_texture_size () const
int | get_minor_version () const
float | get_pixel_ratio () const
PixelBuffer | get_pixeldata (const Rect &rect, TextureFormat texture_format=TextureFormat::rgba8, bool clamp=true)
| Return the content of the read buffer into a pixel buffer.
PixelBuffer | get_pixeldata (TextureFormat texture_format=TextureFormat::rgba8, bool clamp=true)
| Return the content of the read buffer into a pixel buffer.
ProgramObject | get_program_object () const
| Returns the currently selected program object.
GraphicContextProvider * | get_provider ()
| Returns the provider for this graphic context.
const GraphicContextProvider * | get_provider () const
FrameBuffer | get_read_frame_buffer () const
ShaderLanguage | get_shader_language () const
| Returns the shader language used.
Size | get_size () const
| Returns the current actual size of the context.
Texture | get_texture (int index) const
TextureImageYAxis | get_texture_image_y_axis () const
| Returns the Y axis direction for viewports, clipping rects, textures and render targets.
std::vector< Texture > | get_textures () const
int | get_width () const
| Returns the current actual width of the context.
FrameBuffer | get_write_frame_buffer () const
bool | has_compute_shader_support () const
bool | is_frame_buffer_owner (const FrameBuffer &fb)
bool | is_null () const
| Returns true if this object is invalid.
bool | is_primitives_array_owner (const PrimitivesArray &primitives_array)
| operator bool () const
bool | operator!= (const GraphicContext &other) const
bool | operator== (const GraphicContext &other) const
void | reset_blend_state ()
| Set active blend state.
void | reset_depth_stencil_state ()
| Set active depth stencil state.
void | reset_frame_buffer ()
| Resets the current frame buffer to be the initial frame buffer.
void | reset_image_texture (int unit_index)
void | reset_image_textures ()
| Remove all selected textures.
void | reset_primitives_array ()
| Reset the primitives arrays.
void | reset_primitives_elements ()
| Resets current elements array buffer.
void | reset_program_object ()
| Remove active program object.
void | reset_rasterizer_state ()
| Set active rasterizer state.
void | reset_scissor ()
| Removes the set clipping rectangle.
void | reset_storage_buffer (int index)
| Remove storage buffer from index.
void | reset_texture (int unit_index)
void | reset_textures ()
| Remove all selected textures.
void | reset_uniform_buffer (int index)
| Remove uniform buffer from index.
void | set_blend_state (const BlendState &state, const Colorf &blend_color=StandardColorf::white(), unsigned int sample_mask=0xffffffff)
| Set active blend state.
void | set_depth_range (float n, float f)
| Specifies the depth range for all viewports.
void | set_depth_range (int viewport, float n, float f)
| Specifies the depth range for the specified viewport.
void | set_depth_stencil_state (const DepthStencilState &state, int stencil_ref=0)
| Set active depth stencil state.
void | set_draw_buffer (DrawBuffer buffer)
| Set used draw buffer.
void | set_frame_buffer (const FrameBuffer &write_buffer)
| Sets the current frame buffer.
void | set_frame_buffer (const FrameBuffer &write_buffer, const FrameBuffer &read_buffer)
void | set_image_texture (int unit_index, const Texture &texture)
void | set_image_texture (std::vector< Texture > &textures)
void | set_primitives_array (const PrimitivesArray &array)
| Set the primitives array on the gc.
void | set_primitives_elements (ElementArrayBuffer &element_array)
| Sets current elements array buffer.
template<typename Type >
void | set_primitives_elements (ElementArrayVector< Type > &element_array)
| Sets current elements array buffer.
void | set_program_object (const ProgramObject &program)
void | set_program_object (StandardProgram standard_program)
| Set active program object to the standard program specified.
void | set_rasterizer_state (const RasterizerState &state)
| Set active rasterizer state.
void | set_scissor (const Rect &rect, TextureImageYAxis y_axis)
| Set the current clipping rectangle.
void | set_storage_buffer (int index, const StorageBuffer &buffer)
| Select storage buffer into index.
void | set_texture (int unit_index, const Texture &texture)
void | set_textures (std::vector< Texture > &textures)
void | set_uniform_buffer (int index, const UniformBuffer &buffer)
| Select uniform buffer into index.
void | set_viewport (const Rectf &viewport)
void | set_viewport (int index, const Rectf &viewport)
void | throw_if_null () const
| Throw an exception if this object is invalid.

## Friends
class | OpenGL

## Detailed Description

Interface to drawing graphics.

## Constructor & Destructor Documentation

## ◆ GraphicContext() [1/2]

clan::GraphicContext::GraphicContext | ( |  | ) |

Constructs a null instance.

## ◆ GraphicContext() [2/2]

clan::GraphicContext::GraphicContext | ( | GraphicContextProvider * | provider | ) |

Constructs a new graphic context from a provider.

Parameters

  provider | = Graphic Context Provider

## ◆ ~GraphicContext()

clan::GraphicContext::~GraphicContext | ( |  | ) |

## Member Function Documentation

## ◆ clear()

void clan::GraphicContext::clear | ( | const Colorf & | color = StandardColorf::black() | ) |

Clears the whole context using the specified color.

## ◆ clear_depth()

void clan::GraphicContext::clear_depth | ( | float | value = 0 | ) |

Clear the depth buffer

Parameters

  value | value to clear to. Range 0.0 - 1.0.

## ◆ clear_stencil()

void clan::GraphicContext::clear_stencil | ( | int | value = 0 | ) |

Clear the stencil buffer

Parameters

  value | value to clear to.

## ◆ clone()

GraphicContext clan::GraphicContext::clone | ( |  | ) | const

Create a new default graphic context cloned with this one.

## ◆ create() [1/2]

GraphicContext clan::GraphicContext::create | ( |  | ) | const

Create a new default graphic context compatible with this one.

## ◆ create() [2/2]

GraphicContext clan::GraphicContext::create | ( | FrameBuffer & | buffer | ) | const

Create a new default graphic context with a frame buffer selected.

## ◆ dispatch()

void clan::GraphicContext::dispatch | ( | int | x = 1,
|  | int | y = 1,
|  | int | z = 1 )

Execute a compute shader.

## ◆ draw_primitives()

void clan::GraphicContext::draw_primitives | ( | PrimitivesType | type,
|  | int | num_vertices,
|  | const PrimitivesArray & | array )

Draw primitives on gc.

## ◆ draw_primitives_array() [1/2]

void clan::GraphicContext::draw_primitives_array | ( | PrimitivesType | type,
|  | int | num_vertices )

Draws primitives from the current assigned primitives array.

## ◆ draw_primitives_array() [2/2]

void clan::GraphicContext::draw_primitives_array | ( | PrimitivesType | type,
|  | int | offset,
|  | int | num_vertices )

Draw primitives array

Parameters

  type | = Primitives Type
  offset | = value
  num_vertices | = value

## ◆ draw_primitives_array_instanced()

void clan::GraphicContext::draw_primitives_array_instanced | ( | PrimitivesType | type,
|  | int | offset,
|  | int | num_vertices,
|  | int | instance_count )

Draw primitives array instanced

Parameters

  type | = Primitives Type
  offset | = value
  num_vertices | = value
  instance_count | = number of instances drawn

## ◆ draw_primitives_elements() [1/5]

void clan::GraphicContext::draw_primitives_elements | ( | PrimitivesType | type,
|  | int | count,
|  | ElementArrayBuffer & | element_array,
|  | VertexAttributeDataType | indices_type,
|  | size_t | offset = 0 )

Draw primitives elements

Parameters

  type | = Primitives Type
  count | = value
  element_array | = Element Array Buffer
  indices_type | = Vertex Attribute Data Type
  offset | = void

## ◆ draw_primitives_elements() [2/5]

void clan::GraphicContext::draw_primitives_elements | ( | PrimitivesType | type,
|  | int | count,
|  | ElementArrayVector< unsigned char > & | element_array,
|  | size_t | offset = 0 )
| inline

Draw primitives elements

Parameters

  type | = Primitives Type
  count | = value
  element_array | = Element Array Buffer
  indices_type | = Vertex Attribute Data Type
  offset | = void

References draw_primitives_elements(), and clan::type_unsigned_byte.

## ◆ draw_primitives_elements() [3/5]

void clan::GraphicContext::draw_primitives_elements | ( | PrimitivesType | type,
|  | int | count,
|  | ElementArrayVector< unsigned int > & | element_array,
|  | size_t | offset = 0 )
| inline

Draw primitives elements

Parameters

  type | = Primitives Type
  count | = value
  element_array | = Element Array Buffer
  indices_type | = Vertex Attribute Data Type
  offset | = void

References draw_primitives_elements(), and clan::type_unsigned_int.

## ◆ draw_primitives_elements() [4/5]

void clan::GraphicContext::draw_primitives_elements | ( | PrimitivesType | type,
|  | int | count,
|  | ElementArrayVector< unsigned short > & | element_array,
|  | size_t | offset = 0 )
| inline

Draw primitives elements

Parameters

  type | = Primitives Type
  count | = value
  element_array | = Element Array Buffer
  indices_type | = Vertex Attribute Data Type
  offset | = void

References draw_primitives_elements(), and clan::type_unsigned_short.

## ◆ draw_primitives_elements() [5/5]

void clan::GraphicContext::draw_primitives_elements | ( | PrimitivesType | type,
|  | int | count,
|  | VertexAttributeDataType | indices_type,
|  | size_t | offset = 0 )

Draw primitives elements

Parameters

  type | = Primitives Type
  count | = value
  indices_type | = Vertex Attribute Data Type
  offset | = void

Referenced by draw_primitives_elements(), draw_primitives_elements(), and draw_primitives_elements().

## ◆ draw_primitives_elements_instanced() [1/5]

void clan::GraphicContext::draw_primitives_elements_instanced | ( | PrimitivesType | type,
|  | int | count,
|  | ElementArrayBuffer & | element_array,
|  | VertexAttributeDataType | indices_type,
|  | size_t | offset,
|  | int | instance_count )

Draw primitives elements instanced

Parameters

  type | = Primitives Type
  count | = value
  element_array | = Element Array Buffer
  indices_type | = Vertex Attribute Data Type
  offset | = void
  instance_count | = number of instances drawn

## ◆ draw_primitives_elements_instanced() [2/5]

void clan::GraphicContext::draw_primitives_elements_instanced | ( | PrimitivesType | type,
|  | int | count,
|  | ElementArrayVector< unsigned char > & | element_array,
|  | size_t | offset,
|  | int | instance_count )
| inline

Draw primitives elements instanced

Parameters

  type | = Primitives Type
  count | = value
  element_array | = Element Array Buffer
  indices_type | = Vertex Attribute Data Type
  offset | = void
  instance_count | = number of instances drawn

References draw_primitives_elements_instanced(), and clan::type_unsigned_byte.

## ◆ draw_primitives_elements_instanced() [3/5]

void clan::GraphicContext::draw_primitives_elements_instanced | ( | PrimitivesType | type,
|  | int | count,
|  | ElementArrayVector< unsigned int > & | element_array,
|  | size_t | offset,
|  | int | instance_count )
| inline

Draw primitives elements instanced

Parameters

  type | = Primitives Type
  count | = value
  element_array | = Element Array Buffer
  indices_type | = Vertex Attribute Data Type
  offset | = void
  instance_count | = number of instances drawn

References draw_primitives_elements_instanced(), and clan::type_unsigned_int.

## ◆ draw_primitives_elements_instanced() [4/5]

void clan::GraphicContext::draw_primitives_elements_instanced | ( | PrimitivesType | type,
|  | int | count,
|  | ElementArrayVector< unsigned short > & | element_array,
|  | size_t | offset,
|  | int | instance_count )
| inline

Draw primitives elements instanced

Parameters

  type | = Primitives Type
  count | = value
  element_array | = Element Array Buffer
  indices_type | = Vertex Attribute Data Type
  offset | = void
  instance_count | = number of instances drawn

References draw_primitives_elements_instanced(), and clan::type_unsigned_short.

## ◆ draw_primitives_elements_instanced() [5/5]

void clan::GraphicContext::draw_primitives_elements_instanced | ( | PrimitivesType | type,
|  | int | count,
|  | VertexAttributeDataType | indices_type,
|  | size_t | offset,
|  | int | instance_count )

Draw primitives elements instanced

Parameters

  type | = Primitives Type
  count | = value
  indices_type | = Vertex Attribute Data Type
  offset | = void
  instance_count | = number of instances drawn

Referenced by draw_primitives_elements_instanced(), draw_primitives_elements_instanced(), and draw_primitives_elements_instanced().

## ◆ flush()

void clan::GraphicContext::flush | ( |  | ) |

Flush the command buffer.

## ◆ get_clip_z_range()

ClipZRange clan::GraphicContext::get_clip_z_range | ( |  | ) | const

Returns in what range clip space z values are clipped.

## ◆ get_dip_height()

float clan::GraphicContext::get_dip_height | ( |  | ) | const
| inline

Calculates the device independent height of the context. \seealso Resolution Independence

References get_height(), and get_pixel_ratio().

Referenced by get_dip_size(), and clan::Canvas::get_height().

## ◆ get_dip_size()

Sizef clan::GraphicContext::get_dip_size | ( |  | ) | const
| inline

Calculates the device independent dimensions of the context. \seealso Resolution Independence

References get_dip_height(), and get_dip_width().

Referenced by clan::Canvas::get_size().

## ◆ get_dip_width()

float clan::GraphicContext::get_dip_width | ( |  | ) | const
| inline

Calculates the device independent width of the context. \seealso Resolution Independence

References get_pixel_ratio(), and get_width().

Referenced by get_dip_size(), and clan::Canvas::get_width().

## ◆ get_height()

int clan::GraphicContext::get_height | ( |  | ) | const

Returns the current actual height of the context.

Referenced by get_dip_height().

## ◆ get_major_version()

int clan::GraphicContext::get_major_version | ( |  | ) | const

Returns the major version / feature level supported by the hardware. For an OpenGL target, this returns the major OpenGL version the driver supports. For a Direct3D target, this returns the major feature level.

## ◆ get_max_texture_size()

Size clan::GraphicContext::get_max_texture_size | ( |  | ) | const

Retrieves the maximum size for a texture that this graphic context will allow. Size(0, 0) will be returned if there is no known limitation to the maximum texture size allowed for the context.

## ◆ get_minor_version()

int clan::GraphicContext::get_minor_version | ( |  | ) | const

Returns the minor version / feature level supported by the hardware. For an OpenGL target, this returns the minor OpenGL version the driver supports. For a Direct3D target, this returns the minor feature level.

## ◆ get_pixel_ratio()

float clan::GraphicContext::get_pixel_ratio | ( |  | ) | const

Retrieves the display pixel ratio of the context. \seealso Resolution Independence

Referenced by get_dip_height(), get_dip_width(), and clan::Canvas::get_pixel_ratio().

## ◆ get_pixeldata() [1/2]

PixelBuffer clan::GraphicContext::get_pixeldata | ( | const Rect & | rect,
|  | TextureFormat | texture_format = TextureFormat::rgba8,
|  | bool | clamp = true )

Return the content of the read buffer into a pixel buffer.

## ◆ get_pixeldata() [2/2]

PixelBuffer clan::GraphicContext::get_pixeldata | ( | TextureFormat | texture_format = TextureFormat::rgba8,
|  | bool | clamp = true )

Return the content of the read buffer into a pixel buffer.

## ◆ get_program_object()

ProgramObject clan::GraphicContext::get_program_object | ( |  | ) | const

Returns the currently selected program object.

## ◆ get_provider() [1/2]

GraphicContextProvider * clan::GraphicContext::get_provider | ( |  | ) |

Returns the provider for this graphic context.

## ◆ get_provider() [2/2]

const GraphicContextProvider * clan::GraphicContext::get_provider | ( |  | ) | const

## ◆ get_read_frame_buffer()

FrameBuffer clan::GraphicContext::get_read_frame_buffer | ( |  | ) | const

Returns the currently selected read frame buffer.

Returns
  The frame buffer. Use frame_buffer.is_null() to determine if the frame buffer was not selected

## ◆ get_shader_language()

ShaderLanguage clan::GraphicContext::get_shader_language | ( |  | ) | const

Returns the shader language used.

## ◆ get_size()

Size clan::GraphicContext::get_size | ( |  | ) | const

Returns the current actual size of the context.

## ◆ get_texture()

Texture clan::GraphicContext::get_texture | ( | int | index | ) | const

Retrieves the texture selected in this context with an index number.

Parameters

  index | The texture index number to retrieve. [0 to n]

Returns
  The texture on the specified index. Use Texture::is_null() to determine whether the texture has been selected by the context.

## ◆ get_texture_image_y_axis()

TextureImageYAxis clan::GraphicContext::get_texture_image_y_axis | ( |  | ) | const

Returns the Y axis direction for viewports, clipping rects, textures and render targets.

## ◆ get_textures()

std::vector< Texture > clan::GraphicContext::get_textures | ( |  | ) | const

Returns the textures currently selected in this context.

Returns
  A vector containing the selected textures. The vector may contain null (unselected) texture elements within it..

## ◆ get_width()

int clan::GraphicContext::get_width | ( |  | ) | const

Returns the current actual width of the context.

Referenced by get_dip_width().

## ◆ get_write_frame_buffer()

FrameBuffer clan::GraphicContext::get_write_frame_buffer | ( |  | ) | const

Returns the currently selected write frame buffer.

Returns
  The frame buffer. Use frame_buffer.is_null() to determine if the frame buffer was not selected

## ◆ has_compute_shader_support()

bool clan::GraphicContext::has_compute_shader_support | ( |  | ) | const

Returns `true` if the hardware supports compute shaders. This function will always returns true for OpenGL 4.3 or newer, or Direct3D 11.0 or newer. For Direct3D 10.0 and 10.1, the support for compute shaders is optional.

## ◆ is_frame_buffer_owner()

bool clan::GraphicContext::is_frame_buffer_owner | ( | const FrameBuffer & | fb | ) |

Returns `true` if this frame buffer object is owned by this graphic context.

Frame buffer objects cannot be shared between graphic contexts. This function will verify if the frame buffer object belongs to this graphic context.

## ◆ is_null()

bool clan::GraphicContext::is_null | ( |  | ) | const
| inline

Returns true if this object is invalid.

## ◆ is_primitives_array_owner()

bool clan::GraphicContext::is_primitives_array_owner | ( | const PrimitivesArray & | primitives_array | ) |

Returns true if this primitives array is owned by this graphic context.

Primitive array objects cannot be shared between graphic contexts. This function verifies that the primitives array belongs to this graphic context.

## ◆ operator bool()

clan::GraphicContext::operator bool | ( |  | ) | const
| inlineexplicit

## ◆ operator!=()

bool clan::GraphicContext::operator!= | ( | const GraphicContext & | other | ) | const
| inline

## ◆ operator==()

bool clan::GraphicContext::operator== | ( | const GraphicContext & | other | ) | const
| inline

## ◆ reset_blend_state()

void clan::GraphicContext::reset_blend_state | ( |  | ) |

Set active blend state.

## ◆ reset_depth_stencil_state()

void clan::GraphicContext::reset_depth_stencil_state | ( |  | ) |

Set active depth stencil state.

## ◆ reset_frame_buffer()

void clan::GraphicContext::reset_frame_buffer | ( |  | ) |

Resets the current frame buffer to be the initial frame buffer.

## ◆ reset_image_texture()

void clan::GraphicContext::reset_image_texture | ( | int | unit_index | ) |

Remove texture from index.

Parameters

  unit_index | = 0 to x, the index of the texture

## ◆ reset_image_textures()

void clan::GraphicContext::reset_image_textures | ( |  | ) |

Remove all selected textures.

## ◆ reset_primitives_array()

void clan::GraphicContext::reset_primitives_array | ( |  | ) |

Reset the primitives arrays.

## ◆ reset_primitives_elements()

void clan::GraphicContext::reset_primitives_elements | ( |  | ) |

Resets current elements array buffer.

## ◆ reset_program_object()

void clan::GraphicContext::reset_program_object | ( |  | ) |

Remove active program object.

## ◆ reset_rasterizer_state()

void clan::GraphicContext::reset_rasterizer_state | ( |  | ) |

Set active rasterizer state.

## ◆ reset_scissor()

void clan::GraphicContext::reset_scissor | ( |  | ) |

Removes the set clipping rectangle.

## ◆ reset_storage_buffer()

void clan::GraphicContext::reset_storage_buffer | ( | int | index | ) |

Remove storage buffer from index.

## ◆ reset_texture()

void clan::GraphicContext::reset_texture | ( | int | unit_index | ) |

Remove texture from index.

Parameters

  unit_index | = 0 to x, the index of the texture

## ◆ reset_textures()

void clan::GraphicContext::reset_textures | ( |  | ) |

Remove all selected textures.

## ◆ reset_uniform_buffer()

void clan::GraphicContext::reset_uniform_buffer | ( | int | index | ) |

Remove uniform buffer from index.

## ◆ set_blend_state()

void clan::GraphicContext::set_blend_state | ( | const BlendState & | state,
|  | const Colorf & | blend_color = StandardColorf::white(),
|  | unsigned int | sample_mask = 0xffffffff )

Set active blend state.

## ◆ set_depth_range() [1/2]

void clan::GraphicContext::set_depth_range | ( | float | n,
|  | float | f )

Specifies the depth range for all viewports.

## ◆ set_depth_range() [2/2]

void clan::GraphicContext::set_depth_range | ( | int | viewport,
|  | float | n,
|  | float | f )

Specifies the depth range for the specified viewport.

## ◆ set_depth_stencil_state()

void clan::GraphicContext::set_depth_stencil_state | ( | const DepthStencilState & | state,
|  | int | stencil_ref = 0 )

Set active depth stencil state.

## ◆ set_draw_buffer()

void clan::GraphicContext::set_draw_buffer | ( | DrawBuffer | buffer | ) |

Set used draw buffer.

## ◆ set_frame_buffer() [1/2]

void clan::GraphicContext::set_frame_buffer | ( | const FrameBuffer & | write_buffer | ) |

Sets the current frame buffer.

## ◆ set_frame_buffer() [2/2]

void clan::GraphicContext::set_frame_buffer | ( | const FrameBuffer & | write_buffer,
|  | const FrameBuffer & | read_buffer )

## ◆ set_image_texture() [1/2]

void clan::GraphicContext::set_image_texture | ( | int | unit_index,
|  | const Texture & | texture )

Select texture image into index.

Parameters

  unit_index | = 0 to x, the index of this texture
  texture | = The texture to select. This can be an empty texture Texture()

## ◆ set_image_texture() [2/2]

void clan::GraphicContext::set_image_texture | ( | std::vector< Texture > & | textures | ) |

Select texture images

Only textures units from 0 to textures.size()-1 are set.

Parameters

  textures | = The texture to select (placed at unit_index 0 to texture.size()-1). These may contain null textures

## ◆ set_primitives_array()

void clan::GraphicContext::set_primitives_array | ( | const PrimitivesArray & | array | ) |

Set the primitives array on the gc.

## ◆ set_primitives_elements() [1/2]

void clan::GraphicContext::set_primitives_elements | ( | ElementArrayBuffer & | element_array | ) |

Sets current elements array buffer.

Referenced by set_primitives_elements().

## ◆ set_primitives_elements() [2/2]

template<typename Type >

void clan::GraphicContext::set_primitives_elements | ( | ElementArrayVector< Type > & | element_array | ) |
| inline

Sets current elements array buffer.

References set_primitives_elements().

## ◆ set_program_object() [1/2]

void clan::GraphicContext::set_program_object | ( | const ProgramObject & | program | ) |

Set active program object.

Parameters

  program | = Program to set

## ◆ set_program_object() [2/2]

void clan::GraphicContext::set_program_object | ( | StandardProgram | standard_program | ) |

Set active program object to the standard program specified.

## ◆ set_rasterizer_state()

void clan::GraphicContext::set_rasterizer_state | ( | const RasterizerState & | state | ) |

Set active rasterizer state.

## ◆ set_scissor()

void clan::GraphicContext::set_scissor | ( | const Rect & | rect,
|  | TextureImageYAxis | y_axis )

Set the current clipping rectangle.

## ◆ set_storage_buffer()

void clan::GraphicContext::set_storage_buffer | ( | int | index,
|  | const StorageBuffer & | buffer )

Select storage buffer into index.

## ◆ set_texture()

void clan::GraphicContext::set_texture | ( | int | unit_index,
|  | const Texture & | texture )

Select texture into index.

Parameters

  unit_index | = 0 to x, the index of this texture
  texture | = The texture to select. This can be an empty texture Texture()

## ◆ set_textures()

void clan::GraphicContext::set_textures | ( | std::vector< Texture > & | textures | ) |

Select textures

Only textures units from 0 to textures.size()-1 are set.

Parameters

  textures | = The texture to select (placed at unit_index 0 to texture.size()-1). These may contain null textures

## ◆ set_uniform_buffer()

void clan::GraphicContext::set_uniform_buffer | ( | int | index,
|  | const UniformBuffer & | buffer )

Select uniform buffer into index.

## ◆ set_viewport() [1/2]

void clan::GraphicContext::set_viewport | ( | const Rectf & | viewport | ) |

Set the viewport to be used in user projection map mode.

Parameters

  viewport | = The viewport to set

## ◆ set_viewport() [2/2]

void clan::GraphicContext::set_viewport | ( | int | index,
|  | const Rectf & | viewport )

Set the specified viewport to be used in user projection map mode.

Parameters

  index | = The viewport index (0 to x)
  viewport | = The viewport to set

## ◆ throw_if_null()

void clan::GraphicContext::throw_if_null | ( |  | ) | const

Throw an exception if this object is invalid.

## Friends And Related Symbol Documentation

## ◆ OpenGL

friend class OpenGL
| friend

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

- graphic_context.h