clan::GraphicContextProvider Class Referenceabstract

Interface for implementing a GraphicContext target. More...

#include <graphic_context_provider.h>

Public Member Functions

virtual ~GraphicContextProvider ()
 
virtual
ElementArrayBufferProvider
alloc_element_array_buffer ()=0
 Allocate element array buffer provider for this gc. More...
 
virtual FrameBufferProvideralloc_frame_buffer ()=0
 Allocate frame buffer provider for this gc. More...
 
virtual OcclusionQueryProvideralloc_occlusion_query ()=0
 Allocate occlusion query provider of this gc. More...
 
virtual PixelBufferProvideralloc_pixel_buffer ()=0
 Allocate pixel buffer provider for this gc. More...
 
virtual PrimitivesArrayProvideralloc_primitives_array ()=0
 Allocate primitives array provider for this gc. More...
 
virtual ProgramObjectProvideralloc_program_object ()=0
 Allocate program object provider of this gc. More...
 
virtual RenderBufferProvideralloc_render_buffer ()=0
 Allocate render buffer provider for this gc. More...
 
virtual ShaderObjectProvideralloc_shader_object ()=0
 Allocate shader object provider of this gc. More...
 
virtual StorageBufferProvideralloc_storage_buffer ()=0
 Allocate storage buffer provider for this gc. More...
 
virtual TextureProvideralloc_texture (TextureDimensions texture_dimensions)=0
 Allocate texture provider for this gc. More...
 
virtual TransferBufferProvideralloc_transfer_buffer ()=0
 Allocate transfer buffer provider for this gc. More...
 
virtual UniformBufferProvideralloc_uniform_buffer ()=0
 Allocate uniform buffer provider for this gc. More...
 
virtual VertexArrayBufferProvideralloc_vertex_array_buffer ()=0
 Allocate vertex array buffer provider for this gc. More...
 
virtual void clear (const Colorf &color)=0
 Clears the whole context using the specified color. More...
 
virtual void clear_depth (float value)=0
 Clear the depth buffer. More...
 
virtual void clear_stencil (int value)=0
 Clear the stencil buffer. More...
 
virtual std::shared_ptr
< BlendStateProvider
create_blend_state (const BlendStateDescription &desc)=0
 Retrieve blend state object. More...
 
virtual std::shared_ptr
< DepthStencilStateProvider
create_depth_stencil_state (const DepthStencilStateDescription &desc)=0
 Retrieve depth-stencil state object. More...
 
virtual std::shared_ptr
< RasterizerStateProvider
create_rasterizer_state (const RasterizerStateDescription &desc)=0
 Retrieve rasterizer state object. More...
 
virtual void dispatch (int x, int y, int z)=0
 Execute a compute shader. More...
 
virtual void draw_primitives (PrimitivesType type, int num_vertices, const PrimitivesArray &primitives_array)=0
 Draw primitives on gc. More...
 
virtual void draw_primitives_array (PrimitivesType type, int offset, int num_vertices)=0
 Draws primitives from the current assigned primitives array. More...
 
virtual void draw_primitives_array_instanced (PrimitivesType type, int offset, int num_vertices, int instance_count)=0
 Draws instanced primitives from the current assigned primitives array. More...
 
virtual void draw_primitives_elements (PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset=0)=0
 Draw primitives elements. More...
 
virtual void draw_primitives_elements (PrimitivesType type, int count, ElementArrayBufferProvider *array_provider, VertexAttributeDataType indices_type, void *offset)=0
 Draw primitives elements. More...
 
virtual void draw_primitives_elements_instanced (PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset, int instance_count)=0
 Draw primitives elements instanced. More...
 
virtual void draw_primitives_elements_instanced (PrimitivesType type, int count, ElementArrayBufferProvider *array_provider, VertexAttributeDataType indices_type, void *offset, int instance_count)=0
 Draw primitives elements instanced. More...
 
virtual void flush ()=0
 
virtual ClipZRange get_clip_z_range () const =0
 Returns in what range clip space z values are clipped. More...
 
virtual Size get_display_window_size () const =0
 Returns the current size of the display window. More...
 
virtual int get_major_version () const =0
 Returns the major version / feature level supported by the hardware. More...
 
virtual int get_max_attributes ()=0
 Returns the maximum amount of attributes available. More...
 
virtual Size get_max_texture_size () const =0
 Returns the maximum size of a texture this graphic context supports. More...
 
virtual int get_minor_version () const =0
 Returns the major version / feature level supported by the hardware. More...
 
virtual float get_pixel_ratio () const =0
 Physical pixels/dots per inch. More...
 
virtual PixelBuffer get_pixeldata (const Rect &rect, TextureFormat texture_format, bool clamp) const =0
 Return the content of the draw buffer into a pixel buffer. More...
 
virtual ProgramObject get_program_object (StandardProgram standard_program) const =0
 Get a program object from the standard program specified. More...
 
virtual ShaderLanguage get_shader_language () const =0
 Returns the shader language used. More...
 
virtual TextureImageYAxis get_texture_image_y_axis () const =0
 Returns the Y axis direction for viewports, clipping rects, textures and render targets. More...
 
virtual bool has_compute_shader_support () const =0
 Returns true if the hardware supports compute shaders. More...
 
virtual bool is_frame_buffer_owner (const FrameBuffer &fb)=0
 Returns true if this frame buffer object is owned by this graphic context. More...
 
virtual bool is_primitives_array_owner (const PrimitivesArray &primitives_array)=0
 Returns true if this primitives_array is owned by this graphic context. More...
 
virtual void reset_frame_buffer ()=0
 Set the rendering buffer back to the screen. More...
 
virtual void reset_image_texture (int unit_index)=0
 Remove texture from image unit. More...
 
virtual void reset_primitives_array ()=0
 Reset the primitives arrays. More...
 
virtual void reset_primitives_elements ()=0
 Resets current elements array buffer. More...
 
virtual void reset_program_object ()=0
 Remove active program object. More...
 
virtual void reset_scissor ()=0
 Reset scissor. More...
 
virtual void reset_storage_buffer (int index)=0
 Remove storage buffer from index. More...
 
virtual void reset_texture (int unit_index)=0
 Remove texture from unit. More...
 
virtual void reset_uniform_buffer (int index)=0
 Remove uniform buffer from index. More...
 
virtual void set_blend_state (BlendStateProvider *state, const Colorf &blend_color, unsigned int sample_mask)=0
 Set active blend state. More...
 
virtual void set_depth_range (float n, float f)=0
 Specifies the depth range for all viewports. More...
 
virtual void set_depth_range (int viewport, float n, float f)=0
 Specifies the depth range for the specified viewport. More...
 
virtual void set_depth_stencil_state (DepthStencilStateProvider *state, int stencil_ref)=0
 Set active depth stencil state. More...
 
virtual void set_draw_buffer (DrawBuffer buffer)=0
 
virtual void set_frame_buffer (const FrameBuffer &write_buffer, const FrameBuffer &read_buffer)=0
 Set a frame buffer for off-screen rendering. More...
 
virtual void set_image_texture (int unit_index, const Texture &texture)=0
 Select texture into image unit. More...
 
virtual void set_primitives_array (const PrimitivesArray &primitives_array)=0
 Set the primitives array on the gc. More...
 
virtual void set_primitives_elements (ElementArrayBufferProvider *array_provider)=0
 Sets current elements array buffer. More...
 
virtual void set_program_object (StandardProgram standard_program)=0
 Set active program object to the standard program specified. More...
 
virtual void set_program_object (const ProgramObject &program)=0
 Set active program object. More...
 
virtual void set_rasterizer_state (RasterizerStateProvider *state)=0
 Set active rasterizer state. More...
 
virtual void set_scissor (const Rect &rect)=0
 Set scissor. More...
 
virtual void set_storage_buffer (int index, const StorageBuffer &buffer)=0
 Select storage buffer into index. More...
 
virtual void set_texture (int unit_index, const Texture &texture)=0
 Select texture into unit. More...
 
virtual void set_uniform_buffer (int index, const UniformBuffer &buffer)=0
 Select uniform buffer into index. More...
 
virtual void set_viewport (const Rectf &viewport)=0
 Set the viewport to be used in user projection map mode. More...
 
virtual void set_viewport (int index, const Rectf &viewport)=0
 Set the specified viewport to be used in user projection map mode. More...
 
virtual Signal< void(const
Size &)> & 
sig_window_resized ()=0
 Get the window resized signal. More...
 

Detailed Description

Interface for implementing a GraphicContext target.

Constructor & Destructor Documentation

virtual clan::GraphicContextProvider::~GraphicContextProvider ( )
inlinevirtual

Member Function Documentation

virtual ElementArrayBufferProvider* clan::GraphicContextProvider::alloc_element_array_buffer ( )
pure virtual

Allocate element array buffer provider for this gc.

virtual FrameBufferProvider* clan::GraphicContextProvider::alloc_frame_buffer ( )
pure virtual

Allocate frame buffer provider for this gc.

virtual OcclusionQueryProvider* clan::GraphicContextProvider::alloc_occlusion_query ( )
pure virtual

Allocate occlusion query provider of this gc.

virtual PixelBufferProvider* clan::GraphicContextProvider::alloc_pixel_buffer ( )
pure virtual

Allocate pixel buffer provider for this gc.

virtual PrimitivesArrayProvider* clan::GraphicContextProvider::alloc_primitives_array ( )
pure virtual

Allocate primitives array provider for this gc.

virtual ProgramObjectProvider* clan::GraphicContextProvider::alloc_program_object ( )
pure virtual

Allocate program object provider of this gc.

virtual RenderBufferProvider* clan::GraphicContextProvider::alloc_render_buffer ( )
pure virtual

Allocate render buffer provider for this gc.

virtual ShaderObjectProvider* clan::GraphicContextProvider::alloc_shader_object ( )
pure virtual

Allocate shader object provider of this gc.

virtual StorageBufferProvider* clan::GraphicContextProvider::alloc_storage_buffer ( )
pure virtual

Allocate storage buffer provider for this gc.

virtual TextureProvider* clan::GraphicContextProvider::alloc_texture ( TextureDimensions  texture_dimensions)
pure virtual

Allocate texture provider for this gc.

virtual TransferBufferProvider* clan::GraphicContextProvider::alloc_transfer_buffer ( )
pure virtual

Allocate transfer buffer provider for this gc.

virtual UniformBufferProvider* clan::GraphicContextProvider::alloc_uniform_buffer ( )
pure virtual

Allocate uniform buffer provider for this gc.

virtual VertexArrayBufferProvider* clan::GraphicContextProvider::alloc_vertex_array_buffer ( )
pure virtual

Allocate vertex array buffer provider for this gc.

virtual void clan::GraphicContextProvider::clear ( const Colorf color)
pure virtual

Clears the whole context using the specified color.

virtual void clan::GraphicContextProvider::clear_depth ( float  value)
pure virtual

Clear the depth buffer.

Parameters
valuevalue to clear to. Range 0.0 - 1.0.
virtual void clan::GraphicContextProvider::clear_stencil ( int  value)
pure virtual

Clear the stencil buffer.

Parameters
valuevalue to clear to.
virtual std::shared_ptr<BlendStateProvider> clan::GraphicContextProvider::create_blend_state ( const BlendStateDescription desc)
pure virtual

Retrieve blend state object.

virtual std::shared_ptr<DepthStencilStateProvider> clan::GraphicContextProvider::create_depth_stencil_state ( const DepthStencilStateDescription desc)
pure virtual

Retrieve depth-stencil state object.

virtual std::shared_ptr<RasterizerStateProvider> clan::GraphicContextProvider::create_rasterizer_state ( const RasterizerStateDescription desc)
pure virtual

Retrieve rasterizer state object.

virtual void clan::GraphicContextProvider::dispatch ( int  x,
int  y,
int  z 
)
pure virtual

Execute a compute shader.

virtual void clan::GraphicContextProvider::draw_primitives ( PrimitivesType  type,
int  num_vertices,
const PrimitivesArray primitives_array 
)
pure virtual

Draw primitives on gc.

virtual void clan::GraphicContextProvider::draw_primitives_array ( PrimitivesType  type,
int  offset,
int  num_vertices 
)
pure virtual

Draws primitives from the current assigned primitives array.

virtual void clan::GraphicContextProvider::draw_primitives_array_instanced ( PrimitivesType  type,
int  offset,
int  num_vertices,
int  instance_count 
)
pure virtual

Draws instanced primitives from the current assigned primitives array.

virtual void clan::GraphicContextProvider::draw_primitives_elements ( PrimitivesType  type,
int  count,
VertexAttributeDataType  indices_type,
size_t  offset = 0 
)
pure virtual

Draw primitives elements.

Parameters
type= Primitives Type
count= value
indices_type= Vertex Attribute Data Type
offset= void
virtual void clan::GraphicContextProvider::draw_primitives_elements ( PrimitivesType  type,
int  count,
ElementArrayBufferProvider array_provider,
VertexAttributeDataType  indices_type,
void *  offset 
)
pure virtual

Draw primitives elements.

Parameters
type= Primitives Type
count= value
array_provider= Element Array Buffer Provider
indices_type= Vertex Attribute Data Type
offset= void
virtual void clan::GraphicContextProvider::draw_primitives_elements_instanced ( PrimitivesType  type,
int  count,
VertexAttributeDataType  indices_type,
size_t  offset,
int  instance_count 
)
pure virtual

Draw primitives elements instanced.

Parameters
type= Primitives Type
count= value
indices_type= Vertex Attribute Data Type
offset= void
instance_count= number of instances drawn
virtual void clan::GraphicContextProvider::draw_primitives_elements_instanced ( PrimitivesType  type,
int  count,
ElementArrayBufferProvider array_provider,
VertexAttributeDataType  indices_type,
void *  offset,
int  instance_count 
)
pure virtual

Draw primitives elements instanced.

Parameters
type= Primitives Type
count= value
array_provider= Element Array Buffer Provider
indices_type= Vertex Attribute Data Type
offset= void
virtual void clan::GraphicContextProvider::flush ( )
pure virtual
virtual ClipZRange clan::GraphicContextProvider::get_clip_z_range ( ) const
pure virtual

Returns in what range clip space z values are clipped.

virtual Size clan::GraphicContextProvider::get_display_window_size ( ) const
pure virtual

Returns the current size of the display window.

virtual int clan::GraphicContextProvider::get_major_version ( ) const
pure virtual

Returns the major version / feature level supported by the hardware.

For the OpenGL target, this returns the major OpenGL version the driver supports. For the Direct3D target, this returns the major feature level.

virtual int clan::GraphicContextProvider::get_max_attributes ( )
pure virtual

Returns the maximum amount of attributes available.

virtual Size clan::GraphicContextProvider::get_max_texture_size ( ) const
pure virtual

Returns the maximum size of a texture this graphic context supports.

It returns Size(0,0) if there is no known limitation to the max texture size.

virtual int clan::GraphicContextProvider::get_minor_version ( ) const
pure virtual

Returns the major version / feature level supported by the hardware.

For the OpenGL target, this returns the minor OpenGL version the driver supports. For the Direct3D target, this returns the minor feature level.

virtual float clan::GraphicContextProvider::get_pixel_ratio ( ) const
pure virtual

Physical pixels/dots per inch.

virtual PixelBuffer clan::GraphicContextProvider::get_pixeldata ( const Rect rect,
TextureFormat  texture_format,
bool  clamp 
) const
pure virtual

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

virtual ProgramObject clan::GraphicContextProvider::get_program_object ( StandardProgram  standard_program) const
pure virtual

Get a program object from the standard program specified.

virtual ShaderLanguage clan::GraphicContextProvider::get_shader_language ( ) const
pure virtual

Returns the shader language used.

virtual TextureImageYAxis clan::GraphicContextProvider::get_texture_image_y_axis ( ) const
pure virtual

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

virtual bool clan::GraphicContextProvider::has_compute_shader_support ( ) const
pure virtual

Returns true if the hardware supports compute shaders.

This 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.

virtual bool clan::GraphicContextProvider::is_frame_buffer_owner ( const FrameBuffer fb)
pure virtual

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

virtual bool clan::GraphicContextProvider::is_primitives_array_owner ( const PrimitivesArray primitives_array)
pure virtual

Returns true if this primitives_array is owned by this graphic context.

virtual void clan::GraphicContextProvider::reset_frame_buffer ( )
pure virtual

Set the rendering buffer back to the screen.

virtual void clan::GraphicContextProvider::reset_image_texture ( int  unit_index)
pure virtual

Remove texture from image unit.

virtual void clan::GraphicContextProvider::reset_primitives_array ( )
pure virtual

Reset the primitives arrays.

virtual void clan::GraphicContextProvider::reset_primitives_elements ( )
pure virtual

Resets current elements array buffer.

virtual void clan::GraphicContextProvider::reset_program_object ( )
pure virtual

Remove active program object.

virtual void clan::GraphicContextProvider::reset_scissor ( )
pure virtual

Reset scissor.

virtual void clan::GraphicContextProvider::reset_storage_buffer ( int  index)
pure virtual

Remove storage buffer from index.

virtual void clan::GraphicContextProvider::reset_texture ( int  unit_index)
pure virtual

Remove texture from unit.

virtual void clan::GraphicContextProvider::reset_uniform_buffer ( int  index)
pure virtual

Remove uniform buffer from index.

virtual void clan::GraphicContextProvider::set_blend_state ( BlendStateProvider state,
const Colorf blend_color,
unsigned int  sample_mask 
)
pure virtual

Set active blend state.

virtual void clan::GraphicContextProvider::set_depth_range ( float  n,
float  f 
)
pure virtual

Specifies the depth range for all viewports.

virtual void clan::GraphicContextProvider::set_depth_range ( int  viewport,
float  n,
float  f 
)
pure virtual

Specifies the depth range for the specified viewport.

virtual void clan::GraphicContextProvider::set_depth_stencil_state ( DepthStencilStateProvider state,
int  stencil_ref 
)
pure virtual

Set active depth stencil state.

virtual void clan::GraphicContextProvider::set_draw_buffer ( DrawBuffer  buffer)
pure virtual
virtual void clan::GraphicContextProvider::set_frame_buffer ( const FrameBuffer write_buffer,
const FrameBuffer read_buffer 
)
pure virtual

Set a frame buffer for off-screen rendering.

virtual void clan::GraphicContextProvider::set_image_texture ( int  unit_index,
const Texture texture 
)
pure virtual

Select texture into image unit.

virtual void clan::GraphicContextProvider::set_primitives_array ( const PrimitivesArray primitives_array)
pure virtual

Set the primitives array on the gc.

virtual void clan::GraphicContextProvider::set_primitives_elements ( ElementArrayBufferProvider array_provider)
pure virtual

Sets current elements array buffer.

virtual void clan::GraphicContextProvider::set_program_object ( StandardProgram  standard_program)
pure virtual

Set active program object to the standard program specified.

virtual void clan::GraphicContextProvider::set_program_object ( const ProgramObject program)
pure virtual

Set active program object.

Parameters
program= Program to set
virtual void clan::GraphicContextProvider::set_rasterizer_state ( RasterizerStateProvider state)
pure virtual

Set active rasterizer state.

virtual void clan::GraphicContextProvider::set_scissor ( const Rect rect)
pure virtual

Set scissor.

virtual void clan::GraphicContextProvider::set_storage_buffer ( int  index,
const StorageBuffer buffer 
)
pure virtual

Select storage buffer into index.

virtual void clan::GraphicContextProvider::set_texture ( int  unit_index,
const Texture texture 
)
pure virtual

Select texture into unit.

virtual void clan::GraphicContextProvider::set_uniform_buffer ( int  index,
const UniformBuffer buffer 
)
pure virtual

Select uniform buffer into index.

virtual void clan::GraphicContextProvider::set_viewport ( const Rectf viewport)
pure virtual

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

virtual void clan::GraphicContextProvider::set_viewport ( int  index,
const Rectf viewport 
)
pure virtual

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

virtual Signal<void(const Size &)>& clan::GraphicContextProvider::sig_window_resized ( )
pure virtual

Get the window resized signal.


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