34 #include "../Render/graphic_context.h"
35 #include "../Render/primitives_array.h"
36 #include "../Render/texture.h"
37 #include "../../Core/Math/mat4.h"
38 #include "../../Core/Signals/signal.h"
47 class TextureProvider;
50 class OcclusionQueryProvider;
51 class ProgramObjectProvider;
52 class ShaderObjectProvider;
53 class FrameBufferProvider;
54 class RenderBufferProvider;
55 class VertexArrayBufferProvider;
56 class ElementArrayBufferProvider;
57 class TransferBufferProvider;
58 class FontDescription;
59 class PixelBufferProvider;
60 class UniformBufferProvider;
61 class StorageBufferProvider;
62 class PrimitivesArrayProvider;
63 class RasterizerStateDescription;
64 class BlendStateDescription;
65 class DepthStencilStateDescription;
DepthStencil state description.
Definition: depth_stencil_state_description.h:43
C clamp(A val, B minval, C maxval)
Definition: cl_math.h:98
Interface for implementing a RenderBuffer target.
Definition: render_buffer_provider.h:44
virtual void set_uniform_buffer(int index, const UniformBuffer &buffer)=0
Select uniform buffer into index.
ClipZRange
Definition: mat4.h:52
Storage Buffer provider.
Definition: storage_buffer_provider.h:41
virtual ClipZRange get_clip_z_range() const =0
Returns in what range clip space z values are clipped.
virtual void reset_image_texture(int unit_index)=0
Remove texture from image unit.
virtual void set_primitives_elements(ElementArrayBufferProvider *array_provider)=0
Sets current elements array buffer.
Texture object class.
Definition: texture.h:104
virtual ~RasterizerStateProvider()
Definition: graphic_context_provider.h:70
TextureDimensions
Texture dimensions.
Definition: texture.h:92
virtual bool is_frame_buffer_owner(const FrameBuffer &fb)=0
Returns true if this frame buffer object is owned by this graphic context.
Element Array Buffer provider.
Definition: pixel_buffer_provider.h:43
2D (left,top,right,bottom) rectangle structure - Integer
Definition: rect.h:471
virtual float get_pixel_ratio() const =0
Physical pixels/dots per inch.
virtual void set_depth_stencil_state(DepthStencilStateProvider *state, int stencil_ref)=0
Set active depth stencil state.
DrawBuffer
Drawing buffers.
Definition: graphic_context.h:119
virtual void draw_primitives(PrimitivesType type, int num_vertices, const PrimitivesArray &primitives_array)=0
Draw primitives on gc.
virtual ShaderLanguage get_shader_language() const =0
Returns the shader language used.
virtual void set_texture(int unit_index, const Texture &texture)=0
Select texture into unit.
virtual void draw_primitives_elements(PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset=0)=0
Draw primitives elements.
ShaderLanguage
Shader language used.
Definition: graphic_context.h:249
Rasterizer state description.
Definition: rasterizer_state_description.h:43
virtual void draw_primitives_array(PrimitivesType type, int offset, int num_vertices)=0
Draws primitives from the current assigned primitives array.
virtual void reset_storage_buffer(int index)=0
Remove storage buffer from index.
virtual ~BlendStateProvider()
Definition: graphic_context_provider.h:76
virtual void set_viewport(const Rectf &viewport)=0
Set the viewport to be used in user projection map mode.
virtual void set_depth_range(float n, float f)=0
Specifies the depth range for all viewports.
Blend state description.
Definition: blend_state_description.h:43
virtual void reset_scissor()=0
Reset scissor.
2D (left,top,right,bottom) rectangle structure - Float
Definition: rect.h:485
Primitives array description.
Definition: primitives_array.h:69
virtual void clear(const Colorf &color)=0
Clears the whole context using the specified color.
virtual Size get_display_window_size() const =0
Returns the current size of the display window.
Floating point color description class (for float).
Definition: color.h:661
virtual void dispatch(int x, int y, int z)=0
Execute a compute shader.
virtual int get_major_version() const =0
Returns the major version / feature level supported by the hardware.
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.
Definition: graphic_context_provider.h:74
virtual TextureProvider * alloc_texture(TextureDimensions texture_dimensions)=0
Allocate texture provider for this gc.
virtual void set_blend_state(BlendStateProvider *state, const Colorf &blend_color, unsigned int sample_mask)=0
Set active blend state.
Transfer Buffer provider.
Definition: transfer_buffer_provider.h:43
virtual RenderBufferProvider * alloc_render_buffer()=0
Allocate render buffer provider for this gc.
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.
Definition: graphic_context_provider.h:68
Definition: graphic_context_provider.h:80
virtual VertexArrayBufferProvider * alloc_vertex_array_buffer()=0
Allocate vertex array buffer provider for this gc.
virtual void set_program_object(StandardProgram standard_program)=0
Set active program object to the standard program specified.
Program Object provider.
Definition: program_object_provider.h:44
virtual void draw_primitives_elements_instanced(PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset, int instance_count)=0
Draw primitives elements instanced.
virtual void set_depth_range(int viewport, float n, float f)=0
Specifies the depth range for the specified viewport.
StandardProgram
Standard Program.
Definition: graphic_context.h:240
virtual void draw_primitives_elements(PrimitivesType type, int count, ElementArrayBufferProvider *array_provider, VertexAttributeDataType indices_type, void *offset)=0
Draw primitives elements.
virtual void set_primitives_array(const PrimitivesArray &primitives_array)=0
Set the primitives array on the gc.
Interface for implementing a Texture target.
Definition: texture_provider.h:51
Vertex Array Buffer provider.
Definition: vertex_array_buffer_provider.h:43
TextureImageYAxis
Y axis direction for viewports, clipping rects, textures and render targets.
Definition: graphic_context.h:233
virtual bool has_compute_shader_support() const =0
Returns true if the hardware supports compute shaders.
virtual PrimitivesArrayProvider * alloc_primitives_array()=0
Allocate primitives array provider for this gc.
virtual std::shared_ptr< DepthStencilStateProvider > create_depth_stencil_state(const DepthStencilStateDescription &desc)=0
Retrieve depth-stencil state object.
virtual FrameBufferProvider * alloc_frame_buffer()=0
Allocate frame buffer provider for this gc.
virtual TransferBufferProvider * alloc_transfer_buffer()=0
Allocate transfer buffer provider for this gc.
Interface for implementing a PrimitivesArray target.
Definition: primitives_array_provider.h:41
TextureFormat
Texture format.
Definition: texture_format.h:41
virtual void reset_primitives_array()=0
Reset the primitives arrays.
virtual void reset_primitives_elements()=0
Resets current elements array buffer.
virtual void set_scissor(const Rect &rect)=0
Set scissor.
Interface for implementing a FrameBuffer target.
Definition: frame_buffer_provider.h:46
virtual int get_max_attributes()=0
Returns the maximum amount of attributes available.
virtual PixelBufferProvider * alloc_pixel_buffer()=0
Allocate pixel buffer provider for this gc.
virtual std::shared_ptr< RasterizerStateProvider > create_rasterizer_state(const RasterizerStateDescription &desc)=0
Retrieve rasterizer state object.
virtual TextureImageYAxis get_texture_image_y_axis() const =0
Returns the Y axis direction for viewports, clipping rects, textures and render targets.
virtual Size get_max_texture_size() const =0
Returns the maximum size of a texture this graphic context supports.
virtual int get_minor_version() const =0
Returns the major version / feature level supported by the hardware.
virtual void set_storage_buffer(int index, const StorageBuffer &buffer)=0
Select storage buffer into index.
Frame-buffer object class.
Definition: frame_buffer.h:73
virtual ~GraphicContextProvider()
Definition: graphic_context_provider.h:92
virtual void clear_stencil(int value)=0
Clear the stencil buffer.
Occlusion query provider.
Definition: occlusion_query_provider.h:41
Pixel data container.
Definition: pixel_buffer.h:69
virtual void set_viewport(int index, const Rectf &viewport)=0
Set the specified viewport to be used in user projection map mode.
VertexAttributeDataType
Primitives array description.
Definition: primitives_array.h:57
virtual void reset_texture(int unit_index)=0
Remove texture from unit.
virtual OcclusionQueryProvider * alloc_occlusion_query()=0
Allocate occlusion query provider of this gc.
virtual void set_frame_buffer(const FrameBuffer &write_buffer, const FrameBuffer &read_buffer)=0
Set a frame buffer for off-screen rendering.
virtual ElementArrayBufferProvider * alloc_element_array_buffer()=0
Allocate element array buffer provider for this gc.
Element Array Buffer provider.
Definition: element_array_buffer_provider.h:41
virtual ShaderObjectProvider * alloc_shader_object()=0
Allocate shader object provider of this gc.
Interface for implementing a GraphicContext target.
Definition: graphic_context_provider.h:87
virtual bool is_primitives_array_owner(const PrimitivesArray &primitives_array)=0
Returns true if this primitives_array is owned by this graphic context.
virtual void reset_frame_buffer()=0
Set the rendering buffer back to the screen.
Storage Buffer.
Definition: storage_buffer.h:48
virtual void set_program_object(const ProgramObject &program)=0
Set active program object.
virtual StorageBufferProvider * alloc_storage_buffer()=0
Allocate storage buffer provider for this gc.
virtual Signal< void(const Size &)> & sig_window_resized()=0
Get the window resized signal.
virtual ProgramObject get_program_object(StandardProgram standard_program) const =0
Get a program object from the standard program specified.
2D (width,height) size structure - Integer
Definition: size.h:157
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.
Program Object.
Definition: program_object.h:70
virtual ProgramObjectProvider * alloc_program_object()=0
Allocate program object provider of this gc.
virtual void reset_uniform_buffer(int index)=0
Remove uniform buffer from index.
virtual std::shared_ptr< BlendStateProvider > create_blend_state(const BlendStateDescription &desc)=0
Retrieve blend state object.
virtual void reset_program_object()=0
Remove active program object.
PrimitivesType
Primitive types.
Definition: graphic_context.h:221
Shader Object provider.
Definition: shader_object_provider.h:43
virtual void set_image_texture(int unit_index, const Texture &texture)=0
Select texture into image unit.
virtual void set_draw_buffer(DrawBuffer buffer)=0
virtual ~DepthStencilStateProvider()
Definition: graphic_context_provider.h:82
virtual void clear_depth(float value)=0
Clear the depth buffer.
virtual void set_rasterizer_state(RasterizerStateProvider *state)=0
Set active rasterizer state.
virtual UniformBufferProvider * alloc_uniform_buffer()=0
Allocate uniform buffer provider for this gc.