4 [CCode (cname
= "CoglHandle")]
5 public class Bitmap
: Handle
{
6 public static bool get_size_from_file (string filename
, out int width
, out int height
);
7 public static Bitmap
new_from_file (string filename
) throws GLib
.Error
;
11 [CCode (cname
= "CoglHandle")]
12 public class Buffer
: Handle
{
13 public uint get_size ();
14 public Cogl
.BufferUpdateHint
get_update_hint ();
15 public uchar map (Cogl
.BufferAccess access
);
16 public bool set_data (size_t offset
, [CCode (array_length_type
= "size_t")] uint8[] data
);
17 public void set_update_hint (Cogl
.BufferUpdateHint hint
);
22 [CCode (ref_function
= "cogl_handle_ref", unref_function
= "cogl_handle_unref")]
24 [CCode (cname
= "cogl_is_bitmap")]
25 public bool is_bitmap ();
26 [CCode (cname
= "cogl_is_buffer")]
27 public bool is_buffer ();
28 [CCode (cname
= "cogl_is_material")]
29 public bool is_material ();
30 [CCode (cname
= "cogl_is_offscreen")]
31 public bool is_offscreen ();
32 [CCode (cname
= "cogl_is_pixel_buffer")]
33 public bool is_pixel_buffer ();
34 [CCode (cname
= "cogl_is_program")]
35 public bool is_program ();
36 [CCode (cname
= "cogl_is_shader")]
37 public bool is_shader ();
38 [CCode (cname
= "cogl_is_texture")]
39 public bool is_texture ();
40 [CCode (cname
= "cogl_is_vertex_buffer")]
41 public bool is_vertex_buffer ();
45 [CCode (cname
= "CoglHandle", ref_function
= "cogl_material_ref", unref_function
= "cogl_material_unref")]
46 public class Material
: Handle
{
47 [CCode (type
= "CoglHandle*", has_construct_function
= false)]
49 public Material
copy();
51 public void get_ambient (out Cogl
.Color ambient
);
52 public void get_color (out Cogl
.Color color
);
53 public void get_diffuse (out Cogl
.Color diffuse
);
54 public void get_emission (out Cogl
.Color emission
);
55 public unowned GLib
.List
<Cogl
.MaterialLayer
> get_layers ();
56 public int get_n_layers ();
57 public float get_shininess ();
58 public void get_specular (out Cogl
.Color specular
);
60 public void remove_layer (int layer_index
);
61 public void set_alpha_test_function (Cogl
.MaterialAlphaFunc alpha_func
, float alpha_reference
);
62 public void set_ambient (Cogl
.Color ambient
);
63 public void set_ambient_and_diffuse (Cogl
.Color color
);
64 public bool set_blend (string blend_string
) throws Cogl
.BlendStringError
;
65 public void set_blend_constant (Cogl
.Color constant_color
);
66 public void set_color (Cogl
.Color color
);
67 public void set_color4f (float red
, float green
, float blue
, float alpha
);
68 public void set_color4ub (uchar red
, uchar green
, uchar blue
, uchar alpha
);
69 public void set_diffuse (Cogl
.Color diffuse
);
70 public void set_emission (Cogl
.Color emission
);
71 public void set_layer (int layer_index
, Cogl
.Texture texture
);
72 public bool set_layer_combine (int layer_index
, string blend_string
) throws BlendStringError
;
73 public void set_layer_combine_constant (int layer_index
, Cogl
.Color constant
);
74 public void set_layer_filters (int layer_index
, Cogl
.MaterialFilter min_filter
, Cogl
.MaterialFilter mag_filter
);
75 public void set_layer_matrix (int layer_index
, Cogl
.Matrix matrix
);
76 public void set_shininess (float shininess
);
77 public void set_specular (Cogl
.Color specular
);
81 [CCode (cname
= "CoglHandle")]
82 public class MaterialLayer
: Handle
{
83 public Cogl
.MaterialFilter
get_mag_filter ();
84 public Cogl
.MaterialFilter
get_min_filter ();
85 public unowned Cogl
.Texture?
get_texture ();
86 public Cogl
.MaterialLayerType
get_type ();
90 [CCode (cname
= "CoglHandle", ref_function
= "cogl_offscreen_ref", unref_function
= "cogl_offscreen_unref")]
91 public class Offscreen
: Handle
{
92 [CCode (cname
= "cogl_offscreen_new_to_texture", type
= "CoglHandle*", has_construct_function
= false)]
93 public Offscreen
.to_texture (Cogl
.Texture handle
);
94 [CCode (instance_pos
= -1)]
95 public void set_draw_buffer (Cogl
.BufferTarget target
);
96 [CCode (cname
= "cogl_pop_draw_buffer")]
97 public static void pop_draw_buffer ();
98 [CCode (cname
= "cogl_push_draw_buffer")]
99 public static void push_draw_buffer ();
103 public class PixelBuffer
: Handle
{
104 public PixelBuffer (uint size
);
105 public PixelBuffer
.for_size (uint width
, uint height
, Cogl
.PixelFormat format
, uint stride
);
109 [CCode (cname
= "CoglHandle", ref_function
= "cogl_program_ref", unref_function
= "cogl_program_unref")]
110 public class Program
: Handle
{
111 [CCode (cname
= "cogl_create_program", type
= "CoglHandle*", has_construct_function
= false)]
113 public void attach_shader (Cogl
.Shader shader_handle
);
114 public int get_uniform_location (string uniform_name
);
116 public static void uniform_1f (int uniform_no
, float value
);
117 public static void uniform_1i (int uniform_no
, int value
);
118 public static void uniform_float (int uniform_no
, int size
, [CCode (array_length_pos
= 2.9)] float[] value
);
119 public static void uniform_int (int uniform_no
, int size
, [CCode (array_length_pos
= 2.9)] int[] value
);
120 public static void uniform_matrix (int uniform_no
, int size
, bool transpose
, [CCode (array_length_pos
= 2.9)] float[] value
);
125 [CCode (cname
= "CoglHandle", ref_function
= "cogl_shader_ref", unref_function
= "cogl_shader_unref")]
126 public class Shader
: Handle
{
127 [CCode (cname
= "cogl_create_shader", type
= "CoglHandle*", has_construct_function
= false)]
128 public Shader (Cogl
.ShaderType shader_type
);
129 public void compile ();
130 public string get_info_log ();
131 public Cogl
.ShaderType
get_type ();
132 public bool is_compiled ();
133 public void source (string source
);
137 [CCode (cname
= "CoglHandle", ref_function
= "cogl_texture_ref", unref_function
= "cogl_texture_unref")]
138 public class Texture
: Handle
{
139 public int get_data (Cogl
.PixelFormat format
, uint rowstride
, uchar[] data
);
140 public Cogl
.PixelFormat
get_format ();
141 public uint get_height ();
142 public int get_max_waste ();
143 public uint get_rowstride ();
144 public uint get_width ();
145 public bool is_sliced ();
146 public Texture
.from_bitmap (Cogl
.Bitmap bmp_handle
, Cogl
.TextureFlags flags
, Cogl
.PixelFormat internal_format
);
147 public Texture
.from_data (uint width
, uint height
, Cogl
.TextureFlags flags
, Cogl
.PixelFormat format
, Cogl
.PixelFormat internal_format
, uint rowstride
, [CCode (array_length
= false)] uchar[] data
);
148 public Texture
.from_file (string filename
, Cogl
.TextureFlags flags
, Cogl
.PixelFormat internal_format
) throws GLib
.Error
;
149 public Texture
.with_size (uint width
, uint height
, Cogl
.TextureFlags flags
, Cogl
.PixelFormat internal_format
);
150 public bool set_region (int src_x
, int src_y
, int dst_x
, int dst_y
, uint dst_width
, uint dst_height
, int width
, int height
, Cogl
.PixelFormat format
, uint rowstride
, uchar[] data
);
154 [CCode (cname
= "CoglHandle", ref_function
= "cogl_vertex_buffer_ref", unref_function
= "cogl_vertex_buffer_unref")]
155 public class VertexBuffer
: Handle
{
156 [CCode (type
= "CoglHandle*", has_construct_function
= false)]
157 public VertexBuffer (uint n_vertices
);
158 public void add (string attribute_name
, uchar n_components
, Cogl
.AttributeType type
, bool normalized
, uint16 stride
, void* pointer
);
159 public void delete (string attribute_name
);
160 public void disable (string attribute_name
);
161 public void draw (Cogl
.VerticesMode mode
, int first
, int count
);
162 public void draw_elements (Cogl
.VerticesMode mode
, VertexBufferIndices indices
, int min_index
, int max_index
, int indices_offset
, int count
);
163 public void enable (string attribute_name
);
164 public uint get_n_vertices ();
165 public void submit ();
169 [CCode (cname
= "CoglHandle")]
170 public class VertexBufferIndices
: Handle
{
171 public VertexBufferIndices (Cogl
.IndicesType indices_type
, void* indices_array
, int indices_len
);
172 public static unowned Cogl
.VertexBufferIndices
get_for_quads (uint n_indices
);
173 public Cogl
.IndicesType
get_type ();
176 [CCode (type_id
= "COGL_TYPE_MATRIX", cheader_filename
= "cogl/cogl.h")]
177 public struct Matrix
{
178 [CCode (cname
= "cogl_matrix_init_from_array", array_length
= false, array_null_terminated
= false)]
179 public Matrix
.from_array ([CCode (array_length
= false)] float[] array
);
180 [CCode (cname
= "cogl_matrix_init_identity")]
181 public Matrix
.identity ();
182 [CCode (cname
= "cogl_matrix_multiply")]
183 public Matrix
.multiply (Cogl
.Matrix a
, Cogl
.Matrix b
);