clan::GraphicContext Class Reference

Interface to drawing graphics. More...

#include <graphic_context.h>

+ Inheritance diagram for clan::GraphicContext:

Public Member Functions

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

Implementation

class OpenGL
 

Detailed Description

Interface to drawing graphics.


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