graphic_context.h Source File - ClanLib SDK
Description: graphic_context.h Source File

graphic_context.h
1/*
2** ClanLib SDK
3** Copyright (c) 1997-2020 The ClanLib Team
4**
5** This software is provided 'as-is', without any express or implied
6** warranty. In no event will the authors be held liable for any damages
7** arising from the use of this software.
8**
9** Permission is granted to anyone to use this software for any purpose,
10** including commercial applications, and to alter it and redistribute it
11** freely, subject to the following restrictions:
12**
13** 1. The origin of this software must not be misrepresented; you must not
14** claim that you wrote the original software. If you use this software
15** in a product, an acknowledgment in the product documentation would be
16** appreciated but is not required.
17** 2. Altered source versions must be plainly marked as such, and must not be
18** misrepresented as being the original software.
19** 3. This notice may not be removed or altered from any source distribution.
20**
21** Note: Some of the libraries ClanLib may link to may have additional
22** requirements or restrictions.
23**
24** File Author(s):
25**
26** Magnus Norddahl
27** Harry Storbacka
28** Kenneth Gangstoe
29*/
30
31#pragma once
32
33#include "../2D/color.h"
34#include "../Image/texture_format.h"
35#include <memory>
36#include "../../Core/Math/mat4.h"
37#include "../../Core/Math/rect.h"
38#include "../../Core/Signals/signal.h"
39#include "primitives_array.h"
40#include "frame_buffer.h"
41#include "element_array_vector.h"
42
43namespace clan
44{
47
48 class Size;
49 class Texture;
50 class FrameBuffer;
51 class PixelBuffer;
52 class PrimitivesArray;
53 class Font;
54 class FontMetrics;
55 class GraphicContextProvider;
56 class GraphicContext_Impl;
57 class ProgramObject;
58 class Angle;
59 class RenderBatcher;
60 class FontProvider_Freetype;
61 class UniformBuffer;
62 class StorageBuffer;
63 class RasterizerState;
64 class BlendState;
65 class DepthStencilState;
66
68 enum class CullMode
69 {
70 front,
71 back,
72 front_and_back
73 };
74
76 enum class FillMode
77 {
78 point,
79 line,
80 polygon
81 };
82
84 enum class FaceSide
85 {
86 clockwise,
87 counter_clockwise
88 };
89
91 enum class CompareFunction
92 {
93 lequal,
94 gequal,
95 less,
96 greater,
97 equal,
98 notequal,
99 always,
100 never
101 };
102
104 enum class StencilOp
105 {
106 keep,
107 zero,
108 replace,
109 incr,
110 decr,
111 invert,
112 incr_wrap,
113 decr_wrap
114 };
115
117 enum class DrawBuffer
118 {
119 none,
120 front_left,
121 front_right,
122 back_left,
123 back_right,
124 front,
125 back,
126 left,
127 right,
128 front_and_back
129 };
130
132 enum class LogicOp
133 {
134 _clear,
135 _and,
136 _and_reverse,
137 _copy,
138 _and_inverted,
139 _noop,
140 _xor,
141 _or,
142 _nor,
143 _equiv,
144 _invert,
145 _or_reverse,
146 _copy_inverted,
147 _or_inverted,
148 _nand,
149 _set
150 };
151
153 enum class BlendFunc
154 {
156 zero,
157
159 one,
160
162 dest_color,
163
165 src_color,
166
168 one_minus_dest_color,
169
171 one_minus_src_color,
172
174 src_alpha,
175
177 one_minus_src_alpha,
178
180 dest_alpha,
181
183 one_minus_dest_alpha,
184
186 src_alpha_saturate,
187
189 constant_color,
190
192 one_minus_constant_color,
193
195 constant_alpha,
196
198 one_minus_constant_alpha
199 };
200
202 enum class BlendEquation
203 {
204 add,
205 subtract,
206 reverse_subtract,
207 min,
208 max
209 };
210
212 enum class PointSpriteOrigin
213 {
214 upper_left,
215 lower_left
216 };
217
219 enum class PrimitivesType
220 {
221 points,
222 line_strip,
223 line_loop,
224 lines,
225 triangle_strip,
226 triangle_fan,
227 triangles
228 };
229
231 enum class TextureImageYAxis
232 {
233 y_bottom_up,
234 y_top_down
235 };
236
238 enum class StandardProgram
239 {
240 color_only,
241 single_texture,
242 sprite,
243 path
244 };
245
247 enum class ShaderLanguage
248 {
249 glsl,
250 hlsl,
251 fixed_function,
252 num_shader_languages
253 };
254
256 class GraphicContext
257 {
258 public:
260 GraphicContext();
261
265 GraphicContext(GraphicContextProvider *provider);
266
267 ~GraphicContext();
268
270 bool is_null() const { return !impl; }
271 explicit operator bool() const { return bool(impl); }
272
274 void throw_if_null() const;
275
277 ClipZRange get_clip_z_range() const;
278
280 TextureImageYAxis get_texture_image_y_axis() const;
281
283 ShaderLanguage get_shader_language() const;
284
289 int get_major_version() const;
290
295 int get_minor_version() const;
296
302 bool has_compute_shader_support() const;
303
309 Texture get_texture(int index) const;
310
315 std::vector<Texture> get_textures() const;
316
320 FrameBuffer get_write_frame_buffer() const;
321
325 FrameBuffer get_read_frame_buffer() const;
326
328 ProgramObject get_program_object() const;
329
331 int get_width() const;
332
334 int get_height() const;
335
337 Size get_size() const;
338
341 float get_pixel_ratio() const;
342
345 float get_dip_width() const { return get_width() / get_pixel_ratio(); }
346
349 float get_dip_height() const { return get_height() / get_pixel_ratio(); }
350
353 Sizef get_dip_size() const { return Sizef{ get_dip_width(), get_dip_height() }; }
354
359 Size get_max_texture_size() const;
360
362 GraphicContextProvider *get_provider();
363
364 const GraphicContextProvider * get_provider() const;
365
367 GraphicContext create() const;
368
370 GraphicContext create(FrameBuffer &buffer) const;
371
373 GraphicContext clone() const;
374
376 PixelBuffer get_pixeldata(const Rect& rect, TextureFormat texture_format = TextureFormat::rgba8, bool clamp = true);
377
379 PixelBuffer get_pixeldata(TextureFormat texture_format = TextureFormat::rgba8, bool clamp = true);
380
388 bool is_frame_buffer_owner(const FrameBuffer &fb);
389
391 void set_frame_buffer(const FrameBuffer &write_buffer);
392 void set_frame_buffer(const FrameBuffer &write_buffer, const FrameBuffer &read_buffer);
393
395 void reset_frame_buffer();
396
398 void set_uniform_buffer(int index, const UniformBuffer &buffer);
399
401 void reset_uniform_buffer(int index);
402
404 void set_storage_buffer(int index, const StorageBuffer &buffer);
405
407 void reset_storage_buffer(int index);
408
413 void set_texture(int unit_index, const Texture &texture);
414
420 void set_textures(std::vector<Texture> &textures);
421
425 void reset_texture(int unit_index);
426
428 void reset_textures();
429
434 void set_image_texture(int unit_index, const Texture &texture);
435
441 void set_image_texture(std::vector<Texture> &textures);
442
446 void reset_image_texture(int unit_index);
447
449 void reset_image_textures();
450
452 void set_rasterizer_state(const RasterizerState &state);
453
455 void set_blend_state(const BlendState &state, const Colorf &blend_color = StandardColorf::white(), unsigned int sample_mask = 0xffffffff);
456
458 void set_depth_stencil_state(const DepthStencilState &state, int stencil_ref = 0);
459
461 void reset_rasterizer_state();
462
464 void reset_blend_state();
465
467 void reset_depth_stencil_state();
468
470 void set_program_object(StandardProgram standard_program);
471
475 void set_program_object(const ProgramObject &program);
476
478 void reset_program_object();
479
484 bool is_primitives_array_owner(const PrimitivesArray &primitives_array);
485
487 void draw_primitives(PrimitivesType type, int num_vertices, const PrimitivesArray &array);
488
490 void set_primitives_array(const PrimitivesArray &array);
491
493 void draw_primitives_array(PrimitivesType type, int num_vertices);
494
500 void draw_primitives_array(PrimitivesType type, int offset, int num_vertices);
501
508 void draw_primitives_array_instanced(PrimitivesType type, int offset, int num_vertices, int instance_count);
509
511 void set_primitives_elements(ElementArrayBuffer &element_array);
512
514 template<typename Type>
515 void set_primitives_elements(ElementArrayVector<Type> &element_array)
516 {
517 set_primitives_elements((ElementArrayBuffer&)element_array);
518 }
519
526 void draw_primitives_elements(PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset = 0);
527
535 void draw_primitives_elements_instanced(PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset, int instance_count);
536
538 void reset_primitives_elements();
539
547 void draw_primitives_elements(PrimitivesType type, int count, ElementArrayBuffer &element_array, VertexAttributeDataType indices_type, size_t offset = 0);
548
556 void draw_primitives_elements(PrimitivesType type, int count, ElementArrayVector<unsigned int> &element_array, size_t offset = 0)
557 {
558 draw_primitives_elements(type, count, (ElementArrayBuffer&)element_array, VertexAttributeDataType::type_unsigned_int, offset * sizeof(unsigned int));
559 }
560
568 void draw_primitives_elements(PrimitivesType type, int count, ElementArrayVector<unsigned short> &element_array, size_t offset = 0)
569 {
570 draw_primitives_elements(type, count, (ElementArrayBuffer&)element_array, VertexAttributeDataType::type_unsigned_short, offset * sizeof(unsigned short));
571 }
572
580 void draw_primitives_elements(PrimitivesType type, int count, ElementArrayVector<unsigned char> &element_array, size_t offset = 0)
581 {
582 draw_primitives_elements(type, count, (ElementArrayBuffer&)element_array, VertexAttributeDataType::type_unsigned_byte, offset * sizeof(unsigned char));
583 }
584
593 void draw_primitives_elements_instanced(PrimitivesType type, int count, ElementArrayBuffer &element_array, VertexAttributeDataType indices_type, size_t offset, int instance_count);
594
603 void draw_primitives_elements_instanced(PrimitivesType type, int count, ElementArrayVector<unsigned int> &element_array, size_t offset, int instance_count)
604 {
605 draw_primitives_elements_instanced(type, count, (ElementArrayBuffer&)element_array, VertexAttributeDataType::type_unsigned_int, offset * sizeof(unsigned int), instance_count);
606 }
607
616 void draw_primitives_elements_instanced(PrimitivesType type, int count, ElementArrayVector<unsigned short> &element_array, size_t offset, int instance_count)
617 {
618 draw_primitives_elements_instanced(type, count, (ElementArrayBuffer&)element_array, VertexAttributeDataType::type_unsigned_short, offset * sizeof(unsigned short), instance_count);
619 }
620
629 void draw_primitives_elements_instanced(PrimitivesType type, int count, ElementArrayVector<unsigned char> &element_array, size_t offset, int instance_count)
630 {
631 draw_primitives_elements_instanced(type, count, (ElementArrayBuffer&)element_array, VertexAttributeDataType::type_unsigned_byte, offset * sizeof(unsigned char), instance_count);
632 }
633
635 void reset_primitives_array();
636
638 void dispatch(int x = 1, int y = 1, int z = 1);
639
641 void clear(const Colorf &color = StandardColorf::black());
642
646 void clear_stencil(int value = 0);
647
651 void clear_depth(float value = 0);
652
654 void set_scissor(const Rect &rect, TextureImageYAxis y_axis);
655
657 void reset_scissor();
658
662 void set_viewport(const Rectf &viewport);
663
668 void set_viewport(int index, const Rectf &viewport);
669
671 void set_depth_range(float n, float f);
672
674 void set_depth_range(int viewport, float n, float f);
675
677 void set_draw_buffer(DrawBuffer buffer);
678
680 void flush();
681
682 bool operator ==(const GraphicContext &other) const { return impl == other.impl; }
683 bool operator !=(const GraphicContext &other) const { return impl != other.impl; }
684
685 private:
686 std::shared_ptr<GraphicContext_Impl> impl;
687
688 friend class OpenGL;
689 };
690
691 const float pixelcenter_constant = 0.375f;
692
694}
clan::Angle
Angle class.
Definition angle.h:60
clan::BlendState
Blend state setup.
Definition blend_state.h:44
clan::Colorf
Floating point color description class (for float).
Definition color.h:799
clan::DepthStencilState
DepthStencil state setup.
Definition depth_stencil_state.h:44
clan::ElementArrayBuffer
Element Array Buffer.
Definition element_array_buffer.h:46
clan::ElementArrayVector
Element Array Vector.
Definition element_array_vector.h:43
clan::FontMetrics
Font metrics class.
Definition font_metrics.h:46
clan::Font
Font class.
Definition font.h:60
clan::FrameBuffer
Frame-buffer object class.
Definition frame_buffer.h:72
clan::GraphicContextProvider
Interface for implementing a GraphicContext target.
Definition graphic_context_provider.h:86
clan::GraphicContext::get_pixeldata
PixelBuffer get_pixeldata(TextureFormat texture_format=TextureFormat::rgba8, bool clamp=true)
Return the content of the read buffer into a pixel buffer.
clan::GraphicContext::get_textures
std::vector< Texture > get_textures() const
clan::GraphicContext::clear
void clear(const Colorf &color=StandardColorf::black())
Clears the whole context using the specified color.
clan::GraphicContext::draw_primitives_elements_instanced
void draw_primitives_elements_instanced(PrimitivesType type, int count, ElementArrayVector< unsigned short > &element_array, size_t offset, int instance_count)
Definition graphic_context.h:616
clan::GraphicContext::create
GraphicContext create(FrameBuffer &buffer) const
Create a new default graphic context with a frame buffer selected.
clan::GraphicContext::draw_primitives_elements_instanced
void draw_primitives_elements_instanced(PrimitivesType type, int count, ElementArrayBuffer &element_array, VertexAttributeDataType indices_type, size_t offset, int instance_count)
clan::GraphicContext::draw_primitives_elements
void draw_primitives_elements(PrimitivesType type, int count, ElementArrayBuffer &element_array, VertexAttributeDataType indices_type, size_t offset=0)
clan::GraphicContext::draw_primitives_elements_instanced
void draw_primitives_elements_instanced(PrimitivesType type, int count, ElementArrayVector< unsigned char > &element_array, size_t offset, int instance_count)
Definition graphic_context.h:629
clan::GraphicContext::get_pixeldata
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.
clan::GraphicContext::set_blend_state
void set_blend_state(const BlendState &state, const Colorf &blend_color=StandardColorf::white(), unsigned int sample_mask=0xffffffff)
Set active blend state.
clan::GraphicContext::set_scissor
void set_scissor(const Rect &rect, TextureImageYAxis y_axis)
Set the current clipping rectangle.
clan::GraphicContext::reset_blend_state
void reset_blend_state()
Set active blend state.
clan::GraphicContext::set_image_texture
void set_image_texture(std::vector< Texture > &textures)
clan::GraphicContext::get_program_object
ProgramObject get_program_object() const
Returns the currently selected program object.
clan::GraphicContext::has_compute_shader_support
bool has_compute_shader_support() const
clan::GraphicContext::draw_primitives_array
void draw_primitives_array(PrimitivesType type, int offset, int num_vertices)
clan::GraphicContext::is_primitives_array_owner
bool is_primitives_array_owner(const PrimitivesArray &primitives_array)
clan::GraphicContext::get_provider
GraphicContextProvider * get_provider()
Returns the provider for this graphic context.
clan::GraphicContext::reset_image_texture
void reset_image_texture(int unit_index)
clan::GraphicContext::create
GraphicContext create() const
Create a new default graphic context compatible with this one.
clan::GraphicContext::operator!=
bool operator!=(const GraphicContext &other) const
Definition graphic_context.h:683
clan::GraphicContext::clear_stencil
void clear_stencil(int value=0)
clan::GraphicContext::set_storage_buffer
void set_storage_buffer(int index, const StorageBuffer &buffer)
Select storage buffer into index.
clan::GraphicContext::get_provider
const GraphicContextProvider * get_provider() const
clan::GraphicContext::set_primitives_array
void set_primitives_array(const PrimitivesArray &array)
Set the primitives array on the gc.
clan::GraphicContext::get_dip_size
Sizef get_dip_size() const
Definition graphic_context.h:353
clan::GraphicContext::set_frame_buffer
void set_frame_buffer(const FrameBuffer &write_buffer, const FrameBuffer &read_buffer)
clan::GraphicContext::get_clip_z_range
ClipZRange get_clip_z_range() const
Returns in what range clip space z values are clipped.
clan::GraphicContext::set_rasterizer_state
void set_rasterizer_state(const RasterizerState &state)
Set active rasterizer state.
clan::GraphicContext::clear_depth
void clear_depth(float value=0)
clan::GraphicContext::set_primitives_elements
void set_primitives_elements(ElementArrayVector< Type > &element_array)
Sets current elements array buffer.
Definition graphic_context.h:515
clan::GraphicContext::set_image_texture
void set_image_texture(int unit_index, const Texture &texture)
clan::GraphicContext::draw_primitives_elements
void draw_primitives_elements(PrimitivesType type, int count, ElementArrayVector< unsigned char > &element_array, size_t offset=0)
Definition graphic_context.h:580
clan::GraphicContext::get_dip_height
float get_dip_height() const
Definition graphic_context.h:349
clan::GraphicContext::reset_image_textures
void reset_image_textures()
Remove all selected textures.
clan::GraphicContext::draw_primitives_elements_instanced
void draw_primitives_elements_instanced(PrimitivesType type, int count, ElementArrayVector< unsigned int > &element_array, size_t offset, int instance_count)
Definition graphic_context.h:603
clan::GraphicContext::OpenGL
friend class OpenGL
Definition graphic_context.h:688
clan::GraphicContext::reset_primitives_elements
void reset_primitives_elements()
Resets current elements array buffer.
clan::GraphicContext::reset_depth_stencil_state
void reset_depth_stencil_state()
Set active depth stencil state.
clan::GraphicContext::get_max_texture_size
Size get_max_texture_size() const
clan::GraphicContext::get_size
Size get_size() const
Returns the current actual size of the context.
clan::GraphicContext::draw_primitives
void draw_primitives(PrimitivesType type, int num_vertices, const PrimitivesArray &array)
Draw primitives on gc.
clan::GraphicContext::get_read_frame_buffer
FrameBuffer get_read_frame_buffer() const
clan::GraphicContext::draw_primitives_array_instanced
void draw_primitives_array_instanced(PrimitivesType type, int offset, int num_vertices, int instance_count)
clan::GraphicContext::reset_uniform_buffer
void reset_uniform_buffer(int index)
Remove uniform buffer from index.
clan::GraphicContext::draw_primitives_elements
void draw_primitives_elements(PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset=0)
clan::GraphicContext::reset_texture
void reset_texture(int unit_index)
clan::GraphicContext::get_dip_width
float get_dip_width() const
Definition graphic_context.h:345
clan::GraphicContext::clone
GraphicContext clone() const
Create a new default graphic context cloned with this one.
clan::GraphicContext::get_write_frame_buffer
FrameBuffer get_write_frame_buffer() const
clan::GraphicContext::set_frame_buffer
void set_frame_buffer(const FrameBuffer &write_buffer)
Sets the current frame buffer.
clan::GraphicContext::set_viewport
void set_viewport(int index, const Rectf &viewport)
clan::GraphicContext::set_draw_buffer
void set_draw_buffer(DrawBuffer buffer)
Set used draw buffer.
clan::GraphicContext::operator==
bool operator==(const GraphicContext &other) const
Definition graphic_context.h:682
clan::GraphicContext::reset_textures
void reset_textures()
Remove all selected textures.
clan::GraphicContext::is_null
bool is_null() const
Returns true if this object is invalid.
Definition graphic_context.h:270
clan::GraphicContext::get_shader_language
ShaderLanguage get_shader_language() const
Returns the shader language used.
clan::GraphicContext::set_depth_stencil_state
void set_depth_stencil_state(const DepthStencilState &state, int stencil_ref=0)
Set active depth stencil state.
clan::GraphicContext::get_texture
Texture get_texture(int index) const
clan::GraphicContext::GraphicContext
GraphicContext()
Constructs a null instance.
clan::GraphicContext::reset_program_object
void reset_program_object()
Remove active program object.
clan::GraphicContext::get_minor_version
int get_minor_version() const
clan::GraphicContext::is_frame_buffer_owner
bool is_frame_buffer_owner(const FrameBuffer &fb)
clan::GraphicContext::reset_frame_buffer
void reset_frame_buffer()
Resets the current frame buffer to be the initial frame buffer.
clan::GraphicContext::set_program_object
void set_program_object(const ProgramObject &program)
clan::GraphicContext::get_texture_image_y_axis
TextureImageYAxis get_texture_image_y_axis() const
Returns the Y axis direction for viewports, clipping rects, textures and render targets.
clan::GraphicContext::flush
void flush()
Flush the command buffer.
clan::GraphicContext::set_program_object
void set_program_object(StandardProgram standard_program)
Set active program object to the standard program specified.
clan::GraphicContext::reset_rasterizer_state
void reset_rasterizer_state()
Set active rasterizer state.
clan::GraphicContext::GraphicContext
GraphicContext(GraphicContextProvider *provider)
clan::GraphicContext::dispatch
void dispatch(int x=1, int y=1, int z=1)
Execute a compute shader.
clan::GraphicContext::reset_primitives_array
void reset_primitives_array()
Reset the primitives arrays.
clan::GraphicContext::set_primitives_elements
void set_primitives_elements(ElementArrayBuffer &element_array)
Sets current elements array buffer.
clan::GraphicContext::set_depth_range
void set_depth_range(float n, float f)
Specifies the depth range for all viewports.
clan::GraphicContext::get_height
int get_height() const
Returns the current actual height of the context.
clan::GraphicContext::~GraphicContext
~GraphicContext()
clan::GraphicContext::draw_primitives_elements_instanced
void draw_primitives_elements_instanced(PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset, int instance_count)
clan::GraphicContext::draw_primitives_array
void draw_primitives_array(PrimitivesType type, int num_vertices)
Draws primitives from the current assigned primitives array.
clan::GraphicContext::get_major_version
int get_major_version() const
clan::GraphicContext::set_uniform_buffer
void set_uniform_buffer(int index, const UniformBuffer &buffer)
Select uniform buffer into index.
clan::GraphicContext::draw_primitives_elements
void draw_primitives_elements(PrimitivesType type, int count, ElementArrayVector< unsigned int > &element_array, size_t offset=0)
Definition graphic_context.h:556
clan::GraphicContext::set_textures
void set_textures(std::vector< Texture > &textures)
clan::GraphicContext::reset_scissor
void reset_scissor()
Removes the set clipping rectangle.
clan::GraphicContext::reset_storage_buffer
void reset_storage_buffer(int index)
Remove storage buffer from index.
clan::GraphicContext::draw_primitives_elements
void draw_primitives_elements(PrimitivesType type, int count, ElementArrayVector< unsigned short > &element_array, size_t offset=0)
Definition graphic_context.h:568
clan::GraphicContext::throw_if_null
void throw_if_null() const
Throw an exception if this object is invalid.
clan::GraphicContext::get_pixel_ratio
float get_pixel_ratio() const
clan::GraphicContext::set_depth_range
void set_depth_range(int viewport, float n, float f)
Specifies the depth range for the specified viewport.
clan::GraphicContext::set_texture
void set_texture(int unit_index, const Texture &texture)
clan::GraphicContext::set_viewport
void set_viewport(const Rectf &viewport)
clan::GraphicContext::get_width
int get_width() const
Returns the current actual width of the context.
clan::PixelBuffer
Pixel data container.
Definition pixel_buffer.h:68
clan::PrimitivesArray
Primitives array description.
Definition primitives_array.h:68
clan::ProgramObject
Program Object.
Definition program_object.h:69
clan::RasterizerState
Rasterizer state setup.
Definition rasterizer_state.h:44
clan::Rect
2D (left,top,right,bottom) rectangle structure - Integer
Definition rect.h:446
clan::Rectf
2D (left,top,right,bottom) rectangle structure - Float
Definition rect.h:460
clan::RenderBatcher
Render batching abstraction.
Definition render_batcher.h:45
clan::Size
2D (width,height) size structure - Integer
Definition size.h:176
clan::Sizef
2D (width,height) size structure - Float
Definition size.h:189
clan::StandardColorf::black
static Colorf black()
Definition color.h:1747
clan::StandardColorf::white
static Colorf white()
Definition color.h:1884
clan::StorageBuffer
Storage Buffer.
Definition storage_buffer.h:47
clan::Texture
Texture object class.
Definition texture.h:103
clan::UniformBuffer
Uniform Buffer.
Definition uniform_buffer.h:47
clan::JsonType::array
@ array
Definition json_value.h:51
clan::ClipZRange
ClipZRange
Definition mat4.h:51
clan::max
A max(A a, B b)
Definition cl_math.h:58
clan::clamp
C clamp(A val, B minval, C maxval)
Definition cl_math.h:97
clan::min
A min(A a, B b)
Definition cl_math.h:57
clan::Handedness::right
@ right
Definition mat4.h:47
clan::Handedness::left
@ left
Definition mat4.h:46
clan::BlendFunc
BlendFunc
Blending functions.
Definition graphic_context.h:154
clan::FaceSide
FaceSide
Front face modes.
Definition graphic_context.h:85
clan::CompareFunction
CompareFunction
Compare functions.
Definition graphic_context.h:92
clan::TextureFormat
TextureFormat
Texture format.
Definition texture_format.h:39
clan::PrimitivesType
PrimitivesType
Primitive types.
Definition graphic_context.h:220
clan::ShaderLanguage
ShaderLanguage
Shader language used.
Definition graphic_context.h:248
clan::FillMode
FillMode
Polygon filling modes.
Definition graphic_context.h:77
clan::pixelcenter_constant
const float pixelcenter_constant
Definition graphic_context.h:691
clan::PointSpriteOrigin
PointSpriteOrigin
Point Sprite Origin.
Definition graphic_context.h:213
clan::LogicOp
LogicOp
Logic Op.
Definition graphic_context.h:133
clan::StencilOp
StencilOp
Stencil operations.
Definition graphic_context.h:105
clan::TextureImageYAxis
TextureImageYAxis
Y axis direction for viewports, clipping rects, textures and render targets.
Definition graphic_context.h:232
clan::DrawBuffer
DrawBuffer
Drawing buffers.
Definition graphic_context.h:118
clan::StandardProgram
StandardProgram
Standard Program.
Definition graphic_context.h:239
clan::VertexAttributeDataType
VertexAttributeDataType
Primitives array description.
Definition primitives_array.h:56
clan::CullMode
CullMode
Polygon culling modes.
Definition graphic_context.h:69
clan::BlendEquation
BlendEquation
Blending equations.
Definition graphic_context.h:203
clan::BlendFunc::one_minus_dest_alpha
@ one_minus_dest_alpha
source or destination (1, 1, 1, 1) - (Ad, Ad, Ad, Ad)
Definition graphic_context.h:183
clan::BlendFunc::one_minus_dest_color
@ one_minus_dest_color
source (1, 1, 1, 1) - (Rd, Gd, Bd, Ad)
Definition graphic_context.h:168
clan::BlendFunc::src_color
@ src_color
destination (Rs, Gs, Bs, As)
Definition graphic_context.h:165
clan::BlendFunc::src_alpha_saturate
@ src_alpha_saturate
source (f, f, f, 1) - f = min(As, 1 - Ad)
Definition graphic_context.h:186
clan::BlendFunc::one_minus_constant_color
@ one_minus_constant_color
source or destination (1, 1, 1, 1) - (Rc, Gc, Bc, Ac)
Definition graphic_context.h:192
clan::BlendFunc::dest_color
@ dest_color
source (Rd, Gd, Bd, Ad)
Definition graphic_context.h:162
clan::BlendFunc::constant_alpha
@ constant_alpha
source or destination (Ac, Ac, Ac, Ac)
Definition graphic_context.h:195
clan::BlendFunc::one_minus_src_alpha
@ one_minus_src_alpha
source or destination (1, 1, 1, 1) - (As, As, As, As)
Definition graphic_context.h:177
clan::BlendFunc::one_minus_src_color
@ one_minus_src_color
destination (1, 1, 1, 1) - (Rs, Gs, Bs, As)
Definition graphic_context.h:171
clan::BlendFunc::one_minus_constant_alpha
@ one_minus_constant_alpha
source or destination (1, 1, 1, 1) - (Ac, Ac, Ac, Ac)
Definition graphic_context.h:198
clan::BlendFunc::constant_color
@ constant_color
source or destination (Rc, Gc, Bc, Ac)
Definition graphic_context.h:189
clan::BlendFunc::one
@ one
source or destination (1, 1, 1, 1)
Definition graphic_context.h:159
clan::BlendFunc::dest_alpha
@ dest_alpha
source or destination (Ad, Ad, Ad, Ad)
Definition graphic_context.h:180
clan::BlendFunc::src_alpha
@ src_alpha
source or destination (As, As, As, As)
Definition graphic_context.h:174
clan::FaceSide::counter_clockwise
@ counter_clockwise
Definition graphic_context.h:87
clan::FaceSide::clockwise
@ clockwise
Definition graphic_context.h:86
clan::CompareFunction::lequal
@ lequal
Definition graphic_context.h:93
clan::CompareFunction::equal
@ equal
Definition graphic_context.h:97
clan::CompareFunction::greater
@ greater
Definition graphic_context.h:96
clan::CompareFunction::gequal
@ gequal
Definition graphic_context.h:94
clan::CompareFunction::never
@ never
Definition graphic_context.h:100
clan::CompareFunction::notequal
@ notequal
Definition graphic_context.h:98
clan::CompareFunction::less
@ less
Definition graphic_context.h:95
clan::CompareFunction::always
@ always
Definition graphic_context.h:99
clan::TextureFormat::rgba8
@ rgba8
Definition texture_format.h:41
clan::PrimitivesType::triangle_strip
@ triangle_strip
Definition graphic_context.h:225
clan::PrimitivesType::points
@ points
Definition graphic_context.h:221
clan::PrimitivesType::line_loop
@ line_loop
Definition graphic_context.h:223
clan::PrimitivesType::triangle_fan
@ triangle_fan
Definition graphic_context.h:226
clan::PrimitivesType::line_strip
@ line_strip
Definition graphic_context.h:222
clan::PrimitivesType::triangles
@ triangles
Definition graphic_context.h:227
clan::PrimitivesType::lines
@ lines
Definition graphic_context.h:224
clan::ShaderLanguage::num_shader_languages
@ num_shader_languages
Definition graphic_context.h:252
clan::ShaderLanguage::glsl
@ glsl
Definition graphic_context.h:249
clan::ShaderLanguage::hlsl
@ hlsl
Definition graphic_context.h:250
clan::ShaderLanguage::fixed_function
@ fixed_function
Definition graphic_context.h:251
clan::FillMode::line
@ line
Definition graphic_context.h:79
clan::FillMode::point
@ point
Definition graphic_context.h:78
clan::FillMode::polygon
@ polygon
Definition graphic_context.h:80
clan::PointSpriteOrigin::upper_left
@ upper_left
Definition graphic_context.h:214
clan::PointSpriteOrigin::lower_left
@ lower_left
Definition graphic_context.h:215
clan::LogicOp::_and_inverted
@ _and_inverted
Definition graphic_context.h:138
clan::LogicOp::_nor
@ _nor
Definition graphic_context.h:142
clan::LogicOp::_copy_inverted
@ _copy_inverted
Definition graphic_context.h:146
clan::LogicOp::_or_reverse
@ _or_reverse
Definition graphic_context.h:145
clan::LogicOp::_nand
@ _nand
Definition graphic_context.h:148
clan::LogicOp::_xor
@ _xor
Definition graphic_context.h:140
clan::LogicOp::_and_reverse
@ _and_reverse
Definition graphic_context.h:136
clan::LogicOp::_equiv
@ _equiv
Definition graphic_context.h:143
clan::LogicOp::_and
@ _and
Definition graphic_context.h:135
clan::LogicOp::_or_inverted
@ _or_inverted
Definition graphic_context.h:147
clan::LogicOp::_clear
@ _clear
Definition graphic_context.h:134
clan::LogicOp::_invert
@ _invert
Definition graphic_context.h:144
clan::LogicOp::_noop
@ _noop
Definition graphic_context.h:139
clan::LogicOp::_or
@ _or
Definition graphic_context.h:141
clan::LogicOp::_set
@ _set
Definition graphic_context.h:149
clan::LogicOp::_copy
@ _copy
Definition graphic_context.h:137
clan::StencilOp::keep
@ keep
Definition graphic_context.h:106
clan::StencilOp::invert
@ invert
Definition graphic_context.h:111
clan::StencilOp::decr
@ decr
Definition graphic_context.h:110
clan::StencilOp::incr
@ incr
Definition graphic_context.h:109
clan::StencilOp::incr_wrap
@ incr_wrap
Definition graphic_context.h:112
clan::StencilOp::decr_wrap
@ decr_wrap
Definition graphic_context.h:113
clan::StencilOp::replace
@ replace
Definition graphic_context.h:108
clan::StencilOp::zero
@ zero
Definition graphic_context.h:107
clan::TextureImageYAxis::y_bottom_up
@ y_bottom_up
OpenGL, origin is lower left with Y going upwards.
Definition graphic_context.h:233
clan::TextureImageYAxis::y_top_down
@ y_top_down
Direct3D, origin is upper left with Y going downwards.
Definition graphic_context.h:234
clan::DrawBuffer::back_left
@ back_left
Definition graphic_context.h:122
clan::DrawBuffer::none
@ none
Definition graphic_context.h:119
clan::DrawBuffer::front_right
@ front_right
Definition graphic_context.h:121
clan::DrawBuffer::back_right
@ back_right
Definition graphic_context.h:123
clan::DrawBuffer::front_left
@ front_left
Definition graphic_context.h:120
clan::StandardProgram::single_texture
@ single_texture
Definition graphic_context.h:241
clan::StandardProgram::sprite
@ sprite
Definition graphic_context.h:242
clan::StandardProgram::path
@ path
Definition graphic_context.h:243
clan::StandardProgram::color_only
@ color_only
Definition graphic_context.h:240
clan::VertexAttributeDataType::type_unsigned_byte
@ type_unsigned_byte
Definition primitives_array.h:57
clan::VertexAttributeDataType::type_unsigned_short
@ type_unsigned_short
Definition primitives_array.h:58
clan::VertexAttributeDataType::type_unsigned_int
@ type_unsigned_int
Definition primitives_array.h:59
clan::CullMode::back
@ back
Definition graphic_context.h:71
clan::CullMode::front_and_back
@ front_and_back
Definition graphic_context.h:72
clan::CullMode::front
@ front
Definition graphic_context.h:70
clan::BlendEquation::add
@ add
Definition graphic_context.h:204
clan::BlendEquation::subtract
@ subtract
Definition graphic_context.h:205
clan::BlendEquation::reverse_subtract
@ reverse_subtract
Definition graphic_context.h:206
clan
Definition clanapp.h:36
clan::StyleValueType::color
@ color
value is an url
Definition style_value_type.h:43
clan::Key::y
@ y
Definition keys.h:105
clan::Key::n
@ n
Definition keys.h:94
clan::Key::f
@ f
Definition keys.h:86
clan::Key::x
@ x
Definition keys.h:104
clan::Key::z
@ z
Definition keys.h:106