36 #include "../api_display.h"
37 #include "../2D/color.h"
38 #include "../Image/texture_format.h"
39 #include "../../Core/System/sharedptr.h"
40 #include "../../Core/Math/mat4.h"
41 #include "../../Core/IOData/virtual_directory.h"
42 #include "../../Core/Math/rect.h"
43 #include "../../Core/Signals/signal_v0.h"
59 class CL_GraphicContext_Impl;
64 class CL_FontProvider_Freetype;
146 void throw_if_null()
const;
157 std::vector<CL_Texture> get_textures()
const;
190 int get_width()
const;
193 int get_height()
const;
202 const CL_Mat4f &get_modelview()
const;
207 CL_Size get_max_texture_size()
const;
229 void reset_frame_buffer();
235 void set_texture(
int unit_index,
const CL_Texture &texture);
242 void set_textures(std::vector<CL_Texture> &textures);
247 void reset_texture(
int unit_index);
250 void reset_textures();
262 void reset_program_object();
268 void reset_blend_mode();
274 void reset_buffer_control();
277 void set_pen(
const CL_Pen &pen);
286 void reset_polygon_rasterizer();
302 void draw_primitives_array(
CL_PrimitivesType type,
int offset,
int num_vertices);
310 void draw_primitives_array_instanced(
CL_PrimitivesType type,
int offset,
int num_vertices,
int instance_count);
317 void draw_primitives_elements(
CL_PrimitivesType type,
int count,
unsigned int *indices);
324 void draw_primitives_elements(
CL_PrimitivesType type,
int count,
unsigned short *indices);
331 void draw_primitives_elements(
CL_PrimitivesType type,
int count,
unsigned char *indices);
339 void draw_primitives_elements_instanced(
CL_PrimitivesType type,
int count,
unsigned int *indices,
int instance_count);
347 void draw_primitives_elements_instanced(
CL_PrimitivesType type,
int count,
unsigned short *indices,
int instance_count);
355 void draw_primitives_elements_instanced(
CL_PrimitivesType type,
int count,
unsigned char *indices,
int instance_count);
377 void reset_primitives_array();
403 void clear_stencil(
int value = 0);
408 void clear_depth(
float value = 0);
411 void set_cliprect(
const CL_Rect &rect);
417 void push_cliprect(
const CL_Rect &rect);
420 void push_cliprect();
426 void reset_cliprect();
432 void set_viewport(
const CL_Rectf &viewport);
435 void set_projection(
const CL_Mat4f &matrix);
438 void set_modelview(
const CL_Mat4f &matrix);
441 void mult_modelview(
const CL_Mat4f &matrix);
444 void push_modelview();
449 void set_translate(
float x,
float y,
float z = 0.0);
456 void mult_translate(
float x,
float y,
float z = 0.0);
464 void push_translate(
float x,
float y,
float z = 0.0);
467 void set_rotate(
const CL_Angle &angle,
float x = 0.0,
float y = 0.0,
float z = 1.0,
bool normalize =
true);
470 void mult_rotate(
const CL_Angle &angle,
float x = 0.0,
float y = 0.0,
float z = 1.0,
bool normalize =
true);
473 void push_rotate(
const CL_Angle &angle,
float x = 0.0,
float y = 0.0,
float z = 1.0);
476 void set_scale(
float x,
float y,
float z = 1.0);
479 void mult_scale(
float x,
float y,
float z = 1.0);
482 void push_scale(
float x,
float y,
float z = 1.0);
485 void pop_modelview();
488 void flush_batcher();
507 CL_SharedPtr<CL_GraphicContext_Impl> impl;
510 friend class CL_Sprite_Impl;
512 friend class CL_GlyphCache;
517 #ifndef cl_pixelcenter_constant
518 #define cl_pixelcenter_constant 0.375f