@girs/cogl-10 10.0.0-3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -0
- package/cogl-10-ambient.d.ts +9 -0
- package/cogl-10-import.d.ts +13 -0
- package/cogl-10.cjs +11 -0
- package/cogl-10.d.cts +4684 -0
- package/cogl-10.d.ts +4689 -0
- package/cogl-10.js +10 -0
- package/package.json +62 -0
- package/tsconfig.doc.json +21 -0
package/cogl-10.d.ts
ADDED
|
@@ -0,0 +1,4689 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
4
|
+
*
|
|
5
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
6
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import './cogl-10-ambient.d.ts';
|
|
10
|
+
import './cogl-10-import.d.ts';
|
|
11
|
+
/**
|
|
12
|
+
* Cogl-10
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type cairo from '@girs/cairo-1.0';
|
|
16
|
+
import type Graphene from '@girs/graphene-1.0';
|
|
17
|
+
import type GObject from '@girs/gobject-2.0';
|
|
18
|
+
import type GLib from '@girs/glib-2.0';
|
|
19
|
+
import type GL from '@girs/gl-1.0';
|
|
20
|
+
|
|
21
|
+
export namespace Cogl {
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Data types for the components of a vertex attribute.
|
|
25
|
+
*/
|
|
26
|
+
enum AttributeType {
|
|
27
|
+
/**
|
|
28
|
+
* Data is the same size of a byte
|
|
29
|
+
*/
|
|
30
|
+
BYTE,
|
|
31
|
+
/**
|
|
32
|
+
* Data is the same size of an
|
|
33
|
+
* unsigned byte
|
|
34
|
+
*/
|
|
35
|
+
UNSIGNED_BYTE,
|
|
36
|
+
/**
|
|
37
|
+
* Data is the same size of a short integer
|
|
38
|
+
*/
|
|
39
|
+
SHORT,
|
|
40
|
+
/**
|
|
41
|
+
* Data is the same size of
|
|
42
|
+
* an unsigned short integer
|
|
43
|
+
*/
|
|
44
|
+
UNSIGNED_SHORT,
|
|
45
|
+
/**
|
|
46
|
+
* Data is the same size of a float
|
|
47
|
+
*/
|
|
48
|
+
FLOAT,
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Error codes that can be thrown when performing bitmap
|
|
52
|
+
* operations. Note that gdk_pixbuf_new_from_file() can also throw
|
|
53
|
+
* errors directly from the underlying image loading library. For
|
|
54
|
+
* example, if GdkPixbuf is used then errors #GdkPixbufError<!-- -->s
|
|
55
|
+
* will be used directly.
|
|
56
|
+
*/
|
|
57
|
+
enum BitmapError {
|
|
58
|
+
/**
|
|
59
|
+
* Generic failure code, something went
|
|
60
|
+
* wrong.
|
|
61
|
+
*/
|
|
62
|
+
FAILED,
|
|
63
|
+
/**
|
|
64
|
+
* Unknown image type.
|
|
65
|
+
*/
|
|
66
|
+
UNKNOWN_TYPE,
|
|
67
|
+
/**
|
|
68
|
+
* An image file was broken somehow.
|
|
69
|
+
*/
|
|
70
|
+
CORRUPT_IMAGE,
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Error enumeration for the blend strings parser
|
|
74
|
+
*/
|
|
75
|
+
enum BlendStringError {
|
|
76
|
+
/**
|
|
77
|
+
* Generic parse error
|
|
78
|
+
*/
|
|
79
|
+
PARSE_ERROR,
|
|
80
|
+
/**
|
|
81
|
+
* Argument parse error
|
|
82
|
+
*/
|
|
83
|
+
ARGUMENT_PARSE_ERROR,
|
|
84
|
+
/**
|
|
85
|
+
* Internal parser error
|
|
86
|
+
*/
|
|
87
|
+
INVALID_ERROR,
|
|
88
|
+
/**
|
|
89
|
+
* Blend string not
|
|
90
|
+
* supported by the GPU
|
|
91
|
+
*/
|
|
92
|
+
GPU_UNSUPPORTED_ERROR,
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* When using depth testing one of these functions is used to compare
|
|
96
|
+
* the depth of an incoming fragment against the depth value currently
|
|
97
|
+
* stored in the depth buffer. The function is changed using
|
|
98
|
+
* cogl_depth_state_set_test_function().
|
|
99
|
+
*
|
|
100
|
+
* The test is only done when depth testing is explicitly enabled. (See
|
|
101
|
+
* cogl_depth_state_set_test_enabled())
|
|
102
|
+
*/
|
|
103
|
+
enum DepthTestFunction {
|
|
104
|
+
/**
|
|
105
|
+
* Never passes.
|
|
106
|
+
*/
|
|
107
|
+
NEVER,
|
|
108
|
+
/**
|
|
109
|
+
* Passes if the fragment's depth
|
|
110
|
+
* value is less than the value currently in the depth buffer.
|
|
111
|
+
*/
|
|
112
|
+
LESS,
|
|
113
|
+
/**
|
|
114
|
+
* Passes if the fragment's depth
|
|
115
|
+
* value is equal to the value currently in the depth buffer.
|
|
116
|
+
*/
|
|
117
|
+
EQUAL,
|
|
118
|
+
/**
|
|
119
|
+
* Passes if the fragment's depth
|
|
120
|
+
* value is less or equal to the value currently in the depth buffer.
|
|
121
|
+
*/
|
|
122
|
+
LEQUAL,
|
|
123
|
+
/**
|
|
124
|
+
* Passes if the fragment's depth
|
|
125
|
+
* value is greater than the value currently in the depth buffer.
|
|
126
|
+
*/
|
|
127
|
+
GREATER,
|
|
128
|
+
/**
|
|
129
|
+
* Passes if the fragment's depth
|
|
130
|
+
* value is not equal to the value currently in the depth buffer.
|
|
131
|
+
*/
|
|
132
|
+
NOTEQUAL,
|
|
133
|
+
/**
|
|
134
|
+
* Passes if the fragment's depth
|
|
135
|
+
* value greater than or equal to the value currently in the depth buffer.
|
|
136
|
+
*/
|
|
137
|
+
GEQUAL,
|
|
138
|
+
/**
|
|
139
|
+
* Always passes.
|
|
140
|
+
*/
|
|
141
|
+
ALWAYS,
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* All the capabilities that can vary between different GPUs supported
|
|
145
|
+
* by Cogl. Applications that depend on any of these features should explicitly
|
|
146
|
+
* check for them using cogl_has_feature() or cogl_has_features().
|
|
147
|
+
*/
|
|
148
|
+
enum FeatureID {
|
|
149
|
+
/**
|
|
150
|
+
* Set if
|
|
151
|
+
* %COGL_INDICES_TYPE_UNSIGNED_INT is supported in
|
|
152
|
+
* cogl_indices_new().
|
|
153
|
+
*/
|
|
154
|
+
OGL_FEATURE_ID_UNSIGNED_INT_INDICES,
|
|
155
|
+
/**
|
|
156
|
+
* Whether cogl_buffer_map() is
|
|
157
|
+
* supported with CoglBufferAccess including read support.
|
|
158
|
+
*/
|
|
159
|
+
OGL_FEATURE_ID_MAP_BUFFER_FOR_READ,
|
|
160
|
+
/**
|
|
161
|
+
* Whether cogl_buffer_map() is
|
|
162
|
+
* supported with CoglBufferAccess including write support.
|
|
163
|
+
*/
|
|
164
|
+
OGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE,
|
|
165
|
+
OGL_FEATURE_ID_FENCE,
|
|
166
|
+
/**
|
|
167
|
+
* Support for
|
|
168
|
+
* %COGL_TEXTURE_COMPONENTS_RG as the internal components of a
|
|
169
|
+
* texture.
|
|
170
|
+
*/
|
|
171
|
+
OGL_FEATURE_ID_TEXTURE_RG,
|
|
172
|
+
/**
|
|
173
|
+
* Available if the age of #CoglOnscreen back
|
|
174
|
+
* buffers are tracked and so cogl_onscreen_get_buffer_age() can be
|
|
175
|
+
* expected to return age values other than 0.
|
|
176
|
+
*/
|
|
177
|
+
OGL_FEATURE_ID_BUFFER_AGE,
|
|
178
|
+
OGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL,
|
|
179
|
+
/**
|
|
180
|
+
* Whether blitting using
|
|
181
|
+
* cogl_blit_framebuffer() is supported.
|
|
182
|
+
*/
|
|
183
|
+
OGL_FEATURE_ID_BLIT_FRAMEBUFFER,
|
|
184
|
+
OGL_FEATURE_ID_TIMESTAMP_QUERY,
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Return values for the #CoglXlibFilterFunc and #CoglWin32FilterFunc functions.
|
|
188
|
+
*/
|
|
189
|
+
enum FilterReturn {
|
|
190
|
+
/**
|
|
191
|
+
* The event was not handled, continues the
|
|
192
|
+
* processing
|
|
193
|
+
*/
|
|
194
|
+
CONTINUE,
|
|
195
|
+
/**
|
|
196
|
+
* Remove the event, stops the processing
|
|
197
|
+
*/
|
|
198
|
+
REMOVE,
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Identifiers that are passed to #CoglFrameCallback functions
|
|
202
|
+
* (registered using cogl_onscreen_add_frame_callback()) that
|
|
203
|
+
* mark the progression of a frame in some way which usually
|
|
204
|
+
* means that new information will have been accumulated in the
|
|
205
|
+
* frame's corresponding #CoglFrameInfo object.
|
|
206
|
+
*
|
|
207
|
+
* The last event that will be sent for a frame will be a
|
|
208
|
+
* `COGL_FRAME_EVENT_COMPLETE` event and so these are a good
|
|
209
|
+
* opportunity to collect statistics about a frame since the
|
|
210
|
+
* #CoglFrameInfo should hold the most data at this point.
|
|
211
|
+
*
|
|
212
|
+
* <note>A frame may not be completed before the next frame can start
|
|
213
|
+
* so applications should avoid needing to collect all statistics for
|
|
214
|
+
* a particular frame before they can start a new frame.</note>
|
|
215
|
+
*/
|
|
216
|
+
enum FrameEvent {
|
|
217
|
+
/**
|
|
218
|
+
* Notifies that the system compositor has
|
|
219
|
+
* acknowledged a frame and is ready for a
|
|
220
|
+
* new frame to be created.
|
|
221
|
+
*/
|
|
222
|
+
SYNC,
|
|
223
|
+
/**
|
|
224
|
+
* Notifies that a frame has ended. This
|
|
225
|
+
* is a good time for applications to
|
|
226
|
+
* collect statistics about the frame
|
|
227
|
+
* since the #CoglFrameInfo should hold
|
|
228
|
+
* the most data at this point. No other
|
|
229
|
+
* events should be expected after a
|
|
230
|
+
* `COGL_FRAME_EVENT_COMPLETE` event.
|
|
231
|
+
*/
|
|
232
|
+
COMPLETE,
|
|
233
|
+
}
|
|
234
|
+
enum FramebufferError {
|
|
235
|
+
FRAMEBUFFER_ERROR_ALLOCATE,
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* All the error values that might be returned by
|
|
239
|
+
* cogl_get_graphics_reset_status(). Each value's meaning corresponds
|
|
240
|
+
* to the similarly named value defined in the ARB_robustness and
|
|
241
|
+
* NV_robustness_video_memory_purge extensions.
|
|
242
|
+
*/
|
|
243
|
+
enum GraphicsResetStatus {
|
|
244
|
+
NO_ERROR,
|
|
245
|
+
GUILTY_CONTEXT_RESET,
|
|
246
|
+
INNOCENT_CONTEXT_RESET,
|
|
247
|
+
UNKNOWN_CONTEXT_RESET,
|
|
248
|
+
PURGED_CONTEXT_RESET,
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* You should aim to use the smallest data type that gives you enough
|
|
252
|
+
* range, since it reduces the size of your index array and can help
|
|
253
|
+
* reduce the demand on memory bandwidth.
|
|
254
|
+
*
|
|
255
|
+
* Note that %COGL_INDICES_TYPE_UNSIGNED_INT is only supported if the
|
|
256
|
+
* %COGL_FEATURE_ID_UNSIGNED_INT_INDICES feature is available. This
|
|
257
|
+
* should always be available on OpenGL but on OpenGL ES it will only
|
|
258
|
+
* be available if the GL_OES_element_index_uint extension is
|
|
259
|
+
* advertized.
|
|
260
|
+
*/
|
|
261
|
+
enum IndicesType {
|
|
262
|
+
/**
|
|
263
|
+
* Your indices are unsigned bytes
|
|
264
|
+
*/
|
|
265
|
+
BYTE,
|
|
266
|
+
/**
|
|
267
|
+
* Your indices are unsigned shorts
|
|
268
|
+
*/
|
|
269
|
+
SHORT,
|
|
270
|
+
/**
|
|
271
|
+
* Your indices are unsigned ints
|
|
272
|
+
*/
|
|
273
|
+
INT,
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Alpha testing happens before blending primitives with the framebuffer and
|
|
277
|
+
* gives an opportunity to discard fragments based on a comparison with the
|
|
278
|
+
* incoming alpha value and a reference alpha value. The #CoglPipelineAlphaFunc
|
|
279
|
+
* determines how the comparison is done.
|
|
280
|
+
*/
|
|
281
|
+
enum PipelineAlphaFunc {
|
|
282
|
+
/**
|
|
283
|
+
* Never let the fragment through.
|
|
284
|
+
*/
|
|
285
|
+
NEVER,
|
|
286
|
+
/**
|
|
287
|
+
* Let the fragment through if the incoming
|
|
288
|
+
* alpha value is less than the reference alpha value
|
|
289
|
+
*/
|
|
290
|
+
LESS,
|
|
291
|
+
/**
|
|
292
|
+
* Let the fragment through if the incoming
|
|
293
|
+
* alpha value equals the reference alpha value
|
|
294
|
+
*/
|
|
295
|
+
EQUAL,
|
|
296
|
+
/**
|
|
297
|
+
* Let the fragment through if the incoming
|
|
298
|
+
* alpha value is less than or equal to the reference alpha value
|
|
299
|
+
*/
|
|
300
|
+
LEQUAL,
|
|
301
|
+
/**
|
|
302
|
+
* Let the fragment through if the incoming
|
|
303
|
+
* alpha value is greater than the reference alpha value
|
|
304
|
+
*/
|
|
305
|
+
GREATER,
|
|
306
|
+
/**
|
|
307
|
+
* Let the fragment through if the incoming
|
|
308
|
+
* alpha value does not equal the reference alpha value
|
|
309
|
+
*/
|
|
310
|
+
NOTEQUAL,
|
|
311
|
+
/**
|
|
312
|
+
* Let the fragment through if the incoming
|
|
313
|
+
* alpha value is greater than or equal to the reference alpha value.
|
|
314
|
+
*/
|
|
315
|
+
GEQUAL,
|
|
316
|
+
/**
|
|
317
|
+
* Always let the fragment through.
|
|
318
|
+
*/
|
|
319
|
+
ALWAYS,
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Specifies which faces should be culled. This can be set on a
|
|
323
|
+
* pipeline using cogl_pipeline_set_cull_face_mode().
|
|
324
|
+
*/
|
|
325
|
+
enum PipelineCullFaceMode {
|
|
326
|
+
/**
|
|
327
|
+
* Neither face will be
|
|
328
|
+
* culled. This is the default.
|
|
329
|
+
*/
|
|
330
|
+
NONE,
|
|
331
|
+
/**
|
|
332
|
+
* Front faces will be culled.
|
|
333
|
+
*/
|
|
334
|
+
FRONT,
|
|
335
|
+
/**
|
|
336
|
+
* Back faces will be culled.
|
|
337
|
+
*/
|
|
338
|
+
BACK,
|
|
339
|
+
/**
|
|
340
|
+
* All faces will be culled.
|
|
341
|
+
*/
|
|
342
|
+
BOTH,
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Texture filtering is used whenever the current pixel maps either to more
|
|
346
|
+
* than one texture element (texel) or less than one. These filter enums
|
|
347
|
+
* correspond to different strategies used to come up with a pixel color, by
|
|
348
|
+
* possibly referring to multiple neighbouring texels and taking a weighted
|
|
349
|
+
* average or simply using the nearest texel.
|
|
350
|
+
*/
|
|
351
|
+
enum PipelineFilter {
|
|
352
|
+
/**
|
|
353
|
+
* Measuring in manhatten distance from the,
|
|
354
|
+
* current pixel center, use the nearest texture texel
|
|
355
|
+
*/
|
|
356
|
+
NEAREST,
|
|
357
|
+
/**
|
|
358
|
+
* Use the weighted average of the 4 texels
|
|
359
|
+
* nearest the current pixel center
|
|
360
|
+
*/
|
|
361
|
+
LINEAR,
|
|
362
|
+
/**
|
|
363
|
+
* Select the mimap level whose
|
|
364
|
+
* texel size most closely matches the current pixel, and use the
|
|
365
|
+
* %COGL_PIPELINE_FILTER_NEAREST criterion
|
|
366
|
+
*/
|
|
367
|
+
NEAREST_MIPMAP_NEAREST,
|
|
368
|
+
/**
|
|
369
|
+
* Select the mimap level whose
|
|
370
|
+
* texel size most closely matches the current pixel, and use the
|
|
371
|
+
* %COGL_PIPELINE_FILTER_LINEAR criterion
|
|
372
|
+
*/
|
|
373
|
+
LINEAR_MIPMAP_NEAREST,
|
|
374
|
+
/**
|
|
375
|
+
* Select the two mimap levels
|
|
376
|
+
* whose texel size most closely matches the current pixel, use
|
|
377
|
+
* the %COGL_PIPELINE_FILTER_NEAREST criterion on each one and take
|
|
378
|
+
* their weighted average
|
|
379
|
+
*/
|
|
380
|
+
NEAREST_MIPMAP_LINEAR,
|
|
381
|
+
/**
|
|
382
|
+
* Select the two mimap levels
|
|
383
|
+
* whose texel size most closely matches the current pixel, use
|
|
384
|
+
* the %COGL_PIPELINE_FILTER_LINEAR criterion on each one and take
|
|
385
|
+
* their weighted average
|
|
386
|
+
*/
|
|
387
|
+
LINEAR_MIPMAP_LINEAR,
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* The wrap mode specifies what happens when texture coordinates
|
|
391
|
+
* outside the range 0→1 are used. Note that if the filter mode is
|
|
392
|
+
* anything but %COGL_PIPELINE_FILTER_NEAREST then texels outside the
|
|
393
|
+
* range 0→1 might be used even when the coordinate is exactly 0 or 1
|
|
394
|
+
* because OpenGL will try to sample neighbouring pixels. For example
|
|
395
|
+
* if you are trying to render the full texture then you may get
|
|
396
|
+
* artifacts around the edges when the pixels from the other side are
|
|
397
|
+
* merged in if the wrap mode is set to repeat.
|
|
398
|
+
*/
|
|
399
|
+
enum PipelineWrapMode {
|
|
400
|
+
/**
|
|
401
|
+
* The texture will be repeated. This
|
|
402
|
+
* is useful for example to draw a tiled background.
|
|
403
|
+
*/
|
|
404
|
+
REPEAT,
|
|
405
|
+
MIRRORED_REPEAT,
|
|
406
|
+
/**
|
|
407
|
+
* The coordinates outside the
|
|
408
|
+
* range 0→1 will sample copies of the edge pixels of the
|
|
409
|
+
* texture. This is useful to avoid artifacts if only one copy of
|
|
410
|
+
* the texture is being rendered.
|
|
411
|
+
*/
|
|
412
|
+
CLAMP_TO_EDGE,
|
|
413
|
+
/**
|
|
414
|
+
* Cogl will try to automatically
|
|
415
|
+
* decide which of the above two to use. For cogl_rectangle(), it
|
|
416
|
+
* will use repeat mode if any of the texture coordinates are
|
|
417
|
+
* outside the range 0→1, otherwise it will use clamp to edge. For
|
|
418
|
+
* cogl_polygon() it will always use repeat mode. For
|
|
419
|
+
* cogl_vertex_buffer_draw() it will use repeat mode except for
|
|
420
|
+
* layers that have point sprite coordinate generation enabled. This
|
|
421
|
+
* is the default value.
|
|
422
|
+
*/
|
|
423
|
+
AUTOMATIC,
|
|
424
|
+
}
|
|
425
|
+
enum RendererError {
|
|
426
|
+
XLIB_DISPLAY_OPEN,
|
|
427
|
+
BAD_CONSTRAINT,
|
|
428
|
+
}
|
|
429
|
+
enum ScanoutError {
|
|
430
|
+
SCANOUT_ERROR_INHIBITED,
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Types of shaders
|
|
434
|
+
*/
|
|
435
|
+
enum ShaderType {
|
|
436
|
+
/**
|
|
437
|
+
* A program for processing vertices
|
|
438
|
+
*/
|
|
439
|
+
VERTEX,
|
|
440
|
+
/**
|
|
441
|
+
* A program for processing fragments
|
|
442
|
+
*/
|
|
443
|
+
FRAGMENT,
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Represents how draw should affect the two buffers
|
|
447
|
+
* of a stereo framebuffer. See cogl_framebuffer_set_stereo_mode().
|
|
448
|
+
*/
|
|
449
|
+
enum StereoMode {
|
|
450
|
+
/**
|
|
451
|
+
* draw to both stereo buffers
|
|
452
|
+
*/
|
|
453
|
+
BOTH,
|
|
454
|
+
/**
|
|
455
|
+
* draw only to the left stereo buffer
|
|
456
|
+
*/
|
|
457
|
+
LEFT,
|
|
458
|
+
/**
|
|
459
|
+
* draw only to the left stereo buffer
|
|
460
|
+
*/
|
|
461
|
+
RIGHT,
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Error enumeration for Cogl
|
|
465
|
+
*
|
|
466
|
+
* The `COGL_SYSTEM_ERROR_UNSUPPORTED` error can be thrown for a
|
|
467
|
+
* variety of reasons. For example:
|
|
468
|
+
*
|
|
469
|
+
* <itemizedlist>
|
|
470
|
+
* <listitem><para>You've tried to use a feature that is not
|
|
471
|
+
* advertised by cogl_has_feature().</para></listitem>
|
|
472
|
+
* <listitem><para>The GPU can not handle the configuration you have
|
|
473
|
+
* requested. An example might be if you try to use too many texture
|
|
474
|
+
* layers in a single #CoglPipeline</para></listitem>
|
|
475
|
+
* <listitem><para>The driver does not support some
|
|
476
|
+
* configuration.</para></listiem>
|
|
477
|
+
* </itemizedlist>
|
|
478
|
+
*
|
|
479
|
+
* Currently this is only used by Cogl API marked as experimental so
|
|
480
|
+
* this enum should also be considered experimental.
|
|
481
|
+
*/
|
|
482
|
+
enum SystemError {
|
|
483
|
+
/**
|
|
484
|
+
* You tried to use a feature or
|
|
485
|
+
* configuration not currently available.
|
|
486
|
+
*/
|
|
487
|
+
UNSUPPORTED,
|
|
488
|
+
/**
|
|
489
|
+
* You tried to allocate a resource
|
|
490
|
+
* such as a texture and there wasn't enough memory.
|
|
491
|
+
*/
|
|
492
|
+
NO_MEMORY,
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* See cogl_texture_set_components().
|
|
496
|
+
*/
|
|
497
|
+
enum TextureComponents {
|
|
498
|
+
/**
|
|
499
|
+
* Only the alpha component
|
|
500
|
+
*/
|
|
501
|
+
A,
|
|
502
|
+
/**
|
|
503
|
+
* Red and green components. Note that
|
|
504
|
+
* this can only be used if the %COGL_FEATURE_ID_TEXTURE_RG feature
|
|
505
|
+
* is advertised.
|
|
506
|
+
*/
|
|
507
|
+
RG,
|
|
508
|
+
/**
|
|
509
|
+
* Red, green and blue components
|
|
510
|
+
*/
|
|
511
|
+
RGB,
|
|
512
|
+
/**
|
|
513
|
+
* Red, green, blue and alpha components
|
|
514
|
+
*/
|
|
515
|
+
RGBA,
|
|
516
|
+
/**
|
|
517
|
+
* Only a depth component
|
|
518
|
+
*/
|
|
519
|
+
DEPTH,
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Error codes that can be thrown when allocating textures.
|
|
523
|
+
*/
|
|
524
|
+
enum TextureError {
|
|
525
|
+
/**
|
|
526
|
+
* Unsupported size
|
|
527
|
+
*/
|
|
528
|
+
SIZE,
|
|
529
|
+
/**
|
|
530
|
+
* Unsupported format
|
|
531
|
+
*/
|
|
532
|
+
FORMAT,
|
|
533
|
+
BAD_PARAMETER,
|
|
534
|
+
/**
|
|
535
|
+
* A primitive texture type that is
|
|
536
|
+
* unsupported by the driver was used
|
|
537
|
+
*/
|
|
538
|
+
TYPE,
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Different ways of interpreting vertices when drawing.
|
|
542
|
+
*/
|
|
543
|
+
enum VerticesMode {
|
|
544
|
+
/**
|
|
545
|
+
* FIXME, equivalent to
|
|
546
|
+
* <constant>GL_POINTS</constant>
|
|
547
|
+
*/
|
|
548
|
+
POINTS,
|
|
549
|
+
/**
|
|
550
|
+
* FIXME, equivalent to <constant>GL_LINES</constant>
|
|
551
|
+
*/
|
|
552
|
+
LINES,
|
|
553
|
+
/**
|
|
554
|
+
* FIXME, equivalent to
|
|
555
|
+
* <constant>GL_LINE_LOOP</constant>
|
|
556
|
+
*/
|
|
557
|
+
LINE_LOOP,
|
|
558
|
+
/**
|
|
559
|
+
* FIXME, equivalent to
|
|
560
|
+
* <constant>GL_LINE_STRIP</constant>
|
|
561
|
+
*/
|
|
562
|
+
LINE_STRIP,
|
|
563
|
+
/**
|
|
564
|
+
* FIXME, equivalent to
|
|
565
|
+
* <constant>GL_TRIANGLES</constant>
|
|
566
|
+
*/
|
|
567
|
+
TRIANGLES,
|
|
568
|
+
/**
|
|
569
|
+
* FIXME, equivalent to
|
|
570
|
+
* <constant>GL_TRIANGLE_STRIP</constant>
|
|
571
|
+
*/
|
|
572
|
+
TRIANGLE_STRIP,
|
|
573
|
+
/**
|
|
574
|
+
* FIXME, equivalent to <constant>GL_TRIANGLE_FAN</constant>
|
|
575
|
+
*/
|
|
576
|
+
TRIANGLE_FAN,
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Enum used to represent the two directions of rotation. This can be
|
|
580
|
+
* used to set the front face for culling by calling
|
|
581
|
+
* cogl_pipeline_set_front_face_winding().
|
|
582
|
+
*/
|
|
583
|
+
enum Winding {
|
|
584
|
+
/**
|
|
585
|
+
* Vertices are in a clockwise order
|
|
586
|
+
*/
|
|
587
|
+
CLOCKWISE,
|
|
588
|
+
/**
|
|
589
|
+
* Vertices are in a counter-clockwise order
|
|
590
|
+
*/
|
|
591
|
+
COUNTER_CLOCKWISE,
|
|
592
|
+
}
|
|
593
|
+
enum WinsysFeature {
|
|
594
|
+
VBLANK_COUNTER,
|
|
595
|
+
VBLANK_WAIT,
|
|
596
|
+
TEXTURE_FROM_PIXMAP,
|
|
597
|
+
SWAP_BUFFERS_EVENT,
|
|
598
|
+
SWAP_REGION,
|
|
599
|
+
SWAP_REGION_THROTTLE,
|
|
600
|
+
SWAP_REGION_SYNCHRONIZED,
|
|
601
|
+
BUFFER_AGE,
|
|
602
|
+
SYNC_AND_COMPLETE_EVENT,
|
|
603
|
+
N_FEATURES,
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Types of auxiliary buffers
|
|
607
|
+
* @bitfield
|
|
608
|
+
*/
|
|
609
|
+
enum BufferBit {
|
|
610
|
+
/**
|
|
611
|
+
* Selects the primary color buffer
|
|
612
|
+
*/
|
|
613
|
+
COLOR,
|
|
614
|
+
/**
|
|
615
|
+
* Selects the depth buffer
|
|
616
|
+
*/
|
|
617
|
+
DEPTH,
|
|
618
|
+
/**
|
|
619
|
+
* Selects the stencil buffer
|
|
620
|
+
*/
|
|
621
|
+
STENCIL,
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Target flags for FBOs.
|
|
625
|
+
* @bitfield
|
|
626
|
+
*/
|
|
627
|
+
enum BufferTarget {
|
|
628
|
+
/**
|
|
629
|
+
* FIXME
|
|
630
|
+
*/
|
|
631
|
+
WINDOW_BUFFER,
|
|
632
|
+
/**
|
|
633
|
+
* FIXME
|
|
634
|
+
*/
|
|
635
|
+
OFFSCREEN_BUFFER,
|
|
636
|
+
}
|
|
637
|
+
enum EglImageFlags {
|
|
638
|
+
NONE,
|
|
639
|
+
NO_GET_DATA,
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Pixel formats used by Cogl. For the formats with a byte per
|
|
643
|
+
* component, the order of the components specify the order in
|
|
644
|
+
* increasing memory addresses. So for example
|
|
645
|
+
* %COGL_PIXEL_FORMAT_RGB_888 would have the red component in the
|
|
646
|
+
* lowest address, green in the next address and blue after that
|
|
647
|
+
* regardless of the endianness of the system.
|
|
648
|
+
*
|
|
649
|
+
* For the formats with non byte aligned components the component
|
|
650
|
+
* order specifies the order within a 16-bit or 32-bit number from
|
|
651
|
+
* most significant bit to least significant. So for
|
|
652
|
+
* %COGL_PIXEL_FORMAT_RGB_565, the red component would be in bits
|
|
653
|
+
* 11-15, the green component would be in 6-11 and the blue component
|
|
654
|
+
* would be in 1-5. Therefore the order in memory depends on the
|
|
655
|
+
* endianness of the system.
|
|
656
|
+
*
|
|
657
|
+
* When uploading a texture %COGL_PIXEL_FORMAT_ANY can be used as the
|
|
658
|
+
* internal format. Cogl will try to pick the best format to use
|
|
659
|
+
* internally and convert the texture data if necessary.
|
|
660
|
+
* @bitfield
|
|
661
|
+
*/
|
|
662
|
+
enum PixelFormat {
|
|
663
|
+
/**
|
|
664
|
+
* Any format
|
|
665
|
+
*/
|
|
666
|
+
ANY,
|
|
667
|
+
/**
|
|
668
|
+
* 8 bits alpha mask
|
|
669
|
+
*/
|
|
670
|
+
A_8,
|
|
671
|
+
/**
|
|
672
|
+
* RGB, 16 bits
|
|
673
|
+
*/
|
|
674
|
+
RGB_565,
|
|
675
|
+
/**
|
|
676
|
+
* RGBA, 16 bits
|
|
677
|
+
*/
|
|
678
|
+
RGBA_4444,
|
|
679
|
+
/**
|
|
680
|
+
* RGBA, 16 bits
|
|
681
|
+
*/
|
|
682
|
+
RGBA_5551,
|
|
683
|
+
/**
|
|
684
|
+
* Not currently supported
|
|
685
|
+
*/
|
|
686
|
+
YUV,
|
|
687
|
+
/**
|
|
688
|
+
* Single luminance component
|
|
689
|
+
*/
|
|
690
|
+
G_8,
|
|
691
|
+
/**
|
|
692
|
+
* RG, 16 bits. Note that red-green textures
|
|
693
|
+
* are only available if %COGL_FEATURE_ID_TEXTURE_RG is advertised.
|
|
694
|
+
* See cogl_texture_set_components() for details.
|
|
695
|
+
*/
|
|
696
|
+
RG_88,
|
|
697
|
+
/**
|
|
698
|
+
* RGB, 24 bits
|
|
699
|
+
*/
|
|
700
|
+
RGB_888,
|
|
701
|
+
/**
|
|
702
|
+
* BGR, 24 bits
|
|
703
|
+
*/
|
|
704
|
+
BGR_888,
|
|
705
|
+
/**
|
|
706
|
+
* RGBA, 32 bits
|
|
707
|
+
*/
|
|
708
|
+
RGBA_8888,
|
|
709
|
+
/**
|
|
710
|
+
* BGRA, 32 bits
|
|
711
|
+
*/
|
|
712
|
+
BGRA_8888,
|
|
713
|
+
/**
|
|
714
|
+
* ARGB, 32 bits
|
|
715
|
+
*/
|
|
716
|
+
ARGB_8888,
|
|
717
|
+
/**
|
|
718
|
+
* ABGR, 32 bits
|
|
719
|
+
*/
|
|
720
|
+
ABGR_8888,
|
|
721
|
+
/**
|
|
722
|
+
* RGBA, 32 bits, 10 bpc
|
|
723
|
+
*/
|
|
724
|
+
RGBA_1010102,
|
|
725
|
+
/**
|
|
726
|
+
* BGRA, 32 bits, 10 bpc
|
|
727
|
+
*/
|
|
728
|
+
BGRA_1010102,
|
|
729
|
+
XRGB_2101010,
|
|
730
|
+
/**
|
|
731
|
+
* ARGB, 32 bits, 10 bpc
|
|
732
|
+
*/
|
|
733
|
+
ARGB_2101010,
|
|
734
|
+
XBGR_2101010,
|
|
735
|
+
/**
|
|
736
|
+
* ABGR, 32 bits, 10 bpc
|
|
737
|
+
*/
|
|
738
|
+
ABGR_2101010,
|
|
739
|
+
/**
|
|
740
|
+
* RGBA half floating point, 64 bit
|
|
741
|
+
*/
|
|
742
|
+
RGBA_FP_16161616,
|
|
743
|
+
/**
|
|
744
|
+
* BGRA half floating point, 64 bit
|
|
745
|
+
*/
|
|
746
|
+
BGRA_FP_16161616,
|
|
747
|
+
XRGB_FP_16161616,
|
|
748
|
+
/**
|
|
749
|
+
* ARGB half floating point, 64 bit
|
|
750
|
+
*/
|
|
751
|
+
ARGB_FP_16161616,
|
|
752
|
+
XBGR_FP_16161616,
|
|
753
|
+
/**
|
|
754
|
+
* ABGR half floating point, 64 bit
|
|
755
|
+
*/
|
|
756
|
+
ABGR_FP_16161616,
|
|
757
|
+
/**
|
|
758
|
+
* Premultiplied RGBA, 32 bits
|
|
759
|
+
*/
|
|
760
|
+
RGBA_8888_PRE,
|
|
761
|
+
/**
|
|
762
|
+
* Premultiplied BGRA, 32 bits
|
|
763
|
+
*/
|
|
764
|
+
BGRA_8888_PRE,
|
|
765
|
+
/**
|
|
766
|
+
* Premultiplied ARGB, 32 bits
|
|
767
|
+
*/
|
|
768
|
+
ARGB_8888_PRE,
|
|
769
|
+
/**
|
|
770
|
+
* Premultiplied ABGR, 32 bits
|
|
771
|
+
*/
|
|
772
|
+
ABGR_8888_PRE,
|
|
773
|
+
/**
|
|
774
|
+
* Premultiplied RGBA, 16 bits
|
|
775
|
+
*/
|
|
776
|
+
RGBA_4444_PRE,
|
|
777
|
+
/**
|
|
778
|
+
* Premultiplied RGBA, 16 bits
|
|
779
|
+
*/
|
|
780
|
+
RGBA_5551_PRE,
|
|
781
|
+
/**
|
|
782
|
+
* Premultiplied RGBA, 32 bits, 10 bpc
|
|
783
|
+
*/
|
|
784
|
+
RGBA_1010102_PRE,
|
|
785
|
+
/**
|
|
786
|
+
* Premultiplied BGRA, 32 bits, 10 bpc
|
|
787
|
+
*/
|
|
788
|
+
BGRA_1010102_PRE,
|
|
789
|
+
/**
|
|
790
|
+
* Premultiplied ARGB, 32 bits, 10 bpc
|
|
791
|
+
*/
|
|
792
|
+
ARGB_2101010_PRE,
|
|
793
|
+
/**
|
|
794
|
+
* Premultiplied ABGR, 32 bits, 10 bpc
|
|
795
|
+
*/
|
|
796
|
+
ABGR_2101010_PRE,
|
|
797
|
+
/**
|
|
798
|
+
* Premultiplied RGBA half floating point, 64 bit
|
|
799
|
+
*/
|
|
800
|
+
RGBA_FP_16161616_PRE,
|
|
801
|
+
/**
|
|
802
|
+
* Premultiplied BGRA half floating point, 64 bit
|
|
803
|
+
*/
|
|
804
|
+
BGRA_FP_16161616_PRE,
|
|
805
|
+
/**
|
|
806
|
+
* Premultiplied ARGB half floating point, 64 bit
|
|
807
|
+
*/
|
|
808
|
+
ARGB_FP_16161616_PRE,
|
|
809
|
+
/**
|
|
810
|
+
* Premultiplied ABGR half floating point, 64 bit
|
|
811
|
+
*/
|
|
812
|
+
ABGR_FP_16161616_PRE,
|
|
813
|
+
DEPTH_16,
|
|
814
|
+
DEPTH_32,
|
|
815
|
+
DEPTH_24_STENCIL_8,
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Flags for cogl_framebuffer_read_pixels_into_bitmap()
|
|
819
|
+
* @bitfield
|
|
820
|
+
*/
|
|
821
|
+
enum ReadPixelsFlags {
|
|
822
|
+
/**
|
|
823
|
+
* Read from the color buffer
|
|
824
|
+
*/
|
|
825
|
+
READ_PIXELS_COLOR_BUFFER,
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* Flags to pass to the cogl_texture_new_* family of functions.
|
|
829
|
+
* @bitfield
|
|
830
|
+
*/
|
|
831
|
+
enum TextureFlags {
|
|
832
|
+
/**
|
|
833
|
+
* No flags specified
|
|
834
|
+
*/
|
|
835
|
+
NONE,
|
|
836
|
+
/**
|
|
837
|
+
* Disables the automatic generation of
|
|
838
|
+
* the mipmap pyramid from the base level image whenever it is
|
|
839
|
+
* updated. The mipmaps are only generated when the texture is
|
|
840
|
+
* rendered with a mipmap filter so it should be free to leave out
|
|
841
|
+
* this flag when using other filtering modes
|
|
842
|
+
*/
|
|
843
|
+
NO_AUTO_MIPMAP,
|
|
844
|
+
/**
|
|
845
|
+
* Disables the slicing of the texture
|
|
846
|
+
*/
|
|
847
|
+
NO_SLICING,
|
|
848
|
+
/**
|
|
849
|
+
* Disables the insertion of the texture inside
|
|
850
|
+
* the texture atlas used by Cogl
|
|
851
|
+
*/
|
|
852
|
+
NO_ATLAS,
|
|
853
|
+
}
|
|
854
|
+
const AFIRST_BIT: number
|
|
855
|
+
const A_BIT: number
|
|
856
|
+
const BGR_BIT: number
|
|
857
|
+
const DEPTH_BIT: number
|
|
858
|
+
/**
|
|
859
|
+
* The maximum number of planes of a pixel format (see also
|
|
860
|
+
* cogl_pixel_format_get_planes()).
|
|
861
|
+
*/
|
|
862
|
+
const PIXEL_FORMAT_MAX_PLANES: number
|
|
863
|
+
const PREMULT_BIT: number
|
|
864
|
+
const STENCIL_BIT: number
|
|
865
|
+
const TEXTURE_MAX_WASTE: number
|
|
866
|
+
function blend_string_error_quark(): number
|
|
867
|
+
/**
|
|
868
|
+
* `return` FALSE for an immediately detected error, TRUE otherwise.
|
|
869
|
+
*
|
|
870
|
+
* This blits a region of the color buffer of the source buffer
|
|
871
|
+
* to the destination buffer. This function should only be
|
|
872
|
+
* called if the COGL_FEATURE_ID_BLIT_FRAMEBUFFER feature is
|
|
873
|
+
* advertised.
|
|
874
|
+
*
|
|
875
|
+
* The source and destination rectangles are defined in offscreen
|
|
876
|
+
* framebuffer orientation. When copying between an offscreen and
|
|
877
|
+
* onscreen framebuffers, the image is y-flipped accordingly.
|
|
878
|
+
*
|
|
879
|
+
* The two buffers must have the same value types (e.g. floating-point,
|
|
880
|
+
* unsigned int, signed int, or fixed-point), but color formats do not
|
|
881
|
+
* need to match. This limitation comes from OpenGL ES 3.0 definition
|
|
882
|
+
* of glBlitFramebuffer.
|
|
883
|
+
*
|
|
884
|
+
* Note that this function differs a lot from the glBlitFramebuffer
|
|
885
|
+
* function provided by the GL_EXT_framebuffer_blit extension. Notably
|
|
886
|
+
* it doesn't support having different sizes for the source and
|
|
887
|
+
* destination rectangle. This doesn't seem
|
|
888
|
+
* like a particularly useful feature. If the application wanted to
|
|
889
|
+
* scale the results it may make more sense to draw a primitive
|
|
890
|
+
* instead.
|
|
891
|
+
*
|
|
892
|
+
* The GL function is documented to be affected by the scissor. This
|
|
893
|
+
* function therefore ensure that an empty clip stack is flushed
|
|
894
|
+
* before performing the blit which means the scissor is effectively
|
|
895
|
+
* ignored.
|
|
896
|
+
*
|
|
897
|
+
* The function also doesn't support specifying the buffers to copy
|
|
898
|
+
* and instead only the color buffer is copied. When copying the depth
|
|
899
|
+
* or stencil buffers the extension on GLES2.0 only supports copying
|
|
900
|
+
* the full buffer which would be awkward to document with this
|
|
901
|
+
* API. If we wanted to support that feature it may be better to have
|
|
902
|
+
* a separate function to copy the entire buffer for a given mask.
|
|
903
|
+
*
|
|
904
|
+
* The `c` error argument is optional, it can be NULL. If it is not NULL
|
|
905
|
+
* and this function returns FALSE, an error object with a code from
|
|
906
|
+
* COGL_SYSTEM_ERROR will be created.
|
|
907
|
+
* @param framebuffer The source #CoglFramebuffer
|
|
908
|
+
* @param dst The destination #CoglFramebuffer
|
|
909
|
+
* @param src_x Source x position
|
|
910
|
+
* @param src_y Source y position
|
|
911
|
+
* @param dst_x Destination x position
|
|
912
|
+
* @param dst_y Destination y position
|
|
913
|
+
* @param width Width of region to copy
|
|
914
|
+
* @param height Height of region to copy
|
|
915
|
+
*/
|
|
916
|
+
function blit_framebuffer(framebuffer: Framebuffer, dst: Framebuffer, src_x: number, src_y: number, dst_x: number, dst_y: number, width: number, height: number): boolean
|
|
917
|
+
function clutter_winsys_has_feature_CLUTTER(feature: WinsysFeature): boolean
|
|
918
|
+
/**
|
|
919
|
+
* Compares two #CoglColor<!-- -->s and checks if they are the same.
|
|
920
|
+
*
|
|
921
|
+
* This function can be passed to g_hash_table_new() as the `key_equal_func`
|
|
922
|
+
* parameter, when using #CoglColor<!-- -->s as keys in a #GHashTable.
|
|
923
|
+
* @param v1 a #CoglColor
|
|
924
|
+
* @param v2 a #CoglColor
|
|
925
|
+
* @returns %TRUE if the two colors are the same.
|
|
926
|
+
*/
|
|
927
|
+
function color_equal(v1: any | null, v2: any | null): boolean
|
|
928
|
+
/**
|
|
929
|
+
* Converts a color expressed in HLS (hue, luminance and saturation)
|
|
930
|
+
* values into a #CoglColor.
|
|
931
|
+
* @param hue hue value, in the 0 .. 360 range
|
|
932
|
+
* @param saturation saturation value, in the 0 .. 1 range
|
|
933
|
+
* @param luminance luminance value, in the 0 .. 1 range
|
|
934
|
+
*/
|
|
935
|
+
function color_init_from_hsl(hue: number, saturation: number, luminance: number): /* color */ Color
|
|
936
|
+
/**
|
|
937
|
+
* Create a new cogl program object that can be used to replace parts of the GL
|
|
938
|
+
* rendering pipeline with custom code.
|
|
939
|
+
* @returns a new cogl program.
|
|
940
|
+
*/
|
|
941
|
+
function create_program(): Handle
|
|
942
|
+
/**
|
|
943
|
+
* Create a new shader handle, use cogl_shader_source() to set the
|
|
944
|
+
* source code to be used on it.
|
|
945
|
+
* @param shader_type COGL_SHADER_TYPE_VERTEX or COGL_SHADER_TYPE_FRAGMENT.
|
|
946
|
+
* @returns a new shader handle.
|
|
947
|
+
*/
|
|
948
|
+
function create_shader(shader_type: ShaderType): Handle
|
|
949
|
+
/**
|
|
950
|
+
* Invokes `func` once for each type of object that Cogl uses and
|
|
951
|
+
* passes a count of the number of objects for that type. This is
|
|
952
|
+
* intended to be used solely for debugging purposes to track down
|
|
953
|
+
* issues with objects leaking.
|
|
954
|
+
* @param func A callback function for each type
|
|
955
|
+
*/
|
|
956
|
+
function debug_object_foreach_type(func: DebugObjectForeachTypeCallback): void
|
|
957
|
+
/**
|
|
958
|
+
* Prints a list of all the object types that Cogl uses along with the
|
|
959
|
+
* number of objects of that type that are currently in use. This is
|
|
960
|
+
* intended to be used solely for debugging purposes to track down
|
|
961
|
+
* issues with objects leaking.
|
|
962
|
+
*/
|
|
963
|
+
function debug_object_print_instances(): void
|
|
964
|
+
/**
|
|
965
|
+
* This function should only need to be called in exceptional circumstances.
|
|
966
|
+
*
|
|
967
|
+
* As an optimization Cogl drawing functions may batch up primitives
|
|
968
|
+
* internally, so if you are trying to use raw GL outside of Cogl you stand a
|
|
969
|
+
* better chance of being successful if you ask Cogl to flush any batched
|
|
970
|
+
* geometry before making your state changes.
|
|
971
|
+
*
|
|
972
|
+
* It only ensure that the underlying driver is issued all the commands
|
|
973
|
+
* necessary to draw the batched primitives. It provides no guarantees about
|
|
974
|
+
* when the driver will complete the rendering.
|
|
975
|
+
*
|
|
976
|
+
* This provides no guarantees about the GL state upon returning and to avoid
|
|
977
|
+
* confusing Cogl you should aim to restore any changes you make before
|
|
978
|
+
* resuming use of Cogl.
|
|
979
|
+
*
|
|
980
|
+
* If you are making state changes with the intention of affecting Cogl drawing
|
|
981
|
+
* primitives you are 100% on your own since you stand a good chance of
|
|
982
|
+
* conflicting with Cogl internals. For example clutter-gst which currently
|
|
983
|
+
* uses direct GL calls to bind ARBfp programs will very likely break when Cogl
|
|
984
|
+
* starts to use ARBfb programs itself for the material API.
|
|
985
|
+
*/
|
|
986
|
+
function flush(): void
|
|
987
|
+
/**
|
|
988
|
+
* Iterates through all the context level features currently supported
|
|
989
|
+
* for a given `context` and for each feature `callback` is called.
|
|
990
|
+
* @param context A #CoglContext pointer
|
|
991
|
+
* @param callback A #CoglFeatureCallback called for each supported feature
|
|
992
|
+
*/
|
|
993
|
+
function foreach_feature(context: Context, callback: FeatureCallback): void
|
|
994
|
+
/**
|
|
995
|
+
* Returns the graphics reset status as reported by
|
|
996
|
+
* GetGraphicsResetStatusARB defined in the ARB_robustness extension.
|
|
997
|
+
*
|
|
998
|
+
* Note that Cogl doesn't normally enable the ARB_robustness
|
|
999
|
+
* extension in which case this will only ever return
|
|
1000
|
+
* #COGL_GRAPHICS_RESET_STATUS_NO_ERROR.
|
|
1001
|
+
*
|
|
1002
|
+
* Applications must explicitly use a backend specific method to
|
|
1003
|
+
* request that errors get reported such as X11's
|
|
1004
|
+
* cogl_xlib_renderer_request_reset_on_video_memory_purge().
|
|
1005
|
+
* @param context a #CoglContext pointer
|
|
1006
|
+
* @returns a #CoglGraphicsResetStatus
|
|
1007
|
+
*/
|
|
1008
|
+
function get_graphics_reset_status(context: Context): GraphicsResetStatus
|
|
1009
|
+
/**
|
|
1010
|
+
* Retrieves the #GOptionGroup used by Cogl to parse the command
|
|
1011
|
+
* line options. Clutter uses this to handle the Cogl command line
|
|
1012
|
+
* options during its initialization process.
|
|
1013
|
+
* @returns a #GOptionGroup
|
|
1014
|
+
*/
|
|
1015
|
+
function get_option_group(): GLib.OptionGroup
|
|
1016
|
+
function handle_get_type(): GObject.GType
|
|
1017
|
+
/**
|
|
1018
|
+
* Checks if a given `feature` is currently available
|
|
1019
|
+
*
|
|
1020
|
+
* Cogl does not aim to be a lowest common denominator API, it aims to
|
|
1021
|
+
* expose all the interesting features of GPUs to application which
|
|
1022
|
+
* means applications have some responsibility to explicitly check
|
|
1023
|
+
* that certain features are available before depending on them.
|
|
1024
|
+
* @param context A #CoglContext pointer
|
|
1025
|
+
* @param feature A #CoglFeatureID
|
|
1026
|
+
* @returns %TRUE if the @feature is currently supported or %FALSE if not.
|
|
1027
|
+
*/
|
|
1028
|
+
function has_feature(context: Context, feature: FeatureID): boolean
|
|
1029
|
+
/**
|
|
1030
|
+
* Checks whether `object` is a #CoglBitmap
|
|
1031
|
+
* @param object a #CoglObject pointer
|
|
1032
|
+
* @returns %TRUE if the passed @object represents a bitmap, and %FALSE otherwise
|
|
1033
|
+
*/
|
|
1034
|
+
function is_bitmap(object: any | null): boolean
|
|
1035
|
+
/**
|
|
1036
|
+
* Gets whether the given object references an existing context object.
|
|
1037
|
+
* @param object An object or %NULL
|
|
1038
|
+
* @returns %TRUE if the @object references a #CoglContext, %FALSE otherwise
|
|
1039
|
+
*/
|
|
1040
|
+
function is_context(object: any | null): boolean
|
|
1041
|
+
/**
|
|
1042
|
+
* Gets whether the given object references a #CoglFrameInfo.
|
|
1043
|
+
* @param object A #CoglObject pointer
|
|
1044
|
+
* @returns %TRUE if the object references a #CoglFrameInfo and %FALSE otherwise.
|
|
1045
|
+
*/
|
|
1046
|
+
function is_frame_info(object: any | null): boolean
|
|
1047
|
+
/**
|
|
1048
|
+
* Gets whether the given object references a #CoglFramebuffer.
|
|
1049
|
+
* @param object A #CoglObject pointer
|
|
1050
|
+
* @returns %TRUE if the object references a #CoglFramebuffer and %FALSE otherwise.
|
|
1051
|
+
*/
|
|
1052
|
+
function is_framebuffer(object: any | null): boolean
|
|
1053
|
+
/**
|
|
1054
|
+
* Gets whether the given `object` references an existing pipeline object.
|
|
1055
|
+
* @param object A #CoglObject
|
|
1056
|
+
* @returns %TRUE if the @object references a #CoglPipeline, %FALSE otherwise
|
|
1057
|
+
*/
|
|
1058
|
+
function is_pipeline(object: any | null): boolean
|
|
1059
|
+
/**
|
|
1060
|
+
* Gets whether the given handle references an existing program object.
|
|
1061
|
+
* @param handle A CoglHandle
|
|
1062
|
+
* @returns %TRUE if the handle references a program, %FALSE otherwise
|
|
1063
|
+
*/
|
|
1064
|
+
function is_program(handle: Handle): boolean
|
|
1065
|
+
/**
|
|
1066
|
+
* Gets whether the given handle references an existing shader object.
|
|
1067
|
+
* @param handle A CoglHandle
|
|
1068
|
+
* @returns %TRUE if the handle references a shader, %FALSE otherwise
|
|
1069
|
+
*/
|
|
1070
|
+
function is_shader(handle: Handle): boolean
|
|
1071
|
+
/**
|
|
1072
|
+
* Gets whether the given object references a texture object.
|
|
1073
|
+
* @param object A #CoglObject pointer
|
|
1074
|
+
* @returns %TRUE if the @object references a texture, and %FALSE otherwise
|
|
1075
|
+
*/
|
|
1076
|
+
function is_texture(object: any | null): boolean
|
|
1077
|
+
/**
|
|
1078
|
+
* Gets whether the given object references an existing #CoglTexture2D
|
|
1079
|
+
* object.
|
|
1080
|
+
* @param object A #CoglObject
|
|
1081
|
+
* @returns %TRUE if the object references a #CoglTexture2D, %FALSE otherwise
|
|
1082
|
+
*/
|
|
1083
|
+
function is_texture_2d(object: any | null): boolean
|
|
1084
|
+
/**
|
|
1085
|
+
* Gets whether the given object references a #CoglTexture2DSliced.
|
|
1086
|
+
* @param object A #CoglObject pointer
|
|
1087
|
+
* @returns %TRUE if the object references a #CoglTexture2DSliced and %FALSE otherwise.
|
|
1088
|
+
*/
|
|
1089
|
+
function is_texture_2d_sliced(object: any | null): boolean
|
|
1090
|
+
/**
|
|
1091
|
+
* Queries the number of bytes per pixel for a given format in the given plane.
|
|
1092
|
+
* @param format The pixel format
|
|
1093
|
+
* @param plane The index of the plane (should not be more than the number of planes in the given format).
|
|
1094
|
+
* @returns The number of bytes per pixel in the given format's given plane.
|
|
1095
|
+
*/
|
|
1096
|
+
function pixel_format_get_bytes_per_pixel(format: PixelFormat, plane: number): number
|
|
1097
|
+
/**
|
|
1098
|
+
* Returns the number of planes the given CoglPixelFormat specifies.
|
|
1099
|
+
* @param format The format for which to get the number of planes
|
|
1100
|
+
* @returns The no. of planes of @format (at most %COGL_PIXEL_FORMAT_MAX_PLANES)
|
|
1101
|
+
*/
|
|
1102
|
+
function pixel_format_get_n_planes(format: PixelFormat): number
|
|
1103
|
+
/**
|
|
1104
|
+
* Returns a string representation of `format,` useful for debugging purposes.
|
|
1105
|
+
* @param format a #CoglPixelFormat
|
|
1106
|
+
* @returns A string representation of @format.
|
|
1107
|
+
*/
|
|
1108
|
+
function pixel_format_to_string(format: PixelFormat): string | null
|
|
1109
|
+
/**
|
|
1110
|
+
* Attaches a shader to a program object. A program can have multiple
|
|
1111
|
+
* vertex or fragment shaders but only one of them may provide a
|
|
1112
|
+
* main() function. It is allowed to use a program with only a vertex
|
|
1113
|
+
* shader or only a fragment shader.
|
|
1114
|
+
* @param program_handle a #CoglHandle for a shdaer program.
|
|
1115
|
+
* @param shader_handle a #CoglHandle for a vertex of fragment shader.
|
|
1116
|
+
*/
|
|
1117
|
+
function program_attach_shader(program_handle: Handle, shader_handle: Handle): void
|
|
1118
|
+
/**
|
|
1119
|
+
* Retrieve the location (offset) of a uniform variable in a shader program,
|
|
1120
|
+
* a uniform is a variable that is constant for all vertices/fragments for a
|
|
1121
|
+
* shader object and is possible to modify as an external parameter.
|
|
1122
|
+
* @param handle a #CoglHandle for a shader program.
|
|
1123
|
+
* @param uniform_name the name of a uniform.
|
|
1124
|
+
* @returns the offset of a uniform in a specified program.
|
|
1125
|
+
*/
|
|
1126
|
+
function program_get_uniform_location(handle: Handle, uniform_name: string | null): number
|
|
1127
|
+
/**
|
|
1128
|
+
* Links a program making it ready for use. Note that calling this
|
|
1129
|
+
* function is optional. If it is not called the program will
|
|
1130
|
+
* automatically be linked the first time it is used.
|
|
1131
|
+
* @param handle a #CoglHandle for a shader program.
|
|
1132
|
+
*/
|
|
1133
|
+
function program_link(handle: Handle): void
|
|
1134
|
+
/**
|
|
1135
|
+
* Changes the value of a floating point uniform for the given linked
|
|
1136
|
+
* `program`.
|
|
1137
|
+
* @param program A #CoglHandle for a linked program
|
|
1138
|
+
* @param uniform_location the uniform location retrieved from cogl_program_get_uniform_location().
|
|
1139
|
+
* @param value the new value of the uniform.
|
|
1140
|
+
*/
|
|
1141
|
+
function program_set_uniform_1f(program: Handle, uniform_location: number, value: number): void
|
|
1142
|
+
/**
|
|
1143
|
+
* Changes the value of an integer uniform for the given linked
|
|
1144
|
+
* `program`.
|
|
1145
|
+
* @param program A #CoglHandle for a linked program
|
|
1146
|
+
* @param uniform_location the uniform location retrieved from cogl_program_get_uniform_location().
|
|
1147
|
+
* @param value the new value of the uniform.
|
|
1148
|
+
*/
|
|
1149
|
+
function program_set_uniform_1i(program: Handle, uniform_location: number, value: number): void
|
|
1150
|
+
/**
|
|
1151
|
+
* Changes the value of a float vector uniform, or uniform array for
|
|
1152
|
+
* the given linked `program`.
|
|
1153
|
+
* @param program A #CoglHandle for a linked program
|
|
1154
|
+
* @param uniform_location the uniform location retrieved from cogl_program_get_uniform_location().
|
|
1155
|
+
* @param n_components The number of components for the uniform. For example with glsl you'd use 3 for a vec3 or 4 for a vec4.
|
|
1156
|
+
* @param value the new value of the uniform[s].
|
|
1157
|
+
*/
|
|
1158
|
+
function program_set_uniform_float(program: Handle, uniform_location: number, n_components: number, value: number[]): void
|
|
1159
|
+
/**
|
|
1160
|
+
* Changes the value of a int vector uniform, or uniform array for
|
|
1161
|
+
* the given linked `program`.
|
|
1162
|
+
* @param program A #CoglHandle for a linked program
|
|
1163
|
+
* @param uniform_location the uniform location retrieved from cogl_program_get_uniform_location().
|
|
1164
|
+
* @param n_components The number of components for the uniform. For example with glsl you'd use 3 for a vec3 or 4 for a vec4.
|
|
1165
|
+
* @param value the new value of the uniform[s].
|
|
1166
|
+
*/
|
|
1167
|
+
function program_set_uniform_int(program: Handle, uniform_location: number, n_components: number, value: number[]): void
|
|
1168
|
+
/**
|
|
1169
|
+
* Changes the value of a matrix uniform, or uniform array in the
|
|
1170
|
+
* given linked `program`.
|
|
1171
|
+
* @param program A #CoglHandle for a linked program
|
|
1172
|
+
* @param uniform_location the uniform location retrieved from cogl_program_get_uniform_location().
|
|
1173
|
+
* @param dimensions The dimensions of the matrix. So for for example pass 2 for a 2x2 matrix or 3 for 3x3.
|
|
1174
|
+
* @param transpose Whether to transpose the matrix when setting the uniform.
|
|
1175
|
+
* @param value the new value of the uniform.
|
|
1176
|
+
*/
|
|
1177
|
+
function program_set_uniform_matrix(program: Handle, uniform_location: number, dimensions: number, transpose: boolean, value: number[]): void
|
|
1178
|
+
function scanout_error_quark(): GLib.Quark
|
|
1179
|
+
function set_tracing_disabled_on_thread(main_context: GLib.MainContext): void
|
|
1180
|
+
function set_tracing_enabled_on_thread(main_context: GLib.MainContext, group: string | null, filename: string | null): void
|
|
1181
|
+
function set_tracing_enabled_on_thread_with_fd(main_context: GLib.MainContext, group: string | null, fd: number): void
|
|
1182
|
+
/**
|
|
1183
|
+
* Retrieves the type of a shader #CoglHandle
|
|
1184
|
+
* @param handle #CoglHandle for a shader.
|
|
1185
|
+
* @returns %COGL_SHADER_TYPE_VERTEX if the shader is a vertex processor or %COGL_SHADER_TYPE_FRAGMENT if the shader is a frament processor
|
|
1186
|
+
*/
|
|
1187
|
+
function shader_get_type(handle: Handle): ShaderType
|
|
1188
|
+
/**
|
|
1189
|
+
* Replaces the current source associated with a shader with a new
|
|
1190
|
+
* one.
|
|
1191
|
+
*
|
|
1192
|
+
* Please see <link
|
|
1193
|
+
* linkend="cogl-Shaders-and-Programmable-Pipeline.description">above</link>
|
|
1194
|
+
* for a description of the recommended format for the shader code.
|
|
1195
|
+
* @param shader #CoglHandle for a shader.
|
|
1196
|
+
* @param source Shader source.
|
|
1197
|
+
*/
|
|
1198
|
+
function shader_source(shader: Handle, source: string | null): void
|
|
1199
|
+
function texture_error_quark(): number
|
|
1200
|
+
/**
|
|
1201
|
+
* Creates a #CoglTexture from a #CoglBitmap.
|
|
1202
|
+
* @param bitmap A #CoglBitmap pointer
|
|
1203
|
+
* @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
|
|
1204
|
+
* @param internal_format the #CoglPixelFormat to use for the GPU storage of the texture
|
|
1205
|
+
* @returns A newly created #CoglTexture or %NULL on failure
|
|
1206
|
+
*/
|
|
1207
|
+
function texture_new_from_bitmap(bitmap: Bitmap, flags: TextureFlags, internal_format: PixelFormat): Texture
|
|
1208
|
+
/**
|
|
1209
|
+
* Creates a new #CoglTexture based on data residing in memory.
|
|
1210
|
+
* @param width width of texture in pixels
|
|
1211
|
+
* @param height height of texture in pixels
|
|
1212
|
+
* @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
|
|
1213
|
+
* @param format the #CoglPixelFormat the buffer is stored in in RAM
|
|
1214
|
+
* @param internal_format the #CoglPixelFormat that will be used for storing the buffer on the GPU. If COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending.
|
|
1215
|
+
* @param rowstride the memory offset in bytes between the starts of scanlines in `data`
|
|
1216
|
+
* @param data pointer the memory region where the source buffer resides
|
|
1217
|
+
* @returns A newly created #CoglTexture or %NULL on failure
|
|
1218
|
+
*/
|
|
1219
|
+
function texture_new_from_data(width: number, height: number, flags: TextureFlags, format: PixelFormat, internal_format: PixelFormat, rowstride: number, data: Uint8Array): Texture
|
|
1220
|
+
/**
|
|
1221
|
+
* Creates a #CoglTexture from an image file.
|
|
1222
|
+
* @param filename the file to load
|
|
1223
|
+
* @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
|
|
1224
|
+
* @param internal_format the #CoglPixelFormat to use for the GPU storage of the texture. If %COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending.
|
|
1225
|
+
* @returns A newly created #CoglTexture or %NULL on failure
|
|
1226
|
+
*/
|
|
1227
|
+
function texture_new_from_file(filename: string | null, flags: TextureFlags, internal_format: PixelFormat): Texture
|
|
1228
|
+
function trace_describe(head: TraceHead, description: string | null): void
|
|
1229
|
+
function trace_end(head: TraceHead): void
|
|
1230
|
+
/**
|
|
1231
|
+
* A callback function to use for cogl_debug_object_foreach_type().
|
|
1232
|
+
* @callback
|
|
1233
|
+
* @param info A pointer to a struct containing information about the type.
|
|
1234
|
+
*/
|
|
1235
|
+
interface DebugObjectForeachTypeCallback {
|
|
1236
|
+
(info: DebugObjectTypeInfo): void
|
|
1237
|
+
}
|
|
1238
|
+
/**
|
|
1239
|
+
* A callback used with cogl_foreach_feature() for enumerating all
|
|
1240
|
+
* context level features supported by Cogl.
|
|
1241
|
+
* @callback
|
|
1242
|
+
* @param feature A single feature currently supported by Cogl
|
|
1243
|
+
*/
|
|
1244
|
+
interface FeatureCallback {
|
|
1245
|
+
(feature: FeatureID): void
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
* Is a callback that can be registered via
|
|
1249
|
+
* cogl_onscreen_add_frame_callback() to be called when a frame
|
|
1250
|
+
* progresses in some notable way.
|
|
1251
|
+
*
|
|
1252
|
+
* Please see the documentation for #CoglFrameEvent and
|
|
1253
|
+
* cogl_onscreen_add_frame_callback() for more details about what
|
|
1254
|
+
* events can be notified.
|
|
1255
|
+
* @callback
|
|
1256
|
+
* @param onscreen The onscreen that the frame is associated with
|
|
1257
|
+
* @param event A #CoglFrameEvent notifying how the frame has progressed
|
|
1258
|
+
* @param info The meta information, such as timing information, about the frame that has progressed.
|
|
1259
|
+
*/
|
|
1260
|
+
interface FrameCallback {
|
|
1261
|
+
(onscreen: Onscreen, event: FrameEvent, info: FrameInfo): void
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
* Is a callback that can be registered via
|
|
1265
|
+
* cogl_onscreen_add_dirty_callback() to be called when the windowing
|
|
1266
|
+
* system determines that a region of the onscreen window has been
|
|
1267
|
+
* lost and the application should redraw it.
|
|
1268
|
+
* @callback
|
|
1269
|
+
* @param onscreen The onscreen that the frame is associated with
|
|
1270
|
+
* @param info A #CoglOnscreenDirtyInfo struct containing the details of the dirty area
|
|
1271
|
+
*/
|
|
1272
|
+
interface OnscreenDirtyCallback {
|
|
1273
|
+
(onscreen: Onscreen, info: OnscreenDirtyInfo): void
|
|
1274
|
+
}
|
|
1275
|
+
/**
|
|
1276
|
+
* The callback prototype used with cogl_pipeline_foreach_layer() for
|
|
1277
|
+
* iterating all the layers of a `pipeline`.
|
|
1278
|
+
* @callback
|
|
1279
|
+
* @param pipeline The #CoglPipeline whose layers are being iterated
|
|
1280
|
+
* @param layer_index The current layer index
|
|
1281
|
+
*/
|
|
1282
|
+
interface PipelineLayerCallback {
|
|
1283
|
+
(pipeline: Pipeline, layer_index: number): boolean
|
|
1284
|
+
}
|
|
1285
|
+
interface Texture2DEGLImageExternalAlloc {
|
|
1286
|
+
(tex_2d: Texture2D): boolean
|
|
1287
|
+
}
|
|
1288
|
+
module Texture {
|
|
1289
|
+
|
|
1290
|
+
// Constructor properties interface
|
|
1291
|
+
|
|
1292
|
+
interface ConstructorProperties extends Object.ConstructorProperties, GObject.Object.ConstructorProperties {
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
interface Texture extends Object {
|
|
1298
|
+
|
|
1299
|
+
// Owm methods of Cogl-10.Cogl.Texture
|
|
1300
|
+
|
|
1301
|
+
/**
|
|
1302
|
+
* Explicitly allocates the storage for the given `texture` which
|
|
1303
|
+
* allows you to be sure that there is enough memory for the
|
|
1304
|
+
* texture and if not then the error can be handled gracefully.
|
|
1305
|
+
*
|
|
1306
|
+
* <note>Normally applications don't need to use this api directly
|
|
1307
|
+
* since the texture will be implicitly allocated when data is set on
|
|
1308
|
+
* the texture, or if the texture is attached to a #CoglOffscreen
|
|
1309
|
+
* framebuffer and rendered too.</note>
|
|
1310
|
+
* @returns %TRUE if the texture was successfully allocated, otherwise %FALSE and @error will be updated if it wasn't %NULL.
|
|
1311
|
+
*/
|
|
1312
|
+
allocate(): boolean
|
|
1313
|
+
/**
|
|
1314
|
+
* Queries what components the given `texture` stores internally as set
|
|
1315
|
+
* via cogl_texture_set_components().
|
|
1316
|
+
*
|
|
1317
|
+
* For textures created by the ‘_with_size’ constructors the default
|
|
1318
|
+
* is %COGL_TEXTURE_COMPONENTS_RGBA. The other constructors which take
|
|
1319
|
+
* a %CoglBitmap or a data pointer default to the same components as
|
|
1320
|
+
* the pixel format of the data.
|
|
1321
|
+
*/
|
|
1322
|
+
get_components(): TextureComponents
|
|
1323
|
+
/**
|
|
1324
|
+
* Copies the pixel data from a cogl texture to system memory.
|
|
1325
|
+
*
|
|
1326
|
+
* <note>Don't pass the value of cogl_texture_get_rowstride() as the
|
|
1327
|
+
* `rowstride` argument, the rowstride should be the rowstride you
|
|
1328
|
+
* want for the destination `data` buffer not the rowstride of the
|
|
1329
|
+
* source texture</note>
|
|
1330
|
+
* @param format the #CoglPixelFormat to store the texture as.
|
|
1331
|
+
* @param rowstride the rowstride of `data` in bytes or pass 0 to calculate from the bytes-per-pixel of `format` multiplied by the `texture` width.
|
|
1332
|
+
* @param data memory location to write the `texture'`s contents, or %NULL to only query the data size through the return value.
|
|
1333
|
+
* @returns the size of the texture data in bytes
|
|
1334
|
+
*/
|
|
1335
|
+
get_data(format: PixelFormat, rowstride: number, data: Uint8Array | null): number
|
|
1336
|
+
|
|
1337
|
+
// Overloads of get_data
|
|
1338
|
+
|
|
1339
|
+
/**
|
|
1340
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
1341
|
+
* @param key name of the key for that association
|
|
1342
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
1343
|
+
*/
|
|
1344
|
+
get_data(key: string | null): any | null
|
|
1345
|
+
/**
|
|
1346
|
+
* Queries the GL handles for a GPU side texture through its #CoglTexture.
|
|
1347
|
+
*
|
|
1348
|
+
* If the texture is spliced the data for the first sub texture will be
|
|
1349
|
+
* queried.
|
|
1350
|
+
* @returns %TRUE if the handle was successfully retrieved, %FALSE if the handle was invalid
|
|
1351
|
+
*/
|
|
1352
|
+
get_gl_texture(): [ /* returnType */ boolean, /* out_gl_handle */ number, /* out_gl_target */ number ]
|
|
1353
|
+
/**
|
|
1354
|
+
* Queries the height of a cogl texture.
|
|
1355
|
+
* @returns the height of the GPU side texture in pixels
|
|
1356
|
+
*/
|
|
1357
|
+
get_height(): number
|
|
1358
|
+
/**
|
|
1359
|
+
* Queries the maximum wasted (unused) pixels in one dimension of a GPU side
|
|
1360
|
+
* texture.
|
|
1361
|
+
* @returns the maximum waste
|
|
1362
|
+
*/
|
|
1363
|
+
get_max_waste(): number
|
|
1364
|
+
/**
|
|
1365
|
+
* Queries the pre-multiplied alpha status for internally stored red,
|
|
1366
|
+
* green and blue components for the given `texture` as set by
|
|
1367
|
+
* cogl_texture_set_premultiplied().
|
|
1368
|
+
*
|
|
1369
|
+
* By default the pre-multipled state is `TRUE`.
|
|
1370
|
+
* @returns %TRUE if red, green and blue components are internally stored pre-multiplied by the alpha value or %FALSE if not.
|
|
1371
|
+
*/
|
|
1372
|
+
get_premultiplied(): boolean
|
|
1373
|
+
/**
|
|
1374
|
+
* Queries the width of a cogl texture.
|
|
1375
|
+
* @returns the width of the GPU side texture in pixels
|
|
1376
|
+
*/
|
|
1377
|
+
get_width(): number
|
|
1378
|
+
/**
|
|
1379
|
+
* Queries if a texture is sliced (stored as multiple GPU side tecture
|
|
1380
|
+
* objects).
|
|
1381
|
+
* @returns %TRUE if the texture is sliced, %FALSE if the texture is stored as a single GPU texture
|
|
1382
|
+
*/
|
|
1383
|
+
is_sliced(): boolean
|
|
1384
|
+
/**
|
|
1385
|
+
* Affects the internal storage format for this texture by specifying
|
|
1386
|
+
* what components will be required for sampling later.
|
|
1387
|
+
*
|
|
1388
|
+
* This api affects how data is uploaded to the GPU since unused
|
|
1389
|
+
* components can potentially be discarded from source data.
|
|
1390
|
+
*
|
|
1391
|
+
* For textures created by the ‘_with_size’ constructors the default
|
|
1392
|
+
* is %COGL_TEXTURE_COMPONENTS_RGBA. The other constructors which take
|
|
1393
|
+
* a %CoglBitmap or a data pointer default to the same components as
|
|
1394
|
+
* the pixel format of the data.
|
|
1395
|
+
*
|
|
1396
|
+
* Note that the %COGL_TEXTURE_COMPONENTS_RG format is not available
|
|
1397
|
+
* on all drivers. The availability can be determined by checking for
|
|
1398
|
+
* the %COGL_FEATURE_ID_TEXTURE_RG feature. If this format is used on
|
|
1399
|
+
* a driver where it is not available then %COGL_TEXTURE_ERROR_FORMAT
|
|
1400
|
+
* will be raised when the texture is allocated. Even if the feature
|
|
1401
|
+
* is not available then %COGL_PIXEL_FORMAT_RG_88 can still be used as
|
|
1402
|
+
* an image format as long as %COGL_TEXTURE_COMPONENTS_RG isn't used
|
|
1403
|
+
* as the texture's components.
|
|
1404
|
+
* @param components
|
|
1405
|
+
*/
|
|
1406
|
+
set_components(components: TextureComponents): void
|
|
1407
|
+
/**
|
|
1408
|
+
* `texture` a #CoglTexture.
|
|
1409
|
+
* Sets all the pixels for a given mipmap `level` by copying the pixel
|
|
1410
|
+
* data pointed to by the `data` argument into the given `texture`.
|
|
1411
|
+
*
|
|
1412
|
+
* `data` should point to the first pixel to copy corresponding
|
|
1413
|
+
* to the top left of the mipmap `level` being set.
|
|
1414
|
+
*
|
|
1415
|
+
* If `rowstride` equals 0 then it will be automatically calculated
|
|
1416
|
+
* from the width of the mipmap level and the bytes-per-pixel for the
|
|
1417
|
+
* given `format`.
|
|
1418
|
+
*
|
|
1419
|
+
* A mipmap `level` of 0 corresponds to the largest, base image of a
|
|
1420
|
+
* texture and `level` 1 is half the width and height of level 0. If
|
|
1421
|
+
* dividing any dimension of the previous level by two results in a
|
|
1422
|
+
* fraction then round the number down (floor()), but clamp to 1
|
|
1423
|
+
* something like this:
|
|
1424
|
+
*
|
|
1425
|
+
*
|
|
1426
|
+
* ```
|
|
1427
|
+
* next_width = MAX (1, floor (prev_width));
|
|
1428
|
+
* ```
|
|
1429
|
+
*
|
|
1430
|
+
*
|
|
1431
|
+
* You can determine the number of mipmap levels for a given texture
|
|
1432
|
+
* like this:
|
|
1433
|
+
*
|
|
1434
|
+
*
|
|
1435
|
+
* ```
|
|
1436
|
+
* n_levels = 1 + floor (log2 (max_dimension));
|
|
1437
|
+
* ```
|
|
1438
|
+
*
|
|
1439
|
+
*
|
|
1440
|
+
* Where %max_dimension is the larger of cogl_texture_get_width() and
|
|
1441
|
+
* cogl_texture_get_height().
|
|
1442
|
+
*
|
|
1443
|
+
* It is an error to pass a `level` number >= the number of levels that
|
|
1444
|
+
* `texture` can have according to the above calculation.
|
|
1445
|
+
*
|
|
1446
|
+
* <note>Since the storage for a #CoglTexture is allocated lazily then
|
|
1447
|
+
* if the given `texture` has not previously been allocated then this
|
|
1448
|
+
* api can return %FALSE and throw an exceptional `error` if there is
|
|
1449
|
+
* not enough memory to allocate storage for `texture`.</note>
|
|
1450
|
+
* @param format the #CoglPixelFormat used in the source `data` buffer.
|
|
1451
|
+
* @param rowstride rowstride of the source `data` buffer (computed from the texture width and `format` if it equals 0)
|
|
1452
|
+
* @param data the source data, pointing to the first top-left pixel to set
|
|
1453
|
+
* @param level The mipmap level to update (Normally 0 for the largest, base texture)
|
|
1454
|
+
* @returns %TRUE if the data upload was successful, and %FALSE otherwise
|
|
1455
|
+
*/
|
|
1456
|
+
set_data(format: PixelFormat, rowstride: number, data: Uint8Array, level: number): boolean
|
|
1457
|
+
|
|
1458
|
+
// Overloads of set_data
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
* Each object carries around a table of associations from
|
|
1462
|
+
* strings to pointers. This function lets you set an association.
|
|
1463
|
+
*
|
|
1464
|
+
* If the object already had an association with that name,
|
|
1465
|
+
* the old association will be destroyed.
|
|
1466
|
+
*
|
|
1467
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
1468
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
1469
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
1470
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
1471
|
+
* @param key name of the key
|
|
1472
|
+
* @param data data to associate with that key
|
|
1473
|
+
*/
|
|
1474
|
+
set_data(key: string | null, data: any | null): void
|
|
1475
|
+
/**
|
|
1476
|
+
* Affects the internal storage format for this texture by specifying
|
|
1477
|
+
* whether red, green and blue color components should be stored as
|
|
1478
|
+
* pre-multiplied alpha values.
|
|
1479
|
+
*
|
|
1480
|
+
* This api affects how data is uploaded to the GPU since Cogl will
|
|
1481
|
+
* convert source data to have premultiplied or unpremultiplied
|
|
1482
|
+
* components according to this state.
|
|
1483
|
+
*
|
|
1484
|
+
* For example if you create a texture via
|
|
1485
|
+
* cogl_texture_2d_new_with_size() and then upload data via
|
|
1486
|
+
* cogl_texture_set_data() passing a source format of
|
|
1487
|
+
* %COGL_PIXEL_FORMAT_RGBA_8888 then Cogl will internally multiply the
|
|
1488
|
+
* red, green and blue components of the source data by the alpha
|
|
1489
|
+
* component, for each pixel so that the internally stored data has
|
|
1490
|
+
* pre-multiplied alpha components. If you instead upload data that
|
|
1491
|
+
* already has pre-multiplied components by passing
|
|
1492
|
+
* %COGL_PIXEL_FORMAT_RGBA_8888_PRE as the source format to
|
|
1493
|
+
* cogl_texture_set_data() then the data can be uploaded without being
|
|
1494
|
+
* converted.
|
|
1495
|
+
*
|
|
1496
|
+
* By default the `premultipled` state is `TRUE`.
|
|
1497
|
+
* @param premultiplied Whether any internally stored red, green or blue components are pre-multiplied by an alpha component.
|
|
1498
|
+
*/
|
|
1499
|
+
set_premultiplied(premultiplied: boolean): void
|
|
1500
|
+
/**
|
|
1501
|
+
* Sets the pixels in a rectangular subregion of `texture` from an in-memory
|
|
1502
|
+
* buffer containing pixel data.
|
|
1503
|
+
*
|
|
1504
|
+
* <note>The region set can't be larger than the source `data<`/note>
|
|
1505
|
+
* @param src_x upper left coordinate to use from source data.
|
|
1506
|
+
* @param src_y upper left coordinate to use from source data.
|
|
1507
|
+
* @param dst_x upper left destination horizontal coordinate.
|
|
1508
|
+
* @param dst_y upper left destination vertical coordinate.
|
|
1509
|
+
* @param dst_width width of destination region to write. (Must be less than or equal to `width)`
|
|
1510
|
+
* @param dst_height height of destination region to write. (Must be less than or equal to `height)`
|
|
1511
|
+
* @param width width of source data buffer.
|
|
1512
|
+
* @param height height of source data buffer.
|
|
1513
|
+
* @param format the #CoglPixelFormat used in the source buffer.
|
|
1514
|
+
* @param rowstride rowstride of source buffer (computed from width if none specified)
|
|
1515
|
+
* @param data the actual pixel data.
|
|
1516
|
+
* @returns %TRUE if the subregion upload was successful, and %FALSE otherwise
|
|
1517
|
+
*/
|
|
1518
|
+
set_region(src_x: number, src_y: number, dst_x: number, dst_y: number, dst_width: number, dst_height: number, width: number, height: number, format: PixelFormat, rowstride: number, data: Uint8Array): boolean
|
|
1519
|
+
/**
|
|
1520
|
+
* Copies a specified source region from `bitmap` to the position
|
|
1521
|
+
* (`src_x,` `src_y)` of the given destination texture `handle`.
|
|
1522
|
+
*
|
|
1523
|
+
* <note>The region updated can't be larger than the source
|
|
1524
|
+
* bitmap</note>
|
|
1525
|
+
* @param src_x upper left coordinate to use from the source bitmap.
|
|
1526
|
+
* @param src_y upper left coordinate to use from the source bitmap
|
|
1527
|
+
* @param dst_x upper left destination horizontal coordinate.
|
|
1528
|
+
* @param dst_y upper left destination vertical coordinate.
|
|
1529
|
+
* @param dst_width width of destination region to write. (Must be less than or equal to the bitmap width)
|
|
1530
|
+
* @param dst_height height of destination region to write. (Must be less than or equal to the bitmap height)
|
|
1531
|
+
* @param bitmap The source bitmap to read from
|
|
1532
|
+
* @returns %TRUE if the subregion upload was successful, and %FALSE otherwise
|
|
1533
|
+
*/
|
|
1534
|
+
set_region_from_bitmap(src_x: number, src_y: number, dst_x: number, dst_y: number, dst_width: number, dst_height: number, bitmap: Bitmap): boolean
|
|
1535
|
+
|
|
1536
|
+
// Class property signals of Cogl-10.Cogl.Texture
|
|
1537
|
+
|
|
1538
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1539
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1540
|
+
emit(sigName: string, ...args: any[]): void
|
|
1541
|
+
disconnect(id: number): void
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
class Texture extends GObject.Object {
|
|
1545
|
+
|
|
1546
|
+
// Own properties of Cogl-10.Cogl.Texture
|
|
1547
|
+
|
|
1548
|
+
static name: string
|
|
1549
|
+
static $gtype: GObject.GType<Texture>
|
|
1550
|
+
|
|
1551
|
+
// Constructors of Cogl-10.Cogl.Texture
|
|
1552
|
+
|
|
1553
|
+
constructor(config?: Texture.ConstructorProperties)
|
|
1554
|
+
_init(config?: Texture.ConstructorProperties): void
|
|
1555
|
+
/**
|
|
1556
|
+
* Creates a #CoglTexture from a #CoglBitmap.
|
|
1557
|
+
* @param bitmap A #CoglBitmap pointer
|
|
1558
|
+
* @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
|
|
1559
|
+
* @param internal_format the #CoglPixelFormat to use for the GPU storage of the texture
|
|
1560
|
+
* @returns A newly created #CoglTexture or %NULL on failure
|
|
1561
|
+
*/
|
|
1562
|
+
static new_from_bitmap(bitmap: Bitmap, flags: TextureFlags, internal_format: PixelFormat): Texture
|
|
1563
|
+
/**
|
|
1564
|
+
* Creates a new #CoglTexture based on data residing in memory.
|
|
1565
|
+
* @param width width of texture in pixels
|
|
1566
|
+
* @param height height of texture in pixels
|
|
1567
|
+
* @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
|
|
1568
|
+
* @param format the #CoglPixelFormat the buffer is stored in in RAM
|
|
1569
|
+
* @param internal_format the #CoglPixelFormat that will be used for storing the buffer on the GPU. If COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending.
|
|
1570
|
+
* @param rowstride the memory offset in bytes between the starts of scanlines in `data`
|
|
1571
|
+
* @param data pointer the memory region where the source buffer resides
|
|
1572
|
+
* @returns A newly created #CoglTexture or %NULL on failure
|
|
1573
|
+
*/
|
|
1574
|
+
static new_from_data(width: number, height: number, flags: TextureFlags, format: PixelFormat, internal_format: PixelFormat, rowstride: number, data: Uint8Array): Texture
|
|
1575
|
+
/**
|
|
1576
|
+
* Creates a #CoglTexture from an image file.
|
|
1577
|
+
* @param filename the file to load
|
|
1578
|
+
* @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
|
|
1579
|
+
* @param internal_format the #CoglPixelFormat to use for the GPU storage of the texture. If %COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending.
|
|
1580
|
+
* @returns A newly created #CoglTexture or %NULL on failure
|
|
1581
|
+
*/
|
|
1582
|
+
static new_from_file(filename: string | null, flags: TextureFlags, internal_format: PixelFormat): Texture
|
|
1583
|
+
static error_quark(): number
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
module Bitmap {
|
|
1587
|
+
|
|
1588
|
+
// Constructor properties interface
|
|
1589
|
+
|
|
1590
|
+
interface ConstructorProperties extends Object.ConstructorProperties {
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
interface Bitmap {
|
|
1596
|
+
|
|
1597
|
+
// Owm methods of Cogl-10.Cogl.Bitmap
|
|
1598
|
+
|
|
1599
|
+
get_format(): PixelFormat
|
|
1600
|
+
get_height(): number
|
|
1601
|
+
get_rowstride(): number
|
|
1602
|
+
get_width(): number
|
|
1603
|
+
|
|
1604
|
+
// Class property signals of Cogl-10.Cogl.Bitmap
|
|
1605
|
+
|
|
1606
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1607
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1608
|
+
emit(sigName: string, ...args: any[]): void
|
|
1609
|
+
disconnect(id: number): void
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
class Bitmap extends Object {
|
|
1613
|
+
|
|
1614
|
+
// Own properties of Cogl-10.Cogl.Bitmap
|
|
1615
|
+
|
|
1616
|
+
static name: string
|
|
1617
|
+
static $gtype: GObject.GType<Bitmap>
|
|
1618
|
+
|
|
1619
|
+
// Constructors of Cogl-10.Cogl.Bitmap
|
|
1620
|
+
|
|
1621
|
+
constructor(config?: Bitmap.ConstructorProperties)
|
|
1622
|
+
/**
|
|
1623
|
+
* Loads an image file from disk. This function can be safely called from
|
|
1624
|
+
* within a thread.
|
|
1625
|
+
* @constructor
|
|
1626
|
+
* @param filename the file to load.
|
|
1627
|
+
* @returns a #CoglBitmap to the new loaded image data, or %NULL if loading the image failed.
|
|
1628
|
+
*/
|
|
1629
|
+
static new_from_file(filename: string | null): Bitmap
|
|
1630
|
+
_init(config?: Bitmap.ConstructorProperties): void
|
|
1631
|
+
static error_quark(): number
|
|
1632
|
+
/**
|
|
1633
|
+
* Parses an image file enough to extract the width and height
|
|
1634
|
+
* of the bitmap.
|
|
1635
|
+
* @param filename the file to check
|
|
1636
|
+
* @returns %TRUE if the image was successfully parsed
|
|
1637
|
+
*/
|
|
1638
|
+
static get_size_from_file(filename: string | null): [ /* returnType */ boolean, /* width */ number, /* height */ number ]
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
module Context {
|
|
1642
|
+
|
|
1643
|
+
// Constructor properties interface
|
|
1644
|
+
|
|
1645
|
+
interface ConstructorProperties extends Object.ConstructorProperties {
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
interface Context {
|
|
1651
|
+
|
|
1652
|
+
// Owm methods of Cogl-10.Cogl.Context
|
|
1653
|
+
|
|
1654
|
+
free_timestamp_query(query: TimestampQuery): void
|
|
1655
|
+
/**
|
|
1656
|
+
* This function should only be called if the COGL_FEATURE_ID_TIMESTAMP_QUERY
|
|
1657
|
+
* feature is advertised.
|
|
1658
|
+
* @returns Current GPU time in nanoseconds
|
|
1659
|
+
*/
|
|
1660
|
+
get_gpu_time_ns(): number
|
|
1661
|
+
get_named_pipeline(key: PipelineKey): Pipeline
|
|
1662
|
+
is_hardware_accelerated(): boolean
|
|
1663
|
+
/**
|
|
1664
|
+
* Associate a #CoglPipeline with a `context` and `key`. This will not take a new
|
|
1665
|
+
* reference to the `pipeline,` but will unref all associated pipelines when
|
|
1666
|
+
* the `context` gets destroyed. Similarly, if a pipeline gets overwritten,
|
|
1667
|
+
* it will get unreffed as well.
|
|
1668
|
+
* @param key a #CoglPipelineKey pointer
|
|
1669
|
+
* @param pipeline a #CoglPipeline to associate with the `context` and `key`
|
|
1670
|
+
*/
|
|
1671
|
+
set_named_pipeline(key: PipelineKey, pipeline: Pipeline | null): void
|
|
1672
|
+
timestamp_query_get_time_ns(query: TimestampQuery): number
|
|
1673
|
+
|
|
1674
|
+
// Class property signals of Cogl-10.Cogl.Context
|
|
1675
|
+
|
|
1676
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1677
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1678
|
+
emit(sigName: string, ...args: any[]): void
|
|
1679
|
+
disconnect(id: number): void
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
class Context extends Object {
|
|
1683
|
+
|
|
1684
|
+
// Own properties of Cogl-10.Cogl.Context
|
|
1685
|
+
|
|
1686
|
+
static name: string
|
|
1687
|
+
static $gtype: GObject.GType<Context>
|
|
1688
|
+
|
|
1689
|
+
// Constructors of Cogl-10.Cogl.Context
|
|
1690
|
+
|
|
1691
|
+
constructor(config?: Context.ConstructorProperties)
|
|
1692
|
+
_init(config?: Context.ConstructorProperties): void
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
module FrameInfo {
|
|
1696
|
+
|
|
1697
|
+
// Constructor properties interface
|
|
1698
|
+
|
|
1699
|
+
interface ConstructorProperties extends Object.ConstructorProperties {
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
interface FrameInfo {
|
|
1705
|
+
|
|
1706
|
+
// Owm methods of Cogl-10.Cogl.FrameInfo
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* Gets the frame counter for the #CoglOnscreen that corresponds
|
|
1710
|
+
* to this frame.
|
|
1711
|
+
* @returns The frame counter value
|
|
1712
|
+
*/
|
|
1713
|
+
get_frame_counter(): number
|
|
1714
|
+
get_is_symbolic(): boolean
|
|
1715
|
+
/**
|
|
1716
|
+
* Gets the presentation time for the frame. This is the time at which
|
|
1717
|
+
* the frame became visible to the user.
|
|
1718
|
+
*
|
|
1719
|
+
* The presentation time measured in microseconds, is based on
|
|
1720
|
+
* CLOCK_MONOTONIC.
|
|
1721
|
+
*
|
|
1722
|
+
* <note>Some buggy Mesa drivers up to 9.0.1 may
|
|
1723
|
+
* incorrectly report non-monotonic timestamps.</note>
|
|
1724
|
+
* @returns the presentation time for the frame
|
|
1725
|
+
*/
|
|
1726
|
+
get_presentation_time_us(): number
|
|
1727
|
+
/**
|
|
1728
|
+
* Gets the refresh rate in Hertz for the output that the frame was on
|
|
1729
|
+
* at the time the frame was presented.
|
|
1730
|
+
*
|
|
1731
|
+
* <note>Some platforms can't associate a #CoglOutput with a
|
|
1732
|
+
* #CoglFrameInfo object but are able to report a refresh rate via
|
|
1733
|
+
* this api. Therefore if you need this information then this api is
|
|
1734
|
+
* more reliable than using cogl_frame_info_get_output() followed by
|
|
1735
|
+
* cogl_output_get_refresh_rate().</note>
|
|
1736
|
+
* @returns the refresh rate in Hertz
|
|
1737
|
+
*/
|
|
1738
|
+
get_refresh_rate(): number
|
|
1739
|
+
get_rendering_duration_ns(): number
|
|
1740
|
+
get_sequence(): number
|
|
1741
|
+
get_time_before_buffer_swap_us(): number
|
|
1742
|
+
is_hw_clock(): boolean
|
|
1743
|
+
is_vsync(): boolean
|
|
1744
|
+
is_zero_copy(): boolean
|
|
1745
|
+
|
|
1746
|
+
// Class property signals of Cogl-10.Cogl.FrameInfo
|
|
1747
|
+
|
|
1748
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1749
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1750
|
+
emit(sigName: string, ...args: any[]): void
|
|
1751
|
+
disconnect(id: number): void
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
/**
|
|
1755
|
+
* Frame information.
|
|
1756
|
+
* @class
|
|
1757
|
+
*/
|
|
1758
|
+
class FrameInfo extends Object {
|
|
1759
|
+
|
|
1760
|
+
// Own properties of Cogl-10.Cogl.FrameInfo
|
|
1761
|
+
|
|
1762
|
+
static name: string
|
|
1763
|
+
static $gtype: GObject.GType<FrameInfo>
|
|
1764
|
+
|
|
1765
|
+
// Constructors of Cogl-10.Cogl.FrameInfo
|
|
1766
|
+
|
|
1767
|
+
constructor(config?: FrameInfo.ConstructorProperties)
|
|
1768
|
+
_init(config?: FrameInfo.ConstructorProperties): void
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
module Framebuffer {
|
|
1772
|
+
|
|
1773
|
+
// Signal callback interfaces
|
|
1774
|
+
|
|
1775
|
+
/**
|
|
1776
|
+
* Signal callback interface for `destroy`
|
|
1777
|
+
*/
|
|
1778
|
+
interface DestroySignalCallback {
|
|
1779
|
+
($obj: Framebuffer): void
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
|
|
1783
|
+
// Constructor properties interface
|
|
1784
|
+
|
|
1785
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
1786
|
+
|
|
1787
|
+
// Own constructor properties of Cogl-10.Cogl.Framebuffer
|
|
1788
|
+
|
|
1789
|
+
driver_config?: any | null
|
|
1790
|
+
height?: number | null
|
|
1791
|
+
width?: number | null
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
interface Framebuffer {
|
|
1797
|
+
|
|
1798
|
+
// Own properties of Cogl-10.Cogl.Framebuffer
|
|
1799
|
+
|
|
1800
|
+
readonly driver_config: any
|
|
1801
|
+
height: number
|
|
1802
|
+
width: number
|
|
1803
|
+
|
|
1804
|
+
// Own fields of Cogl-10.Cogl.Framebuffer
|
|
1805
|
+
|
|
1806
|
+
parent_instance: GObject.Object
|
|
1807
|
+
|
|
1808
|
+
// Owm methods of Cogl-10.Cogl.Framebuffer
|
|
1809
|
+
|
|
1810
|
+
/**
|
|
1811
|
+
* Explicitly allocates a configured #CoglFramebuffer allowing developers to
|
|
1812
|
+
* check and handle any errors that might arise from an unsupported
|
|
1813
|
+
* configuration so that fallback configurations may be tried.
|
|
1814
|
+
*
|
|
1815
|
+
* <note>Many applications don't support any fallback options at least when
|
|
1816
|
+
* they are initially developed and in that case the don't need to use this API
|
|
1817
|
+
* since Cogl will automatically allocate a framebuffer when it first gets
|
|
1818
|
+
* used. The disadvantage of relying on automatic allocation is that the
|
|
1819
|
+
* program will abort with an error message if there is an error during
|
|
1820
|
+
* automatic allocation.</note>
|
|
1821
|
+
* @returns %TRUE if there were no error allocating the framebuffer, else %FALSE.
|
|
1822
|
+
*/
|
|
1823
|
+
allocate(): boolean
|
|
1824
|
+
/**
|
|
1825
|
+
* Clears all the auxiliary buffers identified in the `buffers` mask, and if
|
|
1826
|
+
* that includes the color buffer then the specified `color` is used.
|
|
1827
|
+
* @param buffers A mask of #CoglBufferBit<!-- -->'s identifying which auxiliary buffers to clear
|
|
1828
|
+
* @param color The color to clear the color buffer too if specified in `buffers`.
|
|
1829
|
+
*/
|
|
1830
|
+
clear(buffers: number, color: Color): void
|
|
1831
|
+
/**
|
|
1832
|
+
* Clears all the auxiliary buffers identified in the `buffers` mask, and if
|
|
1833
|
+
* that includes the color buffer then the specified `color` is used.
|
|
1834
|
+
* @param buffers A mask of #CoglBufferBit<!-- -->'s identifying which auxiliary buffers to clear
|
|
1835
|
+
* @param red The red component of color to clear the color buffer too if specified in `buffers`.
|
|
1836
|
+
* @param green The green component of color to clear the color buffer too if specified in `buffers`.
|
|
1837
|
+
* @param blue The blue component of color to clear the color buffer too if specified in `buffers`.
|
|
1838
|
+
* @param alpha The alpha component of color to clear the color buffer too if specified in `buffers`.
|
|
1839
|
+
*/
|
|
1840
|
+
clear4f(buffers: number, red: number, green: number, blue: number, alpha: number): void
|
|
1841
|
+
/**
|
|
1842
|
+
* Declares that the specified `buffers` no longer need to be referenced
|
|
1843
|
+
* by any further rendering commands. This can be an important
|
|
1844
|
+
* optimization to avoid subsequent frames of rendering depending on
|
|
1845
|
+
* the results of a previous frame.
|
|
1846
|
+
*
|
|
1847
|
+
* For example; some tile-based rendering GPUs are able to avoid allocating and
|
|
1848
|
+
* accessing system memory for the depth and stencil buffer so long as these
|
|
1849
|
+
* buffers are not required as input for subsequent frames and that can save a
|
|
1850
|
+
* significant amount of memory bandwidth used to save and restore their
|
|
1851
|
+
* contents to system memory between frames.
|
|
1852
|
+
*
|
|
1853
|
+
* It is currently considered an error to try and explicitly discard the color
|
|
1854
|
+
* buffer by passing %COGL_BUFFER_BIT_COLOR. This is because the color buffer is
|
|
1855
|
+
* already implicitly discard when you finish rendering to a #CoglOnscreen
|
|
1856
|
+
* framebuffer, and it's not meaningful to try and discard the color buffer of
|
|
1857
|
+
* a #CoglOffscreen framebuffer since they are single-buffered.
|
|
1858
|
+
* @param buffers A #CoglBufferBit mask of which ancillary buffers you want to discard.
|
|
1859
|
+
*/
|
|
1860
|
+
discard_buffers(buffers: number): void
|
|
1861
|
+
/**
|
|
1862
|
+
* Draws a textured rectangle to `framebuffer` with the given `pipeline`
|
|
1863
|
+
* state with the top left corner positioned at (`x_1`, `y_1`) and the
|
|
1864
|
+
* bottom right corner positioned at (`x_2`, `y_2`). As a pipeline may
|
|
1865
|
+
* contain multiple texture layers this interface lets you supply
|
|
1866
|
+
* texture coordinates for each layer of the pipeline.
|
|
1867
|
+
*
|
|
1868
|
+
* <note>The position is the position before the rectangle has been
|
|
1869
|
+
* transformed by the model-view matrix and the projection
|
|
1870
|
+
* matrix.</note>
|
|
1871
|
+
*
|
|
1872
|
+
* This is a high level drawing api that can handle any kind of
|
|
1873
|
+
* #CoglMetaTexture texture for the first layer such as
|
|
1874
|
+
* #CoglTexture2DSliced textures which may internally be comprised of
|
|
1875
|
+
* multiple low-level textures. This is unlike low-level drawing apis
|
|
1876
|
+
* such as cogl_primitive_draw() which only support low level texture
|
|
1877
|
+
* types that are directly supported by GPUs such as #CoglTexture2D.
|
|
1878
|
+
*
|
|
1879
|
+
* <note>This api can not currently handle multiple high-level meta
|
|
1880
|
+
* texture layers. The first layer may be a high level meta texture
|
|
1881
|
+
* such as #CoglTexture2DSliced but all other layers much be low
|
|
1882
|
+
* level textures such as #CoglTexture2D.
|
|
1883
|
+
*
|
|
1884
|
+
* The top left texture coordinate for layer 0 of any pipeline will be
|
|
1885
|
+
* (tex_coords[0], tex_coords[1]) and the bottom right coordinate will
|
|
1886
|
+
* be (tex_coords[2], tex_coords[3]). The coordinates for layer 1
|
|
1887
|
+
* would be (tex_coords[4], tex_coords[5]) (tex_coords[6],
|
|
1888
|
+
* tex_coords[7]) and so on...
|
|
1889
|
+
*
|
|
1890
|
+
* The given texture coordinates should always be normalized such that
|
|
1891
|
+
* (0, 0) corresponds to the top left and (1, 1) corresponds to the
|
|
1892
|
+
* bottom right. To map an entire texture across the rectangle pass
|
|
1893
|
+
* in tex_coords[0]=0, tex_coords[1]=0, tex_coords[2]=1,
|
|
1894
|
+
* tex_coords[3]=1.
|
|
1895
|
+
*
|
|
1896
|
+
* The first pair of coordinates are for the first layer (with the
|
|
1897
|
+
* smallest layer index) and if you supply less texture coordinates
|
|
1898
|
+
* than there are layers in the current source material then default
|
|
1899
|
+
* texture coordinates (0.0, 0.0, 1.0, 1.0) are generated.
|
|
1900
|
+
* @param pipeline A #CoglPipeline state object
|
|
1901
|
+
* @param x_1 x coordinate upper left on screen.
|
|
1902
|
+
* @param y_1 y coordinate upper left on screen.
|
|
1903
|
+
* @param x_2 x coordinate lower right on screen.
|
|
1904
|
+
* @param y_2 y coordinate lower right on screen.
|
|
1905
|
+
* @param tex_coords An array containing groups of 4 float values: [s_1, t_1, s_2, t_2] that are interpreted as two texture coordinates; one for the top left texel, and one for the bottom right texel. Each value should be between 0.0 and 1.0, where the coordinate (0.0, 0.0) represents the top left of the texture, and (1.0, 1.0) the bottom right.
|
|
1906
|
+
* @param tex_coords_len The length of the `tex_coords` array. (For one layer and one group of texture coordinates, this would be 4)
|
|
1907
|
+
*/
|
|
1908
|
+
draw_multitextured_rectangle(pipeline: Pipeline, x_1: number, y_1: number, x_2: number, y_2: number, tex_coords: number[], tex_coords_len: number): void
|
|
1909
|
+
/**
|
|
1910
|
+
* Draws a rectangle to `framebuffer` with the given `pipeline` state
|
|
1911
|
+
* and with the top left corner positioned at (`x_1`, `y_1`) and the
|
|
1912
|
+
* bottom right corner positioned at (`x_2`, `y_2`).
|
|
1913
|
+
*
|
|
1914
|
+
* <note>The position is the position before the rectangle has been
|
|
1915
|
+
* transformed by the model-view matrix and the projection
|
|
1916
|
+
* matrix.</note>
|
|
1917
|
+
*
|
|
1918
|
+
* <note>If you want to describe a rectangle with a texture mapped on
|
|
1919
|
+
* it then you can use
|
|
1920
|
+
* cogl_framebuffer_draw_textured_rectangle().</note>
|
|
1921
|
+
* @param pipeline A #CoglPipeline state object
|
|
1922
|
+
* @param x_1 X coordinate of the top-left corner
|
|
1923
|
+
* @param y_1 Y coordinate of the top-left corner
|
|
1924
|
+
* @param x_2 X coordinate of the bottom-right corner
|
|
1925
|
+
* @param y_2 Y coordinate of the bottom-right corner
|
|
1926
|
+
*/
|
|
1927
|
+
draw_rectangle(pipeline: Pipeline, x_1: number, y_1: number, x_2: number, y_2: number): void
|
|
1928
|
+
/**
|
|
1929
|
+
* Draws a series of rectangles to `framebuffer` with the given
|
|
1930
|
+
* `pipeline` state in the same way that
|
|
1931
|
+
* cogl_framebuffer_draw_rectangle() does.
|
|
1932
|
+
*
|
|
1933
|
+
* The top left corner of the first rectangle is positioned at
|
|
1934
|
+
* (coordinates[0], coordinates[1]) and the bottom right corner is
|
|
1935
|
+
* positioned at (coordinates[2], coordinates[3]). The positions for
|
|
1936
|
+
* the second rectangle are (coordinates[4], coordinates[5]) and
|
|
1937
|
+
* (coordinates[6], coordinates[7]) and so on...
|
|
1938
|
+
*
|
|
1939
|
+
* <note>The position is the position before the rectangle has been
|
|
1940
|
+
* transformed by the model-view matrix and the projection
|
|
1941
|
+
* matrix.</note>
|
|
1942
|
+
*
|
|
1943
|
+
* As a general rule for better performance its recommended to use
|
|
1944
|
+
* this this API instead of calling
|
|
1945
|
+
* cogl_framebuffer_draw_textured_rectangle() separately for multiple
|
|
1946
|
+
* rectangles if all of the rectangles will be drawn together with the
|
|
1947
|
+
* same `pipeline` state.
|
|
1948
|
+
* @param pipeline A #CoglPipeline state object
|
|
1949
|
+
* @param coordinates an array of coordinates containing groups of 4 float values: [x_1, y_1, x_2, y_2] that are interpreted as two position coordinates; one for the top left of the rectangle (x1, y1), and one for the bottom right of the rectangle (x2, y2).
|
|
1950
|
+
* @param n_rectangles number of rectangles defined in `coordinates`.
|
|
1951
|
+
*/
|
|
1952
|
+
draw_rectangles(pipeline: Pipeline, coordinates: number[], n_rectangles: number): void
|
|
1953
|
+
/**
|
|
1954
|
+
* Draws a textured rectangle to `framebuffer` using the given
|
|
1955
|
+
* `pipeline` state with the top left corner positioned at (`x_1`, `y_1`)
|
|
1956
|
+
* and the bottom right corner positioned at (`x_2`, `y_2`). The top
|
|
1957
|
+
* left corner will have texture coordinates of (`s_1`, `t_1`) and the
|
|
1958
|
+
* bottom right corner will have texture coordinates of (`s_2`, `t_2`).
|
|
1959
|
+
*
|
|
1960
|
+
* <note>The position is the position before the rectangle has been
|
|
1961
|
+
* transformed by the model-view matrix and the projection
|
|
1962
|
+
* matrix.</note>
|
|
1963
|
+
*
|
|
1964
|
+
* This is a high level drawing api that can handle any kind of
|
|
1965
|
+
* #CoglMetaTexture texture such as #CoglTexture2DSliced textures
|
|
1966
|
+
* which may internally be comprised of multiple low-level textures.
|
|
1967
|
+
* This is unlike low-level drawing apis such as cogl_primitive_draw()
|
|
1968
|
+
* which only support low level texture types that are directly
|
|
1969
|
+
* supported by GPUs such as #CoglTexture2D.
|
|
1970
|
+
*
|
|
1971
|
+
* <note>The given texture coordinates will only be used for the first
|
|
1972
|
+
* texture layer of the pipeline and if your pipeline has more than
|
|
1973
|
+
* one layer then all other layers will have default texture
|
|
1974
|
+
* coordinates of `s_1`=0.0 `t_1`=0.0 `s_2`=1.0 `t_2`=1.0 </note>
|
|
1975
|
+
*
|
|
1976
|
+
* The given texture coordinates should always be normalized such that
|
|
1977
|
+
* (0, 0) corresponds to the top left and (1, 1) corresponds to the
|
|
1978
|
+
* bottom right. To map an entire texture across the rectangle pass
|
|
1979
|
+
* in `s_1`=0, `t_1`=0, `s_2`=1, `t_2`=1.
|
|
1980
|
+
* @param pipeline A #CoglPipeline state object
|
|
1981
|
+
* @param x_1 x coordinate upper left on screen.
|
|
1982
|
+
* @param y_1 y coordinate upper left on screen.
|
|
1983
|
+
* @param x_2 x coordinate lower right on screen.
|
|
1984
|
+
* @param y_2 y coordinate lower right on screen.
|
|
1985
|
+
* @param s_1 S texture coordinate of the top-left coorner
|
|
1986
|
+
* @param t_1 T texture coordinate of the top-left coorner
|
|
1987
|
+
* @param s_2 S texture coordinate of the bottom-right coorner
|
|
1988
|
+
* @param t_2 T texture coordinate of the bottom-right coorner
|
|
1989
|
+
*/
|
|
1990
|
+
draw_textured_rectangle(pipeline: Pipeline, x_1: number, y_1: number, x_2: number, y_2: number, s_1: number, t_1: number, s_2: number, t_2: number): void
|
|
1991
|
+
/**
|
|
1992
|
+
* Draws a series of rectangles to `framebuffer` with the given
|
|
1993
|
+
* `pipeline` state in the same way that
|
|
1994
|
+
* cogl_framebuffer_draw_textured_rectangle() does.
|
|
1995
|
+
*
|
|
1996
|
+
* <note>The position is the position before the rectangle has been
|
|
1997
|
+
* transformed by the model-view matrix and the projection
|
|
1998
|
+
* matrix.</note>
|
|
1999
|
+
*
|
|
2000
|
+
* This is a high level drawing api that can handle any kind of
|
|
2001
|
+
* #CoglMetaTexture texture such as #CoglTexture2DSliced textures
|
|
2002
|
+
* which may internally be comprised of multiple low-level textures.
|
|
2003
|
+
* This is unlike low-level drawing apis such as cogl_primitive_draw()
|
|
2004
|
+
* which only support low level texture types that are directly
|
|
2005
|
+
* supported by GPUs such as #CoglTexture2D.
|
|
2006
|
+
*
|
|
2007
|
+
* The top left corner of the first rectangle is positioned at
|
|
2008
|
+
* (coordinates[0], coordinates[1]) and the bottom right corner is
|
|
2009
|
+
* positioned at (coordinates[2], coordinates[3]). The top left
|
|
2010
|
+
* texture coordinate is (coordinates[4], coordinates[5]) and the
|
|
2011
|
+
* bottom right texture coordinate is (coordinates[6],
|
|
2012
|
+
* coordinates[7]). The coordinates for subsequent rectangles
|
|
2013
|
+
* are defined similarly by the subsequent coordinates.
|
|
2014
|
+
*
|
|
2015
|
+
* As a general rule for better performance its recommended to use
|
|
2016
|
+
* this this API instead of calling
|
|
2017
|
+
* cogl_framebuffer_draw_textured_rectangle() separately for multiple
|
|
2018
|
+
* rectangles if all of the rectangles will be drawn together with the
|
|
2019
|
+
* same `pipeline` state.
|
|
2020
|
+
*
|
|
2021
|
+
* The given texture coordinates should always be normalized such that
|
|
2022
|
+
* (0, 0) corresponds to the top left and (1, 1) corresponds to the
|
|
2023
|
+
* bottom right. To map an entire texture across the rectangle pass
|
|
2024
|
+
* in tex_coords[0]=0, tex_coords[1]=0, tex_coords[2]=1,
|
|
2025
|
+
* tex_coords[3]=1.
|
|
2026
|
+
* @param pipeline A #CoglPipeline state object
|
|
2027
|
+
* @param coordinates an array containing groups of 8 float values: [x_1, y_1, x_2, y_2, s_1, t_1, s_2, t_2] that have the same meaning as the arguments for cogl_framebuffer_draw_textured_rectangle().
|
|
2028
|
+
* @param n_rectangles number of rectangles to `coordinates` to draw
|
|
2029
|
+
*/
|
|
2030
|
+
draw_textured_rectangles(pipeline: Pipeline, coordinates: number[], n_rectangles: number): void
|
|
2031
|
+
/**
|
|
2032
|
+
* This blocks the CPU until all pending rendering associated with the
|
|
2033
|
+
* specified framebuffer has completed. It's very rare that developers should
|
|
2034
|
+
* ever need this level of synchronization with the GPU and should never be
|
|
2035
|
+
* used unless you clearly understand why you need to explicitly force
|
|
2036
|
+
* synchronization.
|
|
2037
|
+
*
|
|
2038
|
+
* One example might be for benchmarking purposes to be sure timing
|
|
2039
|
+
* measurements reflect the time that the GPU is busy for not just the time it
|
|
2040
|
+
* takes to queue rendering commands.
|
|
2041
|
+
*/
|
|
2042
|
+
finish(): void
|
|
2043
|
+
/**
|
|
2044
|
+
* Flushes `framebuffer` to ensure the current batch of commands is
|
|
2045
|
+
* submitted to the GPU.
|
|
2046
|
+
*
|
|
2047
|
+
* Unlike cogl_framebuffer_finish(), this does not block the CPU.
|
|
2048
|
+
*/
|
|
2049
|
+
flush(): void
|
|
2050
|
+
/**
|
|
2051
|
+
* Replaces the current projection matrix with a perspective matrix
|
|
2052
|
+
* for a given viewing frustum defined by 4 side clip planes that
|
|
2053
|
+
* all cross through the origin and 2 near and far clip planes.
|
|
2054
|
+
* @param left X position of the left clipping plane where it intersects the near clipping plane
|
|
2055
|
+
* @param right X position of the right clipping plane where it intersects the near clipping plane
|
|
2056
|
+
* @param bottom Y position of the bottom clipping plane where it intersects the near clipping plane
|
|
2057
|
+
* @param top Y position of the top clipping plane where it intersects the near clipping plane
|
|
2058
|
+
* @param z_near The distance to the near clipping plane (Must be positive)
|
|
2059
|
+
* @param z_far The distance to the far clipping plane (Must be positive)
|
|
2060
|
+
*/
|
|
2061
|
+
frustum(left: number, right: number, bottom: number, top: number, z_near: number, z_far: number): void
|
|
2062
|
+
/**
|
|
2063
|
+
* Retrieves the number of alpha bits of `framebuffer`
|
|
2064
|
+
* @returns the number of bits
|
|
2065
|
+
*/
|
|
2066
|
+
get_alpha_bits(): number
|
|
2067
|
+
/**
|
|
2068
|
+
* Retrieves the number of blue bits of `framebuffer`
|
|
2069
|
+
* @returns the number of bits
|
|
2070
|
+
*/
|
|
2071
|
+
get_blue_bits(): number
|
|
2072
|
+
/**
|
|
2073
|
+
* Can be used to query the #CoglContext a given `framebuffer` was
|
|
2074
|
+
* instantiated within. This is the #CoglContext that was passed to
|
|
2075
|
+
* cogl_onscreen_new() for example.
|
|
2076
|
+
* @returns The #CoglContext that the given @framebuffer was instantiated within.
|
|
2077
|
+
*/
|
|
2078
|
+
get_context(): Context
|
|
2079
|
+
/**
|
|
2080
|
+
* Retrieves the number of depth bits of `framebuffer`
|
|
2081
|
+
* @returns the number of bits
|
|
2082
|
+
*/
|
|
2083
|
+
get_depth_bits(): number
|
|
2084
|
+
/**
|
|
2085
|
+
* Queries whether depth buffer writing is enabled for `framebuffer`. This
|
|
2086
|
+
* can be controlled via cogl_framebuffer_set_depth_write_enabled().
|
|
2087
|
+
* @returns %TRUE if depth writing is enabled or %FALSE if not.
|
|
2088
|
+
*/
|
|
2089
|
+
get_depth_write_enabled(): boolean
|
|
2090
|
+
/**
|
|
2091
|
+
* Returns whether dithering has been requested for the given `framebuffer`.
|
|
2092
|
+
* See cogl_framebuffer_set_dither_enabled() for more details about dithering.
|
|
2093
|
+
*
|
|
2094
|
+
* <note>This may return %TRUE even when the underlying `framebuffer`
|
|
2095
|
+
* display pipeline does not support dithering. This value only represents
|
|
2096
|
+
* the user's request for dithering.</note>
|
|
2097
|
+
* @returns %TRUE if dithering has been requested or %FALSE if not.
|
|
2098
|
+
*/
|
|
2099
|
+
get_dither_enabled(): boolean
|
|
2100
|
+
/**
|
|
2101
|
+
* Retrieves the number of green bits of `framebuffer`
|
|
2102
|
+
* @returns the number of bits
|
|
2103
|
+
*/
|
|
2104
|
+
get_green_bits(): number
|
|
2105
|
+
/**
|
|
2106
|
+
* Queries the current height of the given `framebuffer`.
|
|
2107
|
+
* @returns The height of @framebuffer.
|
|
2108
|
+
*/
|
|
2109
|
+
get_height(): number
|
|
2110
|
+
get_is_stereo(): boolean
|
|
2111
|
+
/**
|
|
2112
|
+
* Stores the current model-view matrix in `matrix`.
|
|
2113
|
+
*/
|
|
2114
|
+
get_modelview_matrix(): /* matrix */ Graphene.Matrix
|
|
2115
|
+
/**
|
|
2116
|
+
* Stores the current projection matrix in `matrix`.
|
|
2117
|
+
*/
|
|
2118
|
+
get_projection_matrix(): /* matrix */ Graphene.Matrix
|
|
2119
|
+
/**
|
|
2120
|
+
* Retrieves the number of red bits of `framebuffer`
|
|
2121
|
+
* @returns the number of bits
|
|
2122
|
+
*/
|
|
2123
|
+
get_red_bits(): number
|
|
2124
|
+
/**
|
|
2125
|
+
* Gets the number of points that are sampled per-pixel when
|
|
2126
|
+
* rasterizing geometry. Usually by default this will return 0 which
|
|
2127
|
+
* means that single-sample not multisample rendering has been chosen.
|
|
2128
|
+
* When using a GPU supporting multisample rendering it's possible to
|
|
2129
|
+
* increase the number of samples per pixel using
|
|
2130
|
+
* cogl_framebuffer_set_samples_per_pixel().
|
|
2131
|
+
*
|
|
2132
|
+
* Calling cogl_framebuffer_get_samples_per_pixel() before the
|
|
2133
|
+
* framebuffer has been allocated will simply return the value set
|
|
2134
|
+
* using cogl_framebuffer_set_samples_per_pixel(). After the
|
|
2135
|
+
* framebuffer has been allocated the value will reflect the actual
|
|
2136
|
+
* number of samples that will be made by the GPU.
|
|
2137
|
+
* @returns The number of point samples made per pixel when rasterizing geometry or 0 if single-sample rendering has been chosen.
|
|
2138
|
+
*/
|
|
2139
|
+
get_samples_per_pixel(): number
|
|
2140
|
+
/**
|
|
2141
|
+
* Gets the current #CoglStereoMode, which defines which stereo buffers
|
|
2142
|
+
* should be drawn to. See cogl_framebuffer_set_stereo_mode().
|
|
2143
|
+
* @returns A #CoglStereoMode
|
|
2144
|
+
*/
|
|
2145
|
+
get_stereo_mode(): StereoMode
|
|
2146
|
+
/**
|
|
2147
|
+
* Queries the x, y, width and height components of the current viewport as set
|
|
2148
|
+
* using cogl_framebuffer_set_viewport() or the default values which are 0, 0,
|
|
2149
|
+
* framebuffer_width and framebuffer_height. The values are written into the
|
|
2150
|
+
* given `viewport` array.
|
|
2151
|
+
*/
|
|
2152
|
+
get_viewport4fv(): /* viewport */ number[]
|
|
2153
|
+
/**
|
|
2154
|
+
* Queries the height of the viewport as set using cogl_framebuffer_set_viewport()
|
|
2155
|
+
* or the default value which is the height of the framebuffer.
|
|
2156
|
+
* @returns The height of the viewport.
|
|
2157
|
+
*/
|
|
2158
|
+
get_viewport_height(): number
|
|
2159
|
+
/**
|
|
2160
|
+
* Queries the width of the viewport as set using cogl_framebuffer_set_viewport()
|
|
2161
|
+
* or the default value which is the width of the framebuffer.
|
|
2162
|
+
* @returns The width of the viewport.
|
|
2163
|
+
*/
|
|
2164
|
+
get_viewport_width(): number
|
|
2165
|
+
/**
|
|
2166
|
+
* Queries the x coordinate of the viewport origin as set using cogl_framebuffer_set_viewport()
|
|
2167
|
+
* or the default value which is 0.
|
|
2168
|
+
* @returns The x coordinate of the viewport origin.
|
|
2169
|
+
*/
|
|
2170
|
+
get_viewport_x(): number
|
|
2171
|
+
/**
|
|
2172
|
+
* Queries the y coordinate of the viewport origin as set using cogl_framebuffer_set_viewport()
|
|
2173
|
+
* or the default value which is 0.
|
|
2174
|
+
* @returns The y coordinate of the viewport origin.
|
|
2175
|
+
*/
|
|
2176
|
+
get_viewport_y(): number
|
|
2177
|
+
/**
|
|
2178
|
+
* Queries the current width of the given `framebuffer`.
|
|
2179
|
+
* @returns The width of @framebuffer.
|
|
2180
|
+
*/
|
|
2181
|
+
get_width(): number
|
|
2182
|
+
/**
|
|
2183
|
+
* Resets the current model-view matrix to the identity matrix.
|
|
2184
|
+
*/
|
|
2185
|
+
identity_matrix(): void
|
|
2186
|
+
/**
|
|
2187
|
+
* Replaces the current projection matrix with an orthographic projection
|
|
2188
|
+
* matrix.
|
|
2189
|
+
* @param x_1 The x coordinate for the first vertical clipping plane
|
|
2190
|
+
* @param y_1 The y coordinate for the first horizontal clipping plane
|
|
2191
|
+
* @param x_2 The x coordinate for the second vertical clipping plane
|
|
2192
|
+
* @param y_2 The y coordinate for the second horizontal clipping plane
|
|
2193
|
+
* @param near The <emphasis>distance</emphasis> to the near clipping plane (will be <emphasis>negative</emphasis> if the plane is behind the viewer)
|
|
2194
|
+
* @param far The <emphasis>distance</emphasis> to the far clipping plane (will be <emphasis>negative</emphasis> if the plane is behind the viewer)
|
|
2195
|
+
*/
|
|
2196
|
+
orthographic(x_1: number, y_1: number, x_2: number, y_2: number, near: number, far: number): void
|
|
2197
|
+
/**
|
|
2198
|
+
* Replaces the current projection matrix with a perspective matrix
|
|
2199
|
+
* based on the provided values.
|
|
2200
|
+
*
|
|
2201
|
+
* <note>You should be careful not to have to great a `z_far` / `z_near`
|
|
2202
|
+
* ratio since that will reduce the effectiveness of depth testing
|
|
2203
|
+
* since there won't be enough precision to identify the depth of
|
|
2204
|
+
* objects near to each other.</note>
|
|
2205
|
+
* @param fov_y Vertical field of view angle in degrees.
|
|
2206
|
+
* @param aspect The (width over height) aspect ratio for display
|
|
2207
|
+
* @param z_near The distance to the near clipping plane (Must be positive, and must not be 0)
|
|
2208
|
+
* @param z_far The distance to the far clipping plane (Must be positive)
|
|
2209
|
+
*/
|
|
2210
|
+
perspective(fov_y: number, aspect: number, z_near: number, z_far: number): void
|
|
2211
|
+
/**
|
|
2212
|
+
* Reverts the clipping region to the state before the last call to
|
|
2213
|
+
* cogl_framebuffer_push_scissor_clip(), cogl_framebuffer_push_rectangle_clip()
|
|
2214
|
+
* cogl_framebuffer_push_path_clip(), or cogl_framebuffer_push_primitive_clip().
|
|
2215
|
+
*/
|
|
2216
|
+
pop_clip(): void
|
|
2217
|
+
/**
|
|
2218
|
+
* Restores the model-view matrix on the top of the matrix stack.
|
|
2219
|
+
*/
|
|
2220
|
+
pop_matrix(): void
|
|
2221
|
+
/**
|
|
2222
|
+
* Copies the current model-view matrix onto the matrix stack. The matrix
|
|
2223
|
+
* can later be restored with cogl_framebuffer_pop_matrix().
|
|
2224
|
+
*/
|
|
2225
|
+
push_matrix(): void
|
|
2226
|
+
/**
|
|
2227
|
+
* Specifies a modelview transformed rectangular clipping area for all
|
|
2228
|
+
* subsequent drawing operations. Any drawing commands that extend
|
|
2229
|
+
* outside the rectangle will be clipped so that only the portion
|
|
2230
|
+
* inside the rectangle will be displayed. The rectangle dimensions
|
|
2231
|
+
* are transformed by the current model-view matrix.
|
|
2232
|
+
*
|
|
2233
|
+
* The rectangle is intersected with the current clip region. To undo
|
|
2234
|
+
* the effect of this function, call cogl_framebuffer_pop_clip().
|
|
2235
|
+
* @param x_1 x coordinate for top left corner of the clip rectangle
|
|
2236
|
+
* @param y_1 y coordinate for top left corner of the clip rectangle
|
|
2237
|
+
* @param x_2 x coordinate for bottom right corner of the clip rectangle
|
|
2238
|
+
* @param y_2 y coordinate for bottom right corner of the clip rectangle
|
|
2239
|
+
*/
|
|
2240
|
+
push_rectangle_clip(x_1: number, y_1: number, x_2: number, y_2: number): void
|
|
2241
|
+
push_region_clip(region: cairo.Region): void
|
|
2242
|
+
/**
|
|
2243
|
+
* Specifies a rectangular clipping area for all subsequent drawing
|
|
2244
|
+
* operations. Any drawing commands that extend outside the rectangle
|
|
2245
|
+
* will be clipped so that only the portion inside the rectangle will
|
|
2246
|
+
* be displayed. The rectangle dimensions are not transformed by the
|
|
2247
|
+
* current model-view matrix.
|
|
2248
|
+
*
|
|
2249
|
+
* The rectangle is intersected with the current clip region. To undo
|
|
2250
|
+
* the effect of this function, call cogl_framebuffer_pop_clip().
|
|
2251
|
+
* @param x left edge of the clip rectangle in window coordinates
|
|
2252
|
+
* @param y top edge of the clip rectangle in window coordinates
|
|
2253
|
+
* @param width width of the clip rectangle
|
|
2254
|
+
* @param height height of the clip rectangle
|
|
2255
|
+
*/
|
|
2256
|
+
push_scissor_clip(x: number, y: number, width: number, height: number): void
|
|
2257
|
+
/**
|
|
2258
|
+
* This is a convenience wrapper around
|
|
2259
|
+
* cogl_framebuffer_read_pixels_into_bitmap() which allocates a
|
|
2260
|
+
* temporary #CoglBitmap to read pixel data directly into the given
|
|
2261
|
+
* buffer. The rowstride of the buffer is assumed to be the width of
|
|
2262
|
+
* the region times the bytes per pixel of the format. The source for
|
|
2263
|
+
* the data is always taken from the color buffer. If you want to use
|
|
2264
|
+
* any other rowstride or source, please use the
|
|
2265
|
+
* cogl_framebuffer_read_pixels_into_bitmap() function directly.
|
|
2266
|
+
*
|
|
2267
|
+
* The implementation of the function looks like this:
|
|
2268
|
+
*
|
|
2269
|
+
*
|
|
2270
|
+
* ```
|
|
2271
|
+
* bitmap = cogl_bitmap_new_for_data (context,
|
|
2272
|
+
* width, height,
|
|
2273
|
+
* format,
|
|
2274
|
+
* /<!-- -->* rowstride *<!-- -->/
|
|
2275
|
+
* bpp * width,
|
|
2276
|
+
* pixels);
|
|
2277
|
+
* cogl_framebuffer_read_pixels_into_bitmap (framebuffer,
|
|
2278
|
+
* x, y,
|
|
2279
|
+
* COGL_READ_PIXELS_COLOR_BUFFER,
|
|
2280
|
+
* bitmap);
|
|
2281
|
+
* cogl_object_unref (bitmap);
|
|
2282
|
+
* ```
|
|
2283
|
+
*
|
|
2284
|
+
* @param x The x position to read from
|
|
2285
|
+
* @param y The y position to read from
|
|
2286
|
+
* @param width The width of the region of rectangles to read
|
|
2287
|
+
* @param height The height of the region of rectangles to read
|
|
2288
|
+
* @param format The pixel format to store the data in
|
|
2289
|
+
* @param pixels The address of the buffer to store the data in
|
|
2290
|
+
* @returns %TRUE if the read succeeded or %FALSE otherwise.
|
|
2291
|
+
*/
|
|
2292
|
+
read_pixels(x: number, y: number, width: number, height: number, format: PixelFormat, pixels: number): boolean
|
|
2293
|
+
/**
|
|
2294
|
+
* This reads a rectangle of pixels from the given framebuffer where
|
|
2295
|
+
* position (0, 0) is the top left. The pixel at (x, y) is the first
|
|
2296
|
+
* read, and a rectangle of pixels with the same size as the bitmap is
|
|
2297
|
+
* read right and downwards from that point.
|
|
2298
|
+
*
|
|
2299
|
+
* Currently Cogl assumes that the framebuffer is in a premultiplied
|
|
2300
|
+
* format so if the format of `bitmap` is non-premultiplied it will
|
|
2301
|
+
* convert it. To read the pixel values without any conversion you
|
|
2302
|
+
* should either specify a format that doesn't use an alpha channel or
|
|
2303
|
+
* use one of the formats ending in PRE.
|
|
2304
|
+
* @param x The x position to read from
|
|
2305
|
+
* @param y The y position to read from
|
|
2306
|
+
* @param source Identifies which auxiliary buffer you want to read (only COGL_READ_PIXELS_COLOR_BUFFER supported currently)
|
|
2307
|
+
* @param bitmap The bitmap to store the results in.
|
|
2308
|
+
* @returns %TRUE if the read succeeded or %FALSE otherwise. The function is only likely to fail if the bitmap points to a pixel buffer and it could not be mapped.
|
|
2309
|
+
*/
|
|
2310
|
+
read_pixels_into_bitmap(x: number, y: number, source: ReadPixelsFlags, bitmap: Bitmap): boolean
|
|
2311
|
+
/**
|
|
2312
|
+
* When point sample rendering (also known as multisample rendering)
|
|
2313
|
+
* has been enabled via cogl_framebuffer_set_samples_per_pixel()
|
|
2314
|
+
* then you can optionally call this function (or
|
|
2315
|
+
* cogl_framebuffer_resolve_samples_region()) to explicitly resolve
|
|
2316
|
+
* the point samples into values for the final color buffer.
|
|
2317
|
+
*
|
|
2318
|
+
* Some GPUs will implicitly resolve the point samples during
|
|
2319
|
+
* rendering and so this function is effectively a nop, but with other
|
|
2320
|
+
* architectures it is desirable to defer the resolve step until the
|
|
2321
|
+
* end of the frame.
|
|
2322
|
+
*
|
|
2323
|
+
* Since Cogl will automatically ensure samples are resolved if the
|
|
2324
|
+
* target color buffer is used as a source this API only needs to be
|
|
2325
|
+
* used if explicit control is desired - perhaps because you want to
|
|
2326
|
+
* ensure that the resolve is completed in advance to avoid later
|
|
2327
|
+
* having to wait for the resolve to complete.
|
|
2328
|
+
*
|
|
2329
|
+
* If you are performing incremental updates to a framebuffer you
|
|
2330
|
+
* should consider using cogl_framebuffer_resolve_samples_region()
|
|
2331
|
+
* instead to avoid resolving redundant pixels.
|
|
2332
|
+
*/
|
|
2333
|
+
resolve_samples(): void
|
|
2334
|
+
/**
|
|
2335
|
+
* When point sample rendering (also known as multisample rendering)
|
|
2336
|
+
* has been enabled via cogl_framebuffer_set_samples_per_pixel()
|
|
2337
|
+
* then you can optionally call this function (or
|
|
2338
|
+
* cogl_framebuffer_resolve_samples()) to explicitly resolve the point
|
|
2339
|
+
* samples into values for the final color buffer.
|
|
2340
|
+
*
|
|
2341
|
+
* Some GPUs will implicitly resolve the point samples during
|
|
2342
|
+
* rendering and so this function is effectively a nop, but with other
|
|
2343
|
+
* architectures it is desirable to defer the resolve step until the
|
|
2344
|
+
* end of the frame.
|
|
2345
|
+
*
|
|
2346
|
+
* Use of this API is recommended if incremental, small updates to
|
|
2347
|
+
* a framebuffer are being made because by default Cogl will
|
|
2348
|
+
* implicitly resolve all the point samples of the framebuffer which
|
|
2349
|
+
* can result in redundant work if only a small number of samples have
|
|
2350
|
+
* changed.
|
|
2351
|
+
*
|
|
2352
|
+
* Because some GPUs implicitly resolve point samples this function
|
|
2353
|
+
* only guarantees that at-least the region specified will be resolved
|
|
2354
|
+
* and if you have rendered to a larger region then it's possible that
|
|
2355
|
+
* other samples may be implicitly resolved.
|
|
2356
|
+
* @param x top-left x coordinate of region to resolve
|
|
2357
|
+
* @param y top-left y coordinate of region to resolve
|
|
2358
|
+
* @param width width of region to resolve
|
|
2359
|
+
* @param height height of region to resolve
|
|
2360
|
+
*/
|
|
2361
|
+
resolve_samples_region(x: number, y: number, width: number, height: number): void
|
|
2362
|
+
/**
|
|
2363
|
+
* Multiplies the current model-view matrix by one that rotates the
|
|
2364
|
+
* model around the axis-vector specified by `x,` `y` and `z`. The
|
|
2365
|
+
* rotation follows the right-hand thumb rule so for example rotating
|
|
2366
|
+
* by 10 degrees about the axis-vector (0, 0, 1) causes a small
|
|
2367
|
+
* counter-clockwise rotation.
|
|
2368
|
+
* @param angle Angle in degrees to rotate.
|
|
2369
|
+
* @param x X-component of vertex to rotate around.
|
|
2370
|
+
* @param y Y-component of vertex to rotate around.
|
|
2371
|
+
* @param z Z-component of vertex to rotate around.
|
|
2372
|
+
*/
|
|
2373
|
+
rotate(angle: number, x: number, y: number, z: number): void
|
|
2374
|
+
/**
|
|
2375
|
+
* Multiplies the current model-view matrix by one that rotates
|
|
2376
|
+
* according to the rotation described by `euler`.
|
|
2377
|
+
* @param euler A #graphene_euler_t
|
|
2378
|
+
*/
|
|
2379
|
+
rotate_euler(euler: Graphene.Euler): void
|
|
2380
|
+
/**
|
|
2381
|
+
* Multiplies the current model-view matrix by one that scales the x,
|
|
2382
|
+
* y and z axes by the given values.
|
|
2383
|
+
* @param x Amount to scale along the x-axis
|
|
2384
|
+
* @param y Amount to scale along the y-axis
|
|
2385
|
+
* @param z Amount to scale along the z-axis
|
|
2386
|
+
*/
|
|
2387
|
+
scale(x: number, y: number, z: number): void
|
|
2388
|
+
/**
|
|
2389
|
+
* Enables or disables depth buffer writing when rendering to `framebuffer`.
|
|
2390
|
+
* If depth writing is enabled for both the framebuffer and the rendering
|
|
2391
|
+
* pipeline, and the framebuffer has an associated depth buffer, depth
|
|
2392
|
+
* information will be written to this buffer during rendering.
|
|
2393
|
+
*
|
|
2394
|
+
* Depth buffer writing is enabled by default.
|
|
2395
|
+
* @param depth_write_enabled %TRUE to enable depth writing or %FALSE to disable
|
|
2396
|
+
*/
|
|
2397
|
+
set_depth_write_enabled(depth_write_enabled: boolean): void
|
|
2398
|
+
/**
|
|
2399
|
+
* Enables or disabled dithering if supported by the hardware.
|
|
2400
|
+
*
|
|
2401
|
+
* Dithering is a hardware dependent technique to increase the visible
|
|
2402
|
+
* color resolution beyond what the underlying hardware supports by playing
|
|
2403
|
+
* tricks with the colors placed into the framebuffer to give the illusion
|
|
2404
|
+
* of other colors. (For example this can be compared to half-toning used
|
|
2405
|
+
* by some news papers to show varying levels of grey even though their may
|
|
2406
|
+
* only be black and white are available).
|
|
2407
|
+
*
|
|
2408
|
+
* If the current display pipeline for `framebuffer` does not support dithering
|
|
2409
|
+
* then this has no affect.
|
|
2410
|
+
*
|
|
2411
|
+
* Dithering is enabled by default.
|
|
2412
|
+
* @param dither_enabled %TRUE to enable dithering or %FALSE to disable
|
|
2413
|
+
*/
|
|
2414
|
+
set_dither_enabled(dither_enabled: boolean): void
|
|
2415
|
+
/**
|
|
2416
|
+
* Sets `matrix` as the new model-view matrix.
|
|
2417
|
+
* @param matrix the new model-view matrix
|
|
2418
|
+
*/
|
|
2419
|
+
set_modelview_matrix(matrix: Graphene.Matrix): void
|
|
2420
|
+
/**
|
|
2421
|
+
* Sets `matrix` as the new projection matrix.
|
|
2422
|
+
* @param matrix the new projection matrix
|
|
2423
|
+
*/
|
|
2424
|
+
set_projection_matrix(matrix: Graphene.Matrix): void
|
|
2425
|
+
/**
|
|
2426
|
+
* Requires that when rendering to `framebuffer` then `n` point samples
|
|
2427
|
+
* should be made per pixel which will all contribute to the final
|
|
2428
|
+
* resolved color for that pixel. The idea is that the hardware aims
|
|
2429
|
+
* to get quality similar to what you would get if you rendered
|
|
2430
|
+
* everything twice as big (for 4 samples per pixel) and then scaled
|
|
2431
|
+
* that image back down with filtering. It can effectively remove the
|
|
2432
|
+
* jagged edges of polygons and should be more efficient than if you
|
|
2433
|
+
* were to manually render at a higher resolution and downscale
|
|
2434
|
+
* because the hardware is often able to take some shortcuts. For
|
|
2435
|
+
* example the GPU may only calculate a single texture sample for all
|
|
2436
|
+
* points of a single pixel, and for tile based architectures all the
|
|
2437
|
+
* extra sample data (such as depth and stencil samples) may be
|
|
2438
|
+
* handled on-chip and so avoid increased demand on system memory
|
|
2439
|
+
* bandwidth.
|
|
2440
|
+
*
|
|
2441
|
+
* By default this value is usually set to 0 and that is referred to
|
|
2442
|
+
* as "single-sample" rendering. A value of 1 or greater is referred
|
|
2443
|
+
* to as "multisample" rendering.
|
|
2444
|
+
*
|
|
2445
|
+
* <note>There are some semantic differences between single-sample
|
|
2446
|
+
* rendering and multisampling with just 1 point sample such as it
|
|
2447
|
+
* being redundant to use the cogl_framebuffer_resolve_samples() and
|
|
2448
|
+
* cogl_framebuffer_resolve_samples_region() apis with single-sample
|
|
2449
|
+
* rendering.</note>
|
|
2450
|
+
*
|
|
2451
|
+
* <note>It's recommended that
|
|
2452
|
+
* cogl_framebuffer_resolve_samples_region() be explicitly used at the
|
|
2453
|
+
* end of rendering to a point sample buffer to minimize the number of
|
|
2454
|
+
* samples that get resolved. By default Cogl will implicitly resolve
|
|
2455
|
+
* all framebuffer samples but if only a small region of a
|
|
2456
|
+
* framebuffer has changed this can lead to redundant work being
|
|
2457
|
+
* done.</note>
|
|
2458
|
+
* @param samples_per_pixel The minimum number of samples per pixel
|
|
2459
|
+
*/
|
|
2460
|
+
set_samples_per_pixel(samples_per_pixel: number): void
|
|
2461
|
+
/**
|
|
2462
|
+
* Sets which stereo buffers should be drawn to. The default
|
|
2463
|
+
* is %COGL_STEREO_BOTH, which means that both the left and
|
|
2464
|
+
* right buffers will be affected by drawing. For this to have
|
|
2465
|
+
* an effect, the display system must support stereo drawables,
|
|
2466
|
+
* and the framebuffer must have been created with stereo
|
|
2467
|
+
* enabled. (See cogl_onscreen_template_set_stereo_enabled(),
|
|
2468
|
+
* cogl_framebuffer_get_is_stereo().)
|
|
2469
|
+
* @param stereo_mode A #CoglStereoMode specifying which stereo buffers should be drawn tow.
|
|
2470
|
+
*/
|
|
2471
|
+
set_stereo_mode(stereo_mode: StereoMode): void
|
|
2472
|
+
/**
|
|
2473
|
+
* Defines a scale and offset for everything rendered relative to the
|
|
2474
|
+
* top-left of the destination framebuffer.
|
|
2475
|
+
*
|
|
2476
|
+
* By default the viewport has an origin of (0,0) and width and height
|
|
2477
|
+
* that match the framebuffer's size. Assuming a default projection and
|
|
2478
|
+
* modelview matrix then you could translate the contents of a window
|
|
2479
|
+
* down and right by leaving the viewport size unchanged by moving the
|
|
2480
|
+
* offset to (10,10). The viewport coordinates are measured in pixels.
|
|
2481
|
+
* If you left the x and y origin as (0,0) you could scale the windows
|
|
2482
|
+
* contents down by specify and width and height that's half the real
|
|
2483
|
+
* size of the framebuffer.
|
|
2484
|
+
*
|
|
2485
|
+
* <note>Although the function takes floating point arguments, existing
|
|
2486
|
+
* drivers only allow the use of integer values. In the future floating
|
|
2487
|
+
* point values will be exposed via a checkable feature.</note>
|
|
2488
|
+
* @param x The top-left x coordinate of the viewport origin (only integers supported currently)
|
|
2489
|
+
* @param y The top-left y coordinate of the viewport origin (only integers supported currently)
|
|
2490
|
+
* @param width The width of the viewport (only integers supported currently)
|
|
2491
|
+
* @param height The height of the viewport (only integers supported currently)
|
|
2492
|
+
*/
|
|
2493
|
+
set_viewport(x: number, y: number, width: number, height: number): void
|
|
2494
|
+
/**
|
|
2495
|
+
* Multiplies the current model-view matrix by the given matrix.
|
|
2496
|
+
* @param matrix the matrix to multiply with the current model-view
|
|
2497
|
+
*/
|
|
2498
|
+
transform(matrix: Graphene.Matrix): void
|
|
2499
|
+
/**
|
|
2500
|
+
* Multiplies the current model-view matrix by one that translates the
|
|
2501
|
+
* model along all three axes according to the given values.
|
|
2502
|
+
* @param x Distance to translate along the x-axis
|
|
2503
|
+
* @param y Distance to translate along the y-axis
|
|
2504
|
+
* @param z Distance to translate along the z-axis
|
|
2505
|
+
*/
|
|
2506
|
+
translate(x: number, y: number, z: number): void
|
|
2507
|
+
|
|
2508
|
+
// Own virtual methods of Cogl-10.Cogl.Framebuffer
|
|
2509
|
+
|
|
2510
|
+
/**
|
|
2511
|
+
* Explicitly allocates a configured #CoglFramebuffer allowing developers to
|
|
2512
|
+
* check and handle any errors that might arise from an unsupported
|
|
2513
|
+
* configuration so that fallback configurations may be tried.
|
|
2514
|
+
*
|
|
2515
|
+
* <note>Many applications don't support any fallback options at least when
|
|
2516
|
+
* they are initially developed and in that case the don't need to use this API
|
|
2517
|
+
* since Cogl will automatically allocate a framebuffer when it first gets
|
|
2518
|
+
* used. The disadvantage of relying on automatic allocation is that the
|
|
2519
|
+
* program will abort with an error message if there is an error during
|
|
2520
|
+
* automatic allocation.</note>
|
|
2521
|
+
* @virtual
|
|
2522
|
+
* @returns %TRUE if there were no error allocating the framebuffer, else %FALSE.
|
|
2523
|
+
*/
|
|
2524
|
+
vfunc_allocate(): boolean
|
|
2525
|
+
vfunc_is_y_flipped(): boolean
|
|
2526
|
+
|
|
2527
|
+
// Own signals of Cogl-10.Cogl.Framebuffer
|
|
2528
|
+
|
|
2529
|
+
connect(sigName: "destroy", callback: Framebuffer.DestroySignalCallback): number
|
|
2530
|
+
connect_after(sigName: "destroy", callback: Framebuffer.DestroySignalCallback): number
|
|
2531
|
+
emit(sigName: "destroy", ...args: any[]): void
|
|
2532
|
+
|
|
2533
|
+
// Class property signals of Cogl-10.Cogl.Framebuffer
|
|
2534
|
+
|
|
2535
|
+
connect(sigName: "notify::driver-config", callback: (($obj: Framebuffer, pspec: GObject.ParamSpec) => void)): number
|
|
2536
|
+
connect_after(sigName: "notify::driver-config", callback: (($obj: Framebuffer, pspec: GObject.ParamSpec) => void)): number
|
|
2537
|
+
emit(sigName: "notify::driver-config", ...args: any[]): void
|
|
2538
|
+
connect(sigName: "notify::height", callback: (($obj: Framebuffer, pspec: GObject.ParamSpec) => void)): number
|
|
2539
|
+
connect_after(sigName: "notify::height", callback: (($obj: Framebuffer, pspec: GObject.ParamSpec) => void)): number
|
|
2540
|
+
emit(sigName: "notify::height", ...args: any[]): void
|
|
2541
|
+
connect(sigName: "notify::width", callback: (($obj: Framebuffer, pspec: GObject.ParamSpec) => void)): number
|
|
2542
|
+
connect_after(sigName: "notify::width", callback: (($obj: Framebuffer, pspec: GObject.ParamSpec) => void)): number
|
|
2543
|
+
emit(sigName: "notify::width", ...args: any[]): void
|
|
2544
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
2545
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
2546
|
+
emit(sigName: string, ...args: any[]): void
|
|
2547
|
+
disconnect(id: number): void
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
class Framebuffer extends GObject.Object {
|
|
2551
|
+
|
|
2552
|
+
// Own properties of Cogl-10.Cogl.Framebuffer
|
|
2553
|
+
|
|
2554
|
+
static name: string
|
|
2555
|
+
static $gtype: GObject.GType<Framebuffer>
|
|
2556
|
+
|
|
2557
|
+
// Constructors of Cogl-10.Cogl.Framebuffer
|
|
2558
|
+
|
|
2559
|
+
constructor(config?: Framebuffer.ConstructorProperties)
|
|
2560
|
+
_init(config?: Framebuffer.ConstructorProperties): void
|
|
2561
|
+
static error_quark(): number
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
module Object {
|
|
2565
|
+
|
|
2566
|
+
// Constructor properties interface
|
|
2567
|
+
|
|
2568
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
2569
|
+
}
|
|
2570
|
+
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
interface Object {
|
|
2574
|
+
|
|
2575
|
+
// Class property signals of Cogl-10.Cogl.Object
|
|
2576
|
+
|
|
2577
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
2578
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
2579
|
+
emit(sigName: string, ...args: any[]): void
|
|
2580
|
+
disconnect(id: number): void
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2583
|
+
class Object extends GObject.Object {
|
|
2584
|
+
|
|
2585
|
+
// Own properties of Cogl-10.Cogl.Object
|
|
2586
|
+
|
|
2587
|
+
static name: string
|
|
2588
|
+
static $gtype: GObject.GType<Object>
|
|
2589
|
+
|
|
2590
|
+
// Constructors of Cogl-10.Cogl.Object
|
|
2591
|
+
|
|
2592
|
+
constructor(config?: Object.ConstructorProperties)
|
|
2593
|
+
_init(config?: Object.ConstructorProperties): void
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
module Offscreen {
|
|
2597
|
+
|
|
2598
|
+
// Constructor properties interface
|
|
2599
|
+
|
|
2600
|
+
interface ConstructorProperties extends Framebuffer.ConstructorProperties {
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
interface Offscreen {
|
|
2606
|
+
|
|
2607
|
+
// Class property signals of Cogl-10.Cogl.Offscreen
|
|
2608
|
+
|
|
2609
|
+
connect(sigName: "notify::driver-config", callback: (($obj: Offscreen, pspec: GObject.ParamSpec) => void)): number
|
|
2610
|
+
connect_after(sigName: "notify::driver-config", callback: (($obj: Offscreen, pspec: GObject.ParamSpec) => void)): number
|
|
2611
|
+
emit(sigName: "notify::driver-config", ...args: any[]): void
|
|
2612
|
+
connect(sigName: "notify::height", callback: (($obj: Offscreen, pspec: GObject.ParamSpec) => void)): number
|
|
2613
|
+
connect_after(sigName: "notify::height", callback: (($obj: Offscreen, pspec: GObject.ParamSpec) => void)): number
|
|
2614
|
+
emit(sigName: "notify::height", ...args: any[]): void
|
|
2615
|
+
connect(sigName: "notify::width", callback: (($obj: Offscreen, pspec: GObject.ParamSpec) => void)): number
|
|
2616
|
+
connect_after(sigName: "notify::width", callback: (($obj: Offscreen, pspec: GObject.ParamSpec) => void)): number
|
|
2617
|
+
emit(sigName: "notify::width", ...args: any[]): void
|
|
2618
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
2619
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
2620
|
+
emit(sigName: string, ...args: any[]): void
|
|
2621
|
+
disconnect(id: number): void
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
class Offscreen extends Framebuffer {
|
|
2625
|
+
|
|
2626
|
+
// Own properties of Cogl-10.Cogl.Offscreen
|
|
2627
|
+
|
|
2628
|
+
static name: string
|
|
2629
|
+
static $gtype: GObject.GType<Offscreen>
|
|
2630
|
+
|
|
2631
|
+
// Constructors of Cogl-10.Cogl.Offscreen
|
|
2632
|
+
|
|
2633
|
+
constructor(config?: Offscreen.ConstructorProperties)
|
|
2634
|
+
/**
|
|
2635
|
+
* This creates an offscreen framebuffer object using the given
|
|
2636
|
+
* `texture` as the primary color buffer. It doesn't just initialize
|
|
2637
|
+
* the contents of the offscreen buffer with the `texture;` they are
|
|
2638
|
+
* tightly bound so that drawing to the offscreen buffer effectively
|
|
2639
|
+
* updates the contents of the given texture. You don't need to
|
|
2640
|
+
* destroy the offscreen buffer before you can use the `texture` again.
|
|
2641
|
+
*
|
|
2642
|
+
* <note>This api only works with low-level #CoglTexture types such as
|
|
2643
|
+
* #CoglTexture2D and not with meta-texture types such as
|
|
2644
|
+
* #CoglTexture2DSliced.</note>
|
|
2645
|
+
*
|
|
2646
|
+
* The storage for the framebuffer is actually allocated lazily
|
|
2647
|
+
* so this function will never return %NULL to indicate a runtime
|
|
2648
|
+
* error. This means it is still possible to configure the framebuffer
|
|
2649
|
+
* before it is really allocated.
|
|
2650
|
+
*
|
|
2651
|
+
* Simple applications without full error handling can simply rely on
|
|
2652
|
+
* Cogl to lazily allocate the storage of framebuffers but you should
|
|
2653
|
+
* be aware that if Cogl encounters an error (such as running out of
|
|
2654
|
+
* GPU memory) then your application will simply abort with an error
|
|
2655
|
+
* message. If you need to be able to catch such exceptions at runtime
|
|
2656
|
+
* then you can explicitly allocate your framebuffer when you have
|
|
2657
|
+
* finished configuring it by calling cogl_framebuffer_allocate() and
|
|
2658
|
+
* passing in a #GError argument to catch any exceptions.
|
|
2659
|
+
* @constructor
|
|
2660
|
+
* @param texture A #CoglTexture pointer
|
|
2661
|
+
* @returns a newly instantiated #CoglOffscreen framebuffer.
|
|
2662
|
+
*/
|
|
2663
|
+
static new_with_texture(texture: Texture): Offscreen
|
|
2664
|
+
_init(config?: Offscreen.ConstructorProperties): void
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
module Onscreen {
|
|
2668
|
+
|
|
2669
|
+
// Constructor properties interface
|
|
2670
|
+
|
|
2671
|
+
interface ConstructorProperties extends Framebuffer.ConstructorProperties {
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
interface Onscreen {
|
|
2677
|
+
|
|
2678
|
+
// Own fields of Cogl-10.Cogl.Onscreen
|
|
2679
|
+
|
|
2680
|
+
parent_instance: Framebuffer & GObject.Object
|
|
2681
|
+
|
|
2682
|
+
// Owm methods of Cogl-10.Cogl.Onscreen
|
|
2683
|
+
|
|
2684
|
+
/**
|
|
2685
|
+
* Installs a `callback` function that will be called whenever the
|
|
2686
|
+
* window system has lost the contents of a region of the onscreen
|
|
2687
|
+
* buffer and the application should redraw it to repair the buffer.
|
|
2688
|
+
* For example this may happen in a window system without a compositor
|
|
2689
|
+
* if a window that was previously covering up the onscreen window has
|
|
2690
|
+
* been moved causing a region of the onscreen to be exposed.
|
|
2691
|
+
*
|
|
2692
|
+
* The `callback` will be passed a #CoglOnscreenDirtyInfo struct which
|
|
2693
|
+
* describes a rectangle containing the newly dirtied region. Note that
|
|
2694
|
+
* this may be called multiple times to describe a non-rectangular
|
|
2695
|
+
* region composed of multiple smaller rectangles.
|
|
2696
|
+
*
|
|
2697
|
+
* The dirty events are separate from %COGL_FRAME_EVENT_SYNC events so
|
|
2698
|
+
* the application should also listen for this event before rendering
|
|
2699
|
+
* the dirty region to ensure that the framebuffer is actually ready
|
|
2700
|
+
* for rendering.
|
|
2701
|
+
* @param callback A callback function to call for dirty events
|
|
2702
|
+
* @param destroy An optional callback to destroy `user_data` when the `callback` is removed or `onscreen` is freed.
|
|
2703
|
+
* @returns a #CoglOnscreenDirtyClosure pointer that can be used to remove the callback and associated @user_data later.
|
|
2704
|
+
*/
|
|
2705
|
+
add_dirty_callback(callback: OnscreenDirtyCallback, destroy: UserDataDestroyCallback | null): OnscreenDirtyClosure
|
|
2706
|
+
/**
|
|
2707
|
+
* Installs a `callback` function that will be called for significant
|
|
2708
|
+
* events relating to the given `onscreen` framebuffer.
|
|
2709
|
+
*
|
|
2710
|
+
* The `callback` will be used to notify when the system compositor is
|
|
2711
|
+
* ready for this application to render a new frame. In this case
|
|
2712
|
+
* %COGL_FRAME_EVENT_SYNC will be passed as the event argument to the
|
|
2713
|
+
* given `callback` in addition to the #CoglFrameInfo corresponding to
|
|
2714
|
+
* the frame being acknowledged by the compositor.
|
|
2715
|
+
*
|
|
2716
|
+
* The `callback` will also be called to notify when the frame has
|
|
2717
|
+
* ended. In this case %COGL_FRAME_EVENT_COMPLETE will be passed as
|
|
2718
|
+
* the event argument to the given `callback` in addition to the
|
|
2719
|
+
* #CoglFrameInfo corresponding to the newly presented frame. The
|
|
2720
|
+
* meaning of "ended" here simply means that no more timing
|
|
2721
|
+
* information will be collected within the corresponding
|
|
2722
|
+
* #CoglFrameInfo and so this is a good opportunity to analyse the
|
|
2723
|
+
* given info. It does not necessarily mean that the GPU has finished
|
|
2724
|
+
* rendering the corresponding frame.
|
|
2725
|
+
*
|
|
2726
|
+
* We highly recommend throttling your application according to
|
|
2727
|
+
* %COGL_FRAME_EVENT_SYNC events so that your application can avoid
|
|
2728
|
+
* wasting resources, drawing more frames than your system compositor
|
|
2729
|
+
* can display.
|
|
2730
|
+
* @param callback A callback function to call for frame events
|
|
2731
|
+
* @param destroy An optional callback to destroy `user_data` when the `callback` is removed or `onscreen` is freed.
|
|
2732
|
+
* @returns a #CoglFrameClosure pointer that can be used to remove the callback and associated @user_data later.
|
|
2733
|
+
*/
|
|
2734
|
+
add_frame_callback(callback: FrameCallback, destroy: UserDataDestroyCallback | null): FrameClosure
|
|
2735
|
+
/**
|
|
2736
|
+
* Gets the current age of the buffer contents.
|
|
2737
|
+
*
|
|
2738
|
+
* This function allows applications to query the age of the current
|
|
2739
|
+
* back buffer contents for a #CoglOnscreen as the number of frames
|
|
2740
|
+
* elapsed since the contents were most recently defined.
|
|
2741
|
+
*
|
|
2742
|
+
* These age values exposes enough information to applications about
|
|
2743
|
+
* how Cogl internally manages back buffers to allow applications to
|
|
2744
|
+
* re-use the contents of old frames and minimize how much must be
|
|
2745
|
+
* redrawn for the next frame.
|
|
2746
|
+
*
|
|
2747
|
+
* The back buffer contents can either be reported as invalid (has an
|
|
2748
|
+
* age of 0) or it may be reported to be the same contents as from n
|
|
2749
|
+
* frames prior to the current frame.
|
|
2750
|
+
*
|
|
2751
|
+
* The queried value remains valid until the next buffer swap.
|
|
2752
|
+
*
|
|
2753
|
+
* <note>One caveat is that under X11 the buffer age does not reflect
|
|
2754
|
+
* changes to buffer contents caused by the window systems. X11
|
|
2755
|
+
* applications must track Expose events to determine what buffer
|
|
2756
|
+
* regions need to additionally be repaired each frame.</note>
|
|
2757
|
+
*
|
|
2758
|
+
* The recommended way to take advantage of this buffer age api is to
|
|
2759
|
+
* build up a circular buffer of length 3 for tracking damage regions
|
|
2760
|
+
* over the last 3 frames and when starting a new frame look at the
|
|
2761
|
+
* age of the buffer and combine the damage regions for the current
|
|
2762
|
+
* frame with the damage regions of previous `age` frames so you know
|
|
2763
|
+
* everything that must be redrawn to update the old contents for the
|
|
2764
|
+
* new frame.
|
|
2765
|
+
*
|
|
2766
|
+
* <note>If the system doesn't not support being able to track the age
|
|
2767
|
+
* of back buffers then this function will always return 0 which
|
|
2768
|
+
* implies that the contents are undefined.</note>
|
|
2769
|
+
*
|
|
2770
|
+
* <note>The %COGL_FEATURE_ID_BUFFER_AGE feature can optionally be
|
|
2771
|
+
* explicitly checked to determine if Cogl is currently tracking the
|
|
2772
|
+
* age of #CoglOnscreen back buffer contents. If this feature is
|
|
2773
|
+
* missing then this function will always return 0.</note>
|
|
2774
|
+
* @returns The age of the buffer contents or 0 when the buffer contents are undefined.
|
|
2775
|
+
*/
|
|
2776
|
+
get_buffer_age(): number
|
|
2777
|
+
/**
|
|
2778
|
+
* Gets the value of the framebuffers frame counter. This is
|
|
2779
|
+
* a counter that increases by one each time
|
|
2780
|
+
* cogl_onscreen_swap_buffers() or cogl_onscreen_swap_region()
|
|
2781
|
+
* is called.
|
|
2782
|
+
* @returns the current frame counter value
|
|
2783
|
+
*/
|
|
2784
|
+
get_frame_counter(): number
|
|
2785
|
+
/**
|
|
2786
|
+
* This requests to make `onscreen` invisible to the user.
|
|
2787
|
+
*
|
|
2788
|
+
* Actually the precise semantics of this function depend on the
|
|
2789
|
+
* window system currently in use, and if you don't have a
|
|
2790
|
+
* multi-windowining system this function may in-fact do nothing.
|
|
2791
|
+
*
|
|
2792
|
+
* This function does not implicitly allocate the given `onscreen`
|
|
2793
|
+
* framebuffer before hiding it.
|
|
2794
|
+
*
|
|
2795
|
+
* <note>Since Cogl doesn't explicitly track the visibility status of
|
|
2796
|
+
* onscreen framebuffers it won't try to avoid redundant window system
|
|
2797
|
+
* requests e.g. to show an already visible window. This also means
|
|
2798
|
+
* that it's acceptable to alternatively use native APIs to show and
|
|
2799
|
+
* hide windows without confusing Cogl.</note>
|
|
2800
|
+
*/
|
|
2801
|
+
hide(): void
|
|
2802
|
+
/**
|
|
2803
|
+
* Implementation for https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_partial_update.txt
|
|
2804
|
+
* This immediately queues state to OpenGL that will be used for the
|
|
2805
|
+
* next swap.
|
|
2806
|
+
* This needs to be called every frame.
|
|
2807
|
+
* @param rectangles An array of integer 4-tuples representing damaged rectangles as (x, y, width, height) tuples.
|
|
2808
|
+
* @param n_rectangles The number of 4-tuples to be read from `rectangles`
|
|
2809
|
+
*/
|
|
2810
|
+
queue_damage_region(rectangles: number, n_rectangles: number): void
|
|
2811
|
+
/**
|
|
2812
|
+
* Removes a callback and associated user data that were previously
|
|
2813
|
+
* registered using cogl_onscreen_add_dirty_callback().
|
|
2814
|
+
*
|
|
2815
|
+
* If a destroy callback was passed to
|
|
2816
|
+
* cogl_onscreen_add_dirty_callback() to destroy the user data then
|
|
2817
|
+
* this will also get called.
|
|
2818
|
+
* @param closure A #CoglOnscreenDirtyClosure returned from cogl_onscreen_add_dirty_callback()
|
|
2819
|
+
*/
|
|
2820
|
+
remove_dirty_callback(closure: OnscreenDirtyClosure): void
|
|
2821
|
+
/**
|
|
2822
|
+
* Removes a callback and associated user data that were previously
|
|
2823
|
+
* registered using cogl_onscreen_add_frame_callback().
|
|
2824
|
+
*
|
|
2825
|
+
* If a destroy callback was passed to
|
|
2826
|
+
* cogl_onscreen_add_frame_callback() to destroy the user data then
|
|
2827
|
+
* this will get called.
|
|
2828
|
+
* @param closure A #CoglFrameClosure returned from cogl_onscreen_add_frame_callback()
|
|
2829
|
+
*/
|
|
2830
|
+
remove_frame_callback(closure: FrameClosure): void
|
|
2831
|
+
/**
|
|
2832
|
+
* This requests to make `onscreen` visible to the user.
|
|
2833
|
+
*
|
|
2834
|
+
* Actually the precise semantics of this function depend on the
|
|
2835
|
+
* window system currently in use, and if you don't have a
|
|
2836
|
+
* multi-windowining system this function may in-fact do nothing.
|
|
2837
|
+
*
|
|
2838
|
+
* This function will implicitly allocate the given `onscreen`
|
|
2839
|
+
* framebuffer before showing it if it hasn't already been allocated.
|
|
2840
|
+
*
|
|
2841
|
+
* When using the Wayland winsys calling this will set the surface to
|
|
2842
|
+
* a toplevel type which will make it appear. If the application wants
|
|
2843
|
+
* to set a different type for the surface, it can avoid calling
|
|
2844
|
+
* cogl_onscreen_show() and set its own type directly with the Wayland
|
|
2845
|
+
* client API via cogl_wayland_onscreen_get_surface().
|
|
2846
|
+
*
|
|
2847
|
+
* <note>Since Cogl doesn't explicitly track the visibility status of
|
|
2848
|
+
* onscreen framebuffers it won't try to avoid redundant window system
|
|
2849
|
+
* requests e.g. to show an already visible window. This also means
|
|
2850
|
+
* that it's acceptable to alternatively use native APIs to show and
|
|
2851
|
+
* hide windows without confusing Cogl.</note>
|
|
2852
|
+
*/
|
|
2853
|
+
show(): void
|
|
2854
|
+
/**
|
|
2855
|
+
* Swaps the current back buffer being rendered too, to the front for display.
|
|
2856
|
+
*
|
|
2857
|
+
* This function also implicitly discards the contents of the color, depth and
|
|
2858
|
+
* stencil buffers as if cogl_framebuffer_discard_buffers() were used. The
|
|
2859
|
+
* significance of the discard is that you should not expect to be able to
|
|
2860
|
+
* start a new frame that incrementally builds on the contents of the previous
|
|
2861
|
+
* frame.
|
|
2862
|
+
*
|
|
2863
|
+
* <note>It is highly recommended that applications use
|
|
2864
|
+
* cogl_onscreen_swap_buffers_with_damage() instead whenever possible
|
|
2865
|
+
* and also use the cogl_onscreen_get_buffer_age() api so they can
|
|
2866
|
+
* perform incremental updates to older buffers instead of having to
|
|
2867
|
+
* render a full buffer for every frame.</note>
|
|
2868
|
+
* @param frame_info
|
|
2869
|
+
* @param user_data
|
|
2870
|
+
*/
|
|
2871
|
+
swap_buffers(frame_info: FrameInfo, user_data: any | null): void
|
|
2872
|
+
/**
|
|
2873
|
+
* Swaps the current back buffer being rendered too, to the front for
|
|
2874
|
+
* display and provides information to any system compositor about
|
|
2875
|
+
* what regions of the buffer have changed (damage) with respect to
|
|
2876
|
+
* the last swapped buffer.
|
|
2877
|
+
*
|
|
2878
|
+
* This function has the same semantics as
|
|
2879
|
+
* cogl_framebuffer_swap_buffers() except that it additionally allows
|
|
2880
|
+
* applications to pass a list of damaged rectangles which may be
|
|
2881
|
+
* passed on to a compositor so that it can minimize how much of the
|
|
2882
|
+
* screen is redrawn in response to this applications newly swapped
|
|
2883
|
+
* front buffer.
|
|
2884
|
+
*
|
|
2885
|
+
* For example if your application is only animating a small object in
|
|
2886
|
+
* the corner of the screen and everything else is remaining static
|
|
2887
|
+
* then it can help the compositor to know that only the bottom right
|
|
2888
|
+
* corner of your newly swapped buffer has really changed with respect
|
|
2889
|
+
* to your previously swapped front buffer.
|
|
2890
|
+
*
|
|
2891
|
+
* If `n_rectangles` is 0 then the whole buffer will implicitly be
|
|
2892
|
+
* reported as damaged as if cogl_onscreen_swap_buffers() had been
|
|
2893
|
+
* called.
|
|
2894
|
+
*
|
|
2895
|
+
* This function also implicitly discards the contents of the color,
|
|
2896
|
+
* depth and stencil buffers as if cogl_framebuffer_discard_buffers()
|
|
2897
|
+
* were used. The significance of the discard is that you should not
|
|
2898
|
+
* expect to be able to start a new frame that incrementally builds on
|
|
2899
|
+
* the contents of the previous frame. If you want to perform
|
|
2900
|
+
* incremental updates to older back buffers then please refer to the
|
|
2901
|
+
* cogl_onscreen_get_buffer_age() api.
|
|
2902
|
+
*
|
|
2903
|
+
* Whenever possible it is recommended that applications use this
|
|
2904
|
+
* function instead of cogl_onscreen_swap_buffers() to improve
|
|
2905
|
+
* performance when running under a compositor.
|
|
2906
|
+
*
|
|
2907
|
+
* <note>It is highly recommended to use this API in conjunction with
|
|
2908
|
+
* the cogl_onscreen_get_buffer_age() api so that your application can
|
|
2909
|
+
* perform incremental rendering based on old back buffers.</note>
|
|
2910
|
+
* @param rectangles An array of integer 4-tuples representing damaged rectangles as (x, y, width, height) tuples.
|
|
2911
|
+
* @param n_rectangles The number of 4-tuples to be read from `rectangles`
|
|
2912
|
+
* @param info
|
|
2913
|
+
* @param user_data
|
|
2914
|
+
*/
|
|
2915
|
+
swap_buffers_with_damage(rectangles: number, n_rectangles: number, info: FrameInfo, user_data: any | null): void
|
|
2916
|
+
/**
|
|
2917
|
+
* Swaps a region of the back buffer being rendered too, to the front for
|
|
2918
|
+
* display. `rectangles` represents the region as array of `n_rectangles` each
|
|
2919
|
+
* defined by 4 sequential (x, y, width, height) integers.
|
|
2920
|
+
*
|
|
2921
|
+
* This function also implicitly discards the contents of the color, depth and
|
|
2922
|
+
* stencil buffers as if cogl_framebuffer_discard_buffers() were used. The
|
|
2923
|
+
* significance of the discard is that you should not expect to be able to
|
|
2924
|
+
* start a new frame that incrementally builds on the contents of the previous
|
|
2925
|
+
* frame.
|
|
2926
|
+
* @param rectangles An array of integer 4-tuples representing rectangles as (x, y, width, height) tuples.
|
|
2927
|
+
* @param n_rectangles The number of 4-tuples to be read from `rectangles`
|
|
2928
|
+
* @param info
|
|
2929
|
+
* @param user_data
|
|
2930
|
+
*/
|
|
2931
|
+
swap_region(rectangles: number, n_rectangles: number, info: FrameInfo, user_data: any | null): void
|
|
2932
|
+
|
|
2933
|
+
// Own virtual methods of Cogl-10.Cogl.Onscreen
|
|
2934
|
+
|
|
2935
|
+
vfunc_bind(): void
|
|
2936
|
+
/**
|
|
2937
|
+
* Gets the current age of the buffer contents.
|
|
2938
|
+
*
|
|
2939
|
+
* This function allows applications to query the age of the current
|
|
2940
|
+
* back buffer contents for a #CoglOnscreen as the number of frames
|
|
2941
|
+
* elapsed since the contents were most recently defined.
|
|
2942
|
+
*
|
|
2943
|
+
* These age values exposes enough information to applications about
|
|
2944
|
+
* how Cogl internally manages back buffers to allow applications to
|
|
2945
|
+
* re-use the contents of old frames and minimize how much must be
|
|
2946
|
+
* redrawn for the next frame.
|
|
2947
|
+
*
|
|
2948
|
+
* The back buffer contents can either be reported as invalid (has an
|
|
2949
|
+
* age of 0) or it may be reported to be the same contents as from n
|
|
2950
|
+
* frames prior to the current frame.
|
|
2951
|
+
*
|
|
2952
|
+
* The queried value remains valid until the next buffer swap.
|
|
2953
|
+
*
|
|
2954
|
+
* <note>One caveat is that under X11 the buffer age does not reflect
|
|
2955
|
+
* changes to buffer contents caused by the window systems. X11
|
|
2956
|
+
* applications must track Expose events to determine what buffer
|
|
2957
|
+
* regions need to additionally be repaired each frame.</note>
|
|
2958
|
+
*
|
|
2959
|
+
* The recommended way to take advantage of this buffer age api is to
|
|
2960
|
+
* build up a circular buffer of length 3 for tracking damage regions
|
|
2961
|
+
* over the last 3 frames and when starting a new frame look at the
|
|
2962
|
+
* age of the buffer and combine the damage regions for the current
|
|
2963
|
+
* frame with the damage regions of previous `age` frames so you know
|
|
2964
|
+
* everything that must be redrawn to update the old contents for the
|
|
2965
|
+
* new frame.
|
|
2966
|
+
*
|
|
2967
|
+
* <note>If the system doesn't not support being able to track the age
|
|
2968
|
+
* of back buffers then this function will always return 0 which
|
|
2969
|
+
* implies that the contents are undefined.</note>
|
|
2970
|
+
*
|
|
2971
|
+
* <note>The %COGL_FEATURE_ID_BUFFER_AGE feature can optionally be
|
|
2972
|
+
* explicitly checked to determine if Cogl is currently tracking the
|
|
2973
|
+
* age of #CoglOnscreen back buffer contents. If this feature is
|
|
2974
|
+
* missing then this function will always return 0.</note>
|
|
2975
|
+
* @virtual
|
|
2976
|
+
* @returns The age of the buffer contents or 0 when the buffer contents are undefined.
|
|
2977
|
+
*/
|
|
2978
|
+
vfunc_get_buffer_age(): number
|
|
2979
|
+
/**
|
|
2980
|
+
* Implementation for https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_partial_update.txt
|
|
2981
|
+
* This immediately queues state to OpenGL that will be used for the
|
|
2982
|
+
* next swap.
|
|
2983
|
+
* This needs to be called every frame.
|
|
2984
|
+
* @virtual
|
|
2985
|
+
* @param rectangles An array of integer 4-tuples representing damaged rectangles as (x, y, width, height) tuples.
|
|
2986
|
+
* @param n_rectangles The number of 4-tuples to be read from `rectangles`
|
|
2987
|
+
*/
|
|
2988
|
+
vfunc_queue_damage_region(rectangles: number, n_rectangles: number): void
|
|
2989
|
+
/**
|
|
2990
|
+
* Swaps the current back buffer being rendered too, to the front for
|
|
2991
|
+
* display and provides information to any system compositor about
|
|
2992
|
+
* what regions of the buffer have changed (damage) with respect to
|
|
2993
|
+
* the last swapped buffer.
|
|
2994
|
+
*
|
|
2995
|
+
* This function has the same semantics as
|
|
2996
|
+
* cogl_framebuffer_swap_buffers() except that it additionally allows
|
|
2997
|
+
* applications to pass a list of damaged rectangles which may be
|
|
2998
|
+
* passed on to a compositor so that it can minimize how much of the
|
|
2999
|
+
* screen is redrawn in response to this applications newly swapped
|
|
3000
|
+
* front buffer.
|
|
3001
|
+
*
|
|
3002
|
+
* For example if your application is only animating a small object in
|
|
3003
|
+
* the corner of the screen and everything else is remaining static
|
|
3004
|
+
* then it can help the compositor to know that only the bottom right
|
|
3005
|
+
* corner of your newly swapped buffer has really changed with respect
|
|
3006
|
+
* to your previously swapped front buffer.
|
|
3007
|
+
*
|
|
3008
|
+
* If `n_rectangles` is 0 then the whole buffer will implicitly be
|
|
3009
|
+
* reported as damaged as if cogl_onscreen_swap_buffers() had been
|
|
3010
|
+
* called.
|
|
3011
|
+
*
|
|
3012
|
+
* This function also implicitly discards the contents of the color,
|
|
3013
|
+
* depth and stencil buffers as if cogl_framebuffer_discard_buffers()
|
|
3014
|
+
* were used. The significance of the discard is that you should not
|
|
3015
|
+
* expect to be able to start a new frame that incrementally builds on
|
|
3016
|
+
* the contents of the previous frame. If you want to perform
|
|
3017
|
+
* incremental updates to older back buffers then please refer to the
|
|
3018
|
+
* cogl_onscreen_get_buffer_age() api.
|
|
3019
|
+
*
|
|
3020
|
+
* Whenever possible it is recommended that applications use this
|
|
3021
|
+
* function instead of cogl_onscreen_swap_buffers() to improve
|
|
3022
|
+
* performance when running under a compositor.
|
|
3023
|
+
*
|
|
3024
|
+
* <note>It is highly recommended to use this API in conjunction with
|
|
3025
|
+
* the cogl_onscreen_get_buffer_age() api so that your application can
|
|
3026
|
+
* perform incremental rendering based on old back buffers.</note>
|
|
3027
|
+
* @virtual
|
|
3028
|
+
* @param rectangles An array of integer 4-tuples representing damaged rectangles as (x, y, width, height) tuples.
|
|
3029
|
+
* @param n_rectangles The number of 4-tuples to be read from `rectangles`
|
|
3030
|
+
* @param info
|
|
3031
|
+
*/
|
|
3032
|
+
vfunc_swap_buffers_with_damage(rectangles: number, n_rectangles: number, info: FrameInfo): void
|
|
3033
|
+
/**
|
|
3034
|
+
* Swaps a region of the back buffer being rendered too, to the front for
|
|
3035
|
+
* display. `rectangles` represents the region as array of `n_rectangles` each
|
|
3036
|
+
* defined by 4 sequential (x, y, width, height) integers.
|
|
3037
|
+
*
|
|
3038
|
+
* This function also implicitly discards the contents of the color, depth and
|
|
3039
|
+
* stencil buffers as if cogl_framebuffer_discard_buffers() were used. The
|
|
3040
|
+
* significance of the discard is that you should not expect to be able to
|
|
3041
|
+
* start a new frame that incrementally builds on the contents of the previous
|
|
3042
|
+
* frame.
|
|
3043
|
+
* @virtual
|
|
3044
|
+
* @param rectangles An array of integer 4-tuples representing rectangles as (x, y, width, height) tuples.
|
|
3045
|
+
* @param n_rectangles The number of 4-tuples to be read from `rectangles`
|
|
3046
|
+
* @param info
|
|
3047
|
+
*/
|
|
3048
|
+
vfunc_swap_region(rectangles: number, n_rectangles: number, info: FrameInfo): void
|
|
3049
|
+
|
|
3050
|
+
// Class property signals of Cogl-10.Cogl.Onscreen
|
|
3051
|
+
|
|
3052
|
+
connect(sigName: "notify::driver-config", callback: (($obj: Onscreen, pspec: GObject.ParamSpec) => void)): number
|
|
3053
|
+
connect_after(sigName: "notify::driver-config", callback: (($obj: Onscreen, pspec: GObject.ParamSpec) => void)): number
|
|
3054
|
+
emit(sigName: "notify::driver-config", ...args: any[]): void
|
|
3055
|
+
connect(sigName: "notify::height", callback: (($obj: Onscreen, pspec: GObject.ParamSpec) => void)): number
|
|
3056
|
+
connect_after(sigName: "notify::height", callback: (($obj: Onscreen, pspec: GObject.ParamSpec) => void)): number
|
|
3057
|
+
emit(sigName: "notify::height", ...args: any[]): void
|
|
3058
|
+
connect(sigName: "notify::width", callback: (($obj: Onscreen, pspec: GObject.ParamSpec) => void)): number
|
|
3059
|
+
connect_after(sigName: "notify::width", callback: (($obj: Onscreen, pspec: GObject.ParamSpec) => void)): number
|
|
3060
|
+
emit(sigName: "notify::width", ...args: any[]): void
|
|
3061
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
3062
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
3063
|
+
emit(sigName: string, ...args: any[]): void
|
|
3064
|
+
disconnect(id: number): void
|
|
3065
|
+
}
|
|
3066
|
+
|
|
3067
|
+
class Onscreen extends Framebuffer {
|
|
3068
|
+
|
|
3069
|
+
// Own properties of Cogl-10.Cogl.Onscreen
|
|
3070
|
+
|
|
3071
|
+
static name: string
|
|
3072
|
+
static $gtype: GObject.GType<Onscreen>
|
|
3073
|
+
|
|
3074
|
+
// Constructors of Cogl-10.Cogl.Onscreen
|
|
3075
|
+
|
|
3076
|
+
constructor(config?: Onscreen.ConstructorProperties)
|
|
3077
|
+
_init(config?: Onscreen.ConstructorProperties): void
|
|
3078
|
+
}
|
|
3079
|
+
|
|
3080
|
+
module Pipeline {
|
|
3081
|
+
|
|
3082
|
+
// Constructor properties interface
|
|
3083
|
+
|
|
3084
|
+
interface ConstructorProperties extends Object.ConstructorProperties {
|
|
3085
|
+
}
|
|
3086
|
+
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3089
|
+
interface Pipeline {
|
|
3090
|
+
|
|
3091
|
+
// Owm methods of Cogl-10.Cogl.Pipeline
|
|
3092
|
+
|
|
3093
|
+
/**
|
|
3094
|
+
* Creates a new pipeline with the configuration copied from the
|
|
3095
|
+
* source pipeline.
|
|
3096
|
+
*
|
|
3097
|
+
* We would strongly advise developers to always aim to use
|
|
3098
|
+
* cogl_pipeline_copy() instead of cogl_pipeline_new() whenever there will
|
|
3099
|
+
* be any similarity between two pipelines. Copying a pipeline helps Cogl
|
|
3100
|
+
* keep track of a pipelines ancestry which we may use to help minimize GPU
|
|
3101
|
+
* state changes.
|
|
3102
|
+
* @returns a pointer to the newly allocated #CoglPipeline
|
|
3103
|
+
*/
|
|
3104
|
+
copy(): Pipeline
|
|
3105
|
+
/**
|
|
3106
|
+
* Iterates all the layer indices of the given `pipeline`.
|
|
3107
|
+
* @param callback A #CoglPipelineLayerCallback to be called for each layer index
|
|
3108
|
+
*/
|
|
3109
|
+
foreach_layer(callback: PipelineLayerCallback): void
|
|
3110
|
+
get_alpha_test_function(): PipelineAlphaFunc
|
|
3111
|
+
get_alpha_test_reference(): number
|
|
3112
|
+
/**
|
|
3113
|
+
* Retrieves the current pipeline color.
|
|
3114
|
+
*/
|
|
3115
|
+
get_color(): /* color */ Color
|
|
3116
|
+
get_cull_face_mode(): PipelineCullFaceMode
|
|
3117
|
+
/**
|
|
3118
|
+
* The order of the vertices within a primitive specifies whether it
|
|
3119
|
+
* is considered to be front or back facing. This function specifies
|
|
3120
|
+
* which order is considered to be the front
|
|
3121
|
+
* faces. %COGL_WINDING_COUNTER_CLOCKWISE sets the front faces to
|
|
3122
|
+
* primitives with vertices in a counter-clockwise order and
|
|
3123
|
+
* %COGL_WINDING_CLOCKWISE sets them to be clockwise. The default is
|
|
3124
|
+
* %COGL_WINDING_COUNTER_CLOCKWISE.
|
|
3125
|
+
* @returns The @pipeline front face winding Status: Unstable
|
|
3126
|
+
*/
|
|
3127
|
+
get_front_face_winding(): Winding
|
|
3128
|
+
/**
|
|
3129
|
+
* Retrieves the currently set magnification #CoglPipelineFilter set on
|
|
3130
|
+
* the specified layer. The magnification filter determines how the
|
|
3131
|
+
* layer should be sampled when up-scaled.
|
|
3132
|
+
*
|
|
3133
|
+
* The default filter is %COGL_PIPELINE_FILTER_LINEAR but this can be
|
|
3134
|
+
* changed using cogl_pipeline_set_layer_filters().
|
|
3135
|
+
* @param layer_index the layer number to change.
|
|
3136
|
+
* @returns The magnification #CoglPipelineFilter for the specified layer.
|
|
3137
|
+
*/
|
|
3138
|
+
get_layer_mag_filter(layer_index: number): PipelineFilter
|
|
3139
|
+
/**
|
|
3140
|
+
* Retrieves the currently set minification #CoglPipelineFilter set on
|
|
3141
|
+
* the specified layer. The miniifcation filter determines how the
|
|
3142
|
+
* layer should be sampled when down-scaled.
|
|
3143
|
+
*
|
|
3144
|
+
* The default filter is %COGL_PIPELINE_FILTER_LINEAR but this can be
|
|
3145
|
+
* changed using cogl_pipeline_set_layer_filters().
|
|
3146
|
+
* @param layer_index the layer number to change.
|
|
3147
|
+
* @returns The minification #CoglPipelineFilter for the specified layer.
|
|
3148
|
+
*/
|
|
3149
|
+
get_layer_min_filter(layer_index: number): PipelineFilter
|
|
3150
|
+
/**
|
|
3151
|
+
* Gets whether point sprite coordinate generation is enabled for this
|
|
3152
|
+
* texture layer.
|
|
3153
|
+
* @param layer_index the layer number to check.
|
|
3154
|
+
* @returns whether the texture coordinates will be replaced with point sprite coordinates.
|
|
3155
|
+
*/
|
|
3156
|
+
get_layer_point_sprite_coords_enabled(layer_index: number): boolean
|
|
3157
|
+
get_layer_texture(layer_index: number): Texture
|
|
3158
|
+
/**
|
|
3159
|
+
* Returns the wrap mode for the 's' coordinate of texture lookups on this
|
|
3160
|
+
* layer.
|
|
3161
|
+
* @param layer_index the layer number to change.
|
|
3162
|
+
* @returns the wrap mode for the 's' coordinate of texture lookups on this layer.
|
|
3163
|
+
*/
|
|
3164
|
+
get_layer_wrap_mode_s(layer_index: number): PipelineWrapMode
|
|
3165
|
+
/**
|
|
3166
|
+
* Returns the wrap mode for the 't' coordinate of texture lookups on this
|
|
3167
|
+
* layer.
|
|
3168
|
+
* @param layer_index the layer number to change.
|
|
3169
|
+
* @returns the wrap mode for the 't' coordinate of texture lookups on this layer.
|
|
3170
|
+
*/
|
|
3171
|
+
get_layer_wrap_mode_t(layer_index: number): PipelineWrapMode
|
|
3172
|
+
/**
|
|
3173
|
+
* Retrieves the number of layers defined for the given `pipeline`
|
|
3174
|
+
* @returns the number of layers
|
|
3175
|
+
*/
|
|
3176
|
+
get_n_layers(): number
|
|
3177
|
+
get_per_vertex_point_size(): boolean
|
|
3178
|
+
/**
|
|
3179
|
+
* Get the size of points drawn when %COGL_VERTICES_MODE_POINTS is
|
|
3180
|
+
* used with the vertex buffer API.
|
|
3181
|
+
* @returns the point size of the @pipeline.
|
|
3182
|
+
*/
|
|
3183
|
+
get_point_size(): number
|
|
3184
|
+
/**
|
|
3185
|
+
* This is used to get an integer representing the uniform with the
|
|
3186
|
+
* name `uniform_name`. The integer can be passed to functions such as
|
|
3187
|
+
* cogl_pipeline_set_uniform_1f() to set the value of a uniform.
|
|
3188
|
+
*
|
|
3189
|
+
* This function will always return a valid integer. Ie, unlike
|
|
3190
|
+
* OpenGL, it does not return -1 if the uniform is not available in
|
|
3191
|
+
* this pipeline so it can not be used to test whether uniforms are
|
|
3192
|
+
* present. It is not necessary to set the program on the pipeline
|
|
3193
|
+
* before calling this function.
|
|
3194
|
+
* @param uniform_name The name of a uniform
|
|
3195
|
+
* @returns A integer representing the location of the given uniform.
|
|
3196
|
+
*/
|
|
3197
|
+
get_uniform_location(uniform_name: string | null): number
|
|
3198
|
+
/**
|
|
3199
|
+
* Queries what user program has been associated with the given
|
|
3200
|
+
* `pipeline` using cogl_pipeline_set_user_program().
|
|
3201
|
+
* @returns The current user program or %NULL.
|
|
3202
|
+
*/
|
|
3203
|
+
get_user_program(): Handle
|
|
3204
|
+
/**
|
|
3205
|
+
* This function removes a layer from your pipeline
|
|
3206
|
+
* @param layer_index Specifies the layer you want to remove
|
|
3207
|
+
*/
|
|
3208
|
+
remove_layer(layer_index: number): void
|
|
3209
|
+
/**
|
|
3210
|
+
* Before a primitive is blended with the framebuffer, it goes through an
|
|
3211
|
+
* alpha test stage which lets you discard fragments based on the current
|
|
3212
|
+
* alpha value. This function lets you change the function used to evaluate
|
|
3213
|
+
* the alpha channel, and thus determine which fragments are discarded
|
|
3214
|
+
* and which continue on to the blending stage.
|
|
3215
|
+
*
|
|
3216
|
+
* The default is %COGL_PIPELINE_ALPHA_FUNC_ALWAYS
|
|
3217
|
+
* @param alpha_func A `CoglPipelineAlphaFunc` constant
|
|
3218
|
+
* @param alpha_reference A reference point that the chosen alpha function uses to compare incoming fragments to.
|
|
3219
|
+
*/
|
|
3220
|
+
set_alpha_test_function(alpha_func: PipelineAlphaFunc, alpha_reference: number): void
|
|
3221
|
+
/**
|
|
3222
|
+
* If not already familiar; please refer <link linkend="cogl-Blend-Strings">here</link>
|
|
3223
|
+
* for an overview of what blend strings are, and their syntax.
|
|
3224
|
+
*
|
|
3225
|
+
* Blending occurs after the alpha test function, and combines fragments with
|
|
3226
|
+
* the framebuffer.
|
|
3227
|
+
*
|
|
3228
|
+
* Currently the only blend function Cogl exposes is ADD(). So any valid
|
|
3229
|
+
* blend statements will be of the form:
|
|
3230
|
+
*
|
|
3231
|
+
*
|
|
3232
|
+
* ```
|
|
3233
|
+
* <channel-mask>=ADD(SRC_COLOR*(<factor>), DST_COLOR*(<factor>))
|
|
3234
|
+
* ```
|
|
3235
|
+
*
|
|
3236
|
+
*
|
|
3237
|
+
* This is the list of source-names usable as blend factors:
|
|
3238
|
+
* <itemizedlist>
|
|
3239
|
+
* <listitem><para>SRC_COLOR: The color of the incoming fragment</para></listitem>
|
|
3240
|
+
* <listitem><para>DST_COLOR: The color of the framebuffer</para></listitem>
|
|
3241
|
+
* <listitem><para>CONSTANT: The constant set via cogl_pipeline_set_blend_constant()</para></listitem>
|
|
3242
|
+
* </itemizedlist>
|
|
3243
|
+
*
|
|
3244
|
+
* The source names can be used according to the
|
|
3245
|
+
* <link linkend="cogl-Blend-String-syntax">color-source and factor syntax</link>,
|
|
3246
|
+
* so for example "(1-SRC_COLOR[A])" would be a valid factor, as would
|
|
3247
|
+
* "(CONSTANT[RGB])"
|
|
3248
|
+
*
|
|
3249
|
+
* These can also be used as factors:
|
|
3250
|
+
* <itemizedlist>
|
|
3251
|
+
* <listitem>0: (0, 0, 0, 0)</listitem>
|
|
3252
|
+
* <listitem>1: (1, 1, 1, 1)</listitem>
|
|
3253
|
+
* <listitem>SRC_ALPHA_SATURATE_FACTOR: (f,f,f,1) where f = MIN(SRC_COLOR[A],1-DST_COLOR[A])</listitem>
|
|
3254
|
+
* </itemizedlist>
|
|
3255
|
+
*
|
|
3256
|
+
* <note>Remember; all color components are normalized to the range [0, 1]
|
|
3257
|
+
* before computing the result of blending.</note>
|
|
3258
|
+
*
|
|
3259
|
+
* <example id="cogl-Blend-Strings-blend-unpremul">
|
|
3260
|
+
* <title>Blend Strings/1</title>
|
|
3261
|
+
* <para>Blend a non-premultiplied source over a destination with
|
|
3262
|
+
* premultiplied alpha:</para>
|
|
3263
|
+
* <programlisting>
|
|
3264
|
+
* "RGB = ADD(SRC_COLOR*(SRC_COLOR[A]), DST_COLOR*(1-SRC_COLOR[A]))"
|
|
3265
|
+
* "A = ADD(SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))"
|
|
3266
|
+
* </programlisting>
|
|
3267
|
+
* </example>
|
|
3268
|
+
*
|
|
3269
|
+
* <example id="cogl-Blend-Strings-blend-premul">
|
|
3270
|
+
* <title>Blend Strings/2</title>
|
|
3271
|
+
* <para>Blend a premultiplied source over a destination with
|
|
3272
|
+
* premultiplied alpha</para>
|
|
3273
|
+
* <programlisting>
|
|
3274
|
+
* "RGBA = ADD(SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))"
|
|
3275
|
+
* </programlisting>
|
|
3276
|
+
* </example>
|
|
3277
|
+
*
|
|
3278
|
+
* The default blend string is:
|
|
3279
|
+
*
|
|
3280
|
+
* ```
|
|
3281
|
+
* RGBA = ADD (SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))
|
|
3282
|
+
* ```
|
|
3283
|
+
*
|
|
3284
|
+
*
|
|
3285
|
+
* That gives normal alpha-blending when the calculated color for the pipeline
|
|
3286
|
+
* is in premultiplied form.
|
|
3287
|
+
* @param blend_string A <link linkend="cogl-Blend-Strings">Cogl blend string</link> describing the desired blend function.
|
|
3288
|
+
* @returns %TRUE if the blend string was successfully parsed, and the described blending is supported by the underlying driver/hardware. If there was an error, %FALSE is returned and @error is set accordingly (if present).
|
|
3289
|
+
*/
|
|
3290
|
+
set_blend(blend_string: string | null): boolean
|
|
3291
|
+
/**
|
|
3292
|
+
* When blending is setup to reference a CONSTANT blend factor then
|
|
3293
|
+
* blending will depend on the constant set with this function.
|
|
3294
|
+
* @param constant_color The constant color you want
|
|
3295
|
+
*/
|
|
3296
|
+
set_blend_constant(constant_color: Color): void
|
|
3297
|
+
/**
|
|
3298
|
+
* Sets the basic color of the pipeline, used when no lighting is enabled.
|
|
3299
|
+
*
|
|
3300
|
+
* Note that if you don't add any layers to the pipeline then the color
|
|
3301
|
+
* will be blended unmodified with the destination; the default blend
|
|
3302
|
+
* expects premultiplied colors: for example, use (0.5, 0.0, 0.0, 0.5) for
|
|
3303
|
+
* semi-transparent red. See cogl_color_premultiply().
|
|
3304
|
+
*
|
|
3305
|
+
* The default value is (1.0, 1.0, 1.0, 1.0)
|
|
3306
|
+
* @param color The components of the color
|
|
3307
|
+
*/
|
|
3308
|
+
set_color(color: Color): void
|
|
3309
|
+
/**
|
|
3310
|
+
* Sets the basic color of the pipeline, used when no lighting is enabled.
|
|
3311
|
+
*
|
|
3312
|
+
* The default value is (1.0, 1.0, 1.0, 1.0)
|
|
3313
|
+
* @param red The red component
|
|
3314
|
+
* @param green The green component
|
|
3315
|
+
* @param blue The blue component
|
|
3316
|
+
* @param alpha The alpha component
|
|
3317
|
+
*/
|
|
3318
|
+
set_color4f(red: number, green: number, blue: number, alpha: number): void
|
|
3319
|
+
/**
|
|
3320
|
+
* Sets the basic color of the pipeline, used when no lighting is enabled.
|
|
3321
|
+
*
|
|
3322
|
+
* The default value is (0xff, 0xff, 0xff, 0xff)
|
|
3323
|
+
* @param red The red component
|
|
3324
|
+
* @param green The green component
|
|
3325
|
+
* @param blue The blue component
|
|
3326
|
+
* @param alpha The alpha component
|
|
3327
|
+
*/
|
|
3328
|
+
set_color4ub(red: number, green: number, blue: number, alpha: number): void
|
|
3329
|
+
/**
|
|
3330
|
+
* Sets which faces will be culled when drawing. Face culling can be
|
|
3331
|
+
* used to increase efficiency by avoiding drawing faces that would
|
|
3332
|
+
* get overridden. For example, if a model has gaps so that it is
|
|
3333
|
+
* impossible to see the inside then faces which are facing away from
|
|
3334
|
+
* the screen will never be seen so there is no point in drawing
|
|
3335
|
+
* them. This can be achieved by setting the cull face mode to
|
|
3336
|
+
* %COGL_PIPELINE_CULL_FACE_MODE_BACK.
|
|
3337
|
+
*
|
|
3338
|
+
* Face culling relies on the primitives being drawn with a specific
|
|
3339
|
+
* order to represent which faces are facing inside and outside the
|
|
3340
|
+
* model. This order can be specified by calling
|
|
3341
|
+
* cogl_pipeline_set_front_face_winding().
|
|
3342
|
+
*
|
|
3343
|
+
* Status: Unstable
|
|
3344
|
+
* @param cull_face_mode The new mode to set
|
|
3345
|
+
*/
|
|
3346
|
+
set_cull_face_mode(cull_face_mode: PipelineCullFaceMode): void
|
|
3347
|
+
/**
|
|
3348
|
+
* The order of the vertices within a primitive specifies whether it
|
|
3349
|
+
* is considered to be front or back facing. This function specifies
|
|
3350
|
+
* which order is considered to be the front
|
|
3351
|
+
* faces. %COGL_WINDING_COUNTER_CLOCKWISE sets the front faces to
|
|
3352
|
+
* primitives with vertices in a counter-clockwise order and
|
|
3353
|
+
* %COGL_WINDING_CLOCKWISE sets them to be clockwise. The default is
|
|
3354
|
+
* %COGL_WINDING_COUNTER_CLOCKWISE.
|
|
3355
|
+
*
|
|
3356
|
+
* Status: Unstable
|
|
3357
|
+
* @param front_winding the winding order
|
|
3358
|
+
*/
|
|
3359
|
+
set_front_face_winding(front_winding: Winding): void
|
|
3360
|
+
/**
|
|
3361
|
+
* If not already familiar; you can refer
|
|
3362
|
+
* <link linkend="cogl-Blend-Strings">here</link> for an overview of what blend
|
|
3363
|
+
* strings are and there syntax.
|
|
3364
|
+
*
|
|
3365
|
+
* These are all the functions available for texture combining:
|
|
3366
|
+
* <itemizedlist>
|
|
3367
|
+
* <listitem>REPLACE(arg0) = arg0</listitem>
|
|
3368
|
+
* <listitem>MODULATE(arg0, arg1) = arg0 x arg1</listitem>
|
|
3369
|
+
* <listitem>ADD(arg0, arg1) = arg0 + arg1</listitem>
|
|
3370
|
+
* <listitem>ADD_SIGNED(arg0, arg1) = arg0 + arg1 - 0.5</listitem>
|
|
3371
|
+
* <listitem>INTERPOLATE(arg0, arg1, arg2) = arg0 x arg2 + arg1 x (1 - arg2)</listitem>
|
|
3372
|
+
* <listitem>SUBTRACT(arg0, arg1) = arg0 - arg1</listitem>
|
|
3373
|
+
* <listitem>
|
|
3374
|
+
* <programlisting>
|
|
3375
|
+
* DOT3_RGB(arg0, arg1) = 4 x ((arg0[R] - 0.5)) * (arg1[R] - 0.5) +
|
|
3376
|
+
* (arg0[G] - 0.5)) * (arg1[G] - 0.5) +
|
|
3377
|
+
* (arg0[B] - 0.5)) * (arg1[B] - 0.5))
|
|
3378
|
+
* </programlisting>
|
|
3379
|
+
* </listitem>
|
|
3380
|
+
* <listitem>
|
|
3381
|
+
* <programlisting>
|
|
3382
|
+
* DOT3_RGBA(arg0, arg1) = 4 x ((arg0[R] - 0.5)) * (arg1[R] - 0.5) +
|
|
3383
|
+
* (arg0[G] - 0.5)) * (arg1[G] - 0.5) +
|
|
3384
|
+
* (arg0[B] - 0.5)) * (arg1[B] - 0.5))
|
|
3385
|
+
* </programlisting>
|
|
3386
|
+
* </listitem>
|
|
3387
|
+
* </itemizedlist>
|
|
3388
|
+
*
|
|
3389
|
+
* Refer to the
|
|
3390
|
+
* <link linkend="cogl-Blend-String-syntax">color-source syntax</link> for
|
|
3391
|
+
* describing the arguments. The valid source names for texture combining
|
|
3392
|
+
* are:
|
|
3393
|
+
* <variablelist>
|
|
3394
|
+
* <varlistentry>
|
|
3395
|
+
* <term>TEXTURE</term>
|
|
3396
|
+
* <listitem>Use the color from the current texture layer</listitem>
|
|
3397
|
+
* </varlistentry>
|
|
3398
|
+
* <varlistentry>
|
|
3399
|
+
* <term>TEXTURE_0, TEXTURE_1, etc</term>
|
|
3400
|
+
* <listitem>Use the color from the specified texture layer</listitem>
|
|
3401
|
+
* </varlistentry>
|
|
3402
|
+
* <varlistentry>
|
|
3403
|
+
* <term>CONSTANT</term>
|
|
3404
|
+
* <listitem>Use the color from the constant given with
|
|
3405
|
+
* cogl_pipeline_set_layer_combine_constant()</listitem>
|
|
3406
|
+
* </varlistentry>
|
|
3407
|
+
* <varlistentry>
|
|
3408
|
+
* <term>PRIMARY</term>
|
|
3409
|
+
* <listitem>Use the color of the pipeline as set with
|
|
3410
|
+
* cogl_pipeline_set_color()</listitem>
|
|
3411
|
+
* </varlistentry>
|
|
3412
|
+
* <varlistentry>
|
|
3413
|
+
* <term>PREVIOUS</term>
|
|
3414
|
+
* <listitem>Either use the texture color from the previous layer, or
|
|
3415
|
+
* if this is layer 0, use the color of the pipeline as set with
|
|
3416
|
+
* cogl_pipeline_set_color()</listitem>
|
|
3417
|
+
* </varlistentry>
|
|
3418
|
+
* </variablelist>
|
|
3419
|
+
*
|
|
3420
|
+
* <refsect2 id="cogl-Layer-Combine-Examples">
|
|
3421
|
+
* <title>Layer Combine Examples</title>
|
|
3422
|
+
* <para>This is effectively what the default blending is:</para>
|
|
3423
|
+
* <informalexample><programlisting>
|
|
3424
|
+
* RGBA = MODULATE (PREVIOUS, TEXTURE)
|
|
3425
|
+
* </programlisting></informalexample>
|
|
3426
|
+
* <para>This could be used to cross-fade between two images, using
|
|
3427
|
+
* the alpha component of a constant as the interpolator. The constant
|
|
3428
|
+
* color is given by calling
|
|
3429
|
+
* cogl_pipeline_set_layer_combine_constant().</para>
|
|
3430
|
+
* <informalexample><programlisting>
|
|
3431
|
+
* RGBA = INTERPOLATE (PREVIOUS, TEXTURE, CONSTANT[A])
|
|
3432
|
+
* </programlisting></informalexample>
|
|
3433
|
+
* </refsect2>
|
|
3434
|
+
*
|
|
3435
|
+
* <note>You can't give a multiplication factor for arguments as you can
|
|
3436
|
+
* with blending.</note>
|
|
3437
|
+
* @param layer_index Specifies the layer you want define a combine function for
|
|
3438
|
+
* @param blend_string A <link linkend="cogl-Blend-Strings">Cogl blend string</link> describing the desired texture combine function.
|
|
3439
|
+
* @returns %TRUE if the blend string was successfully parsed, and the described texture combining is supported by the underlying driver and or hardware. On failure, %FALSE is returned and @error is set
|
|
3440
|
+
*/
|
|
3441
|
+
set_layer_combine(layer_index: number, blend_string: string | null): boolean
|
|
3442
|
+
/**
|
|
3443
|
+
* When you are using the 'CONSTANT' color source in a layer combine
|
|
3444
|
+
* description then you can use this function to define its value.
|
|
3445
|
+
* @param layer_index Specifies the layer you want to specify a constant used for texture combining
|
|
3446
|
+
* @param constant The constant color you want
|
|
3447
|
+
*/
|
|
3448
|
+
set_layer_combine_constant(layer_index: number, constant: Color): void
|
|
3449
|
+
/**
|
|
3450
|
+
* Changes the decimation and interpolation filters used when a texture is
|
|
3451
|
+
* drawn at other scales than 100%.
|
|
3452
|
+
*
|
|
3453
|
+
* <note>It is an error to pass anything other than
|
|
3454
|
+
* %COGL_PIPELINE_FILTER_NEAREST or %COGL_PIPELINE_FILTER_LINEAR as
|
|
3455
|
+
* magnification filters since magnification doesn't ever need to
|
|
3456
|
+
* reference values stored in the mipmap chain.</note>
|
|
3457
|
+
* @param layer_index the layer number to change.
|
|
3458
|
+
* @param min_filter the filter used when scaling a texture down.
|
|
3459
|
+
* @param mag_filter the filter used when magnifying a texture.
|
|
3460
|
+
*/
|
|
3461
|
+
set_layer_filters(layer_index: number, min_filter: PipelineFilter, mag_filter: PipelineFilter): void
|
|
3462
|
+
/**
|
|
3463
|
+
* This function lets you set a matrix that can be used to e.g. translate
|
|
3464
|
+
* and rotate a single layer of a pipeline used to fill your geometry.
|
|
3465
|
+
* @param layer_index the index for the layer inside `pipeline`
|
|
3466
|
+
* @param matrix the transformation matrix for the layer
|
|
3467
|
+
*/
|
|
3468
|
+
set_layer_matrix(layer_index: number, matrix: Graphene.Matrix): void
|
|
3469
|
+
set_layer_max_mipmap_level(layer: number, max_level: number): void
|
|
3470
|
+
/**
|
|
3471
|
+
* Sets the texture for this layer to be the default texture for the
|
|
3472
|
+
* given type. The default texture is a 1x1 pixel white texture.
|
|
3473
|
+
*
|
|
3474
|
+
* This function is mostly useful if you want to create a base
|
|
3475
|
+
* pipeline that you want to create multiple copies from using
|
|
3476
|
+
* cogl_pipeline_copy(). In that case this function can be used to
|
|
3477
|
+
* specify the texture type so that any pipeline copies can share the
|
|
3478
|
+
* internal texture type state for efficiency.
|
|
3479
|
+
* @param layer_index The layer number to modify
|
|
3480
|
+
*/
|
|
3481
|
+
set_layer_null_texture(layer_index: number): void
|
|
3482
|
+
/**
|
|
3483
|
+
* When rendering points, if `enable` is %TRUE then the texture
|
|
3484
|
+
* coordinates for this layer will be replaced with coordinates that
|
|
3485
|
+
* vary from 0.0 to 1.0 across the primitive. The top left of the
|
|
3486
|
+
* point will have the coordinates 0.0,0.0 and the bottom right will
|
|
3487
|
+
* have 1.0,1.0. If `enable` is %FALSE then the coordinates will be
|
|
3488
|
+
* fixed for the entire point.
|
|
3489
|
+
* @param layer_index the layer number to change.
|
|
3490
|
+
* @param enable whether to enable point sprite coord generation.
|
|
3491
|
+
* @returns %TRUE if the function succeeds, %FALSE otherwise.
|
|
3492
|
+
*/
|
|
3493
|
+
set_layer_point_sprite_coords_enabled(layer_index: number, enable: boolean): boolean
|
|
3494
|
+
set_layer_texture(layer_index: number, texture: Texture): void
|
|
3495
|
+
/**
|
|
3496
|
+
* Sets the wrap mode for all three coordinates of texture lookups on
|
|
3497
|
+
* this layer. This is equivalent to calling
|
|
3498
|
+
* cogl_pipeline_set_layer_wrap_mode_s() and
|
|
3499
|
+
* cogl_pipeline_set_layer_wrap_mode_t() separately.
|
|
3500
|
+
* @param layer_index the layer number to change.
|
|
3501
|
+
* @param mode the new wrap mode
|
|
3502
|
+
*/
|
|
3503
|
+
set_layer_wrap_mode(layer_index: number, mode: PipelineWrapMode): void
|
|
3504
|
+
/**
|
|
3505
|
+
* Sets the wrap mode for the 's' coordinate of texture lookups on this layer.
|
|
3506
|
+
* @param layer_index the layer number to change.
|
|
3507
|
+
* @param mode the new wrap mode
|
|
3508
|
+
*/
|
|
3509
|
+
set_layer_wrap_mode_s(layer_index: number, mode: PipelineWrapMode): void
|
|
3510
|
+
/**
|
|
3511
|
+
* Sets the wrap mode for the 't' coordinate of texture lookups on this layer.
|
|
3512
|
+
* @param layer_index the layer number to change.
|
|
3513
|
+
* @param mode the new wrap mode
|
|
3514
|
+
*/
|
|
3515
|
+
set_layer_wrap_mode_t(layer_index: number, mode: PipelineWrapMode): void
|
|
3516
|
+
/**
|
|
3517
|
+
* Sets whether to use a per-vertex point size or to use the value set
|
|
3518
|
+
* by cogl_pipeline_set_point_size(). If per-vertex point size is
|
|
3519
|
+
* enabled then the point size can be set for an individual point
|
|
3520
|
+
* either by drawing with a #CoglAttribute with the name
|
|
3521
|
+
* ‘cogl_point_size_in’ or by writing to the GLSL builtin
|
|
3522
|
+
* ‘cogl_point_size_out’ from a vertex shader snippet.
|
|
3523
|
+
*
|
|
3524
|
+
* If per-vertex point size is enabled and this attribute is not used
|
|
3525
|
+
* and cogl_point_size_out is not written to then the results are
|
|
3526
|
+
* undefined.
|
|
3527
|
+
* @param enable whether to enable per-vertex point size
|
|
3528
|
+
* @returns %TRUE if the change succeeded or %FALSE otherwise
|
|
3529
|
+
*/
|
|
3530
|
+
set_per_vertex_point_size(enable: boolean): boolean
|
|
3531
|
+
/**
|
|
3532
|
+
* Changes the size of points drawn when %COGL_VERTICES_MODE_POINTS is
|
|
3533
|
+
* used with the attribute buffer API. Note that typically the GPU
|
|
3534
|
+
* will only support a limited minimum and maximum range of point
|
|
3535
|
+
* sizes. If the chosen point size is outside that range then the
|
|
3536
|
+
* nearest value within that range will be used instead. The size of a
|
|
3537
|
+
* point is in screen space so it will be the same regardless of any
|
|
3538
|
+
* transformations.
|
|
3539
|
+
*
|
|
3540
|
+
* If the point size is set to 0.0 then drawing points with the
|
|
3541
|
+
* pipeline will have undefined results. This is the default value so
|
|
3542
|
+
* if an application wants to draw points it must make sure to use a
|
|
3543
|
+
* pipeline that has an explicit point size set on it.
|
|
3544
|
+
* @param point_size the new point size.
|
|
3545
|
+
*/
|
|
3546
|
+
set_point_size(point_size: number): void
|
|
3547
|
+
/**
|
|
3548
|
+
* Sets a new value for the uniform at `uniform_location`. If this
|
|
3549
|
+
* pipeline has a user program attached and is later used as a source
|
|
3550
|
+
* for drawing, the given value will be assigned to the uniform which
|
|
3551
|
+
* can be accessed from the shader's source. The value for
|
|
3552
|
+
* `uniform_location` should be retrieved from the string name of the
|
|
3553
|
+
* uniform by calling cogl_pipeline_get_uniform_location().
|
|
3554
|
+
*
|
|
3555
|
+
* This function should be used to set uniforms that are of type
|
|
3556
|
+
* float. It can also be used to set a single member of a float array
|
|
3557
|
+
* uniform.
|
|
3558
|
+
* @param uniform_location The uniform's location identifier
|
|
3559
|
+
* @param value The new value for the uniform
|
|
3560
|
+
*/
|
|
3561
|
+
set_uniform_1f(uniform_location: number, value: number): void
|
|
3562
|
+
/**
|
|
3563
|
+
* Sets a new value for the uniform at `uniform_location`. If this
|
|
3564
|
+
* pipeline has a user program attached and is later used as a source
|
|
3565
|
+
* for drawing, the given value will be assigned to the uniform which
|
|
3566
|
+
* can be accessed from the shader's source. The value for
|
|
3567
|
+
* `uniform_location` should be retrieved from the string name of the
|
|
3568
|
+
* uniform by calling cogl_pipeline_get_uniform_location().
|
|
3569
|
+
*
|
|
3570
|
+
* This function should be used to set uniforms that are of type
|
|
3571
|
+
* int. It can also be used to set a single member of a int array
|
|
3572
|
+
* uniform or a sampler uniform.
|
|
3573
|
+
* @param uniform_location The uniform's location identifier
|
|
3574
|
+
* @param value The new value for the uniform
|
|
3575
|
+
*/
|
|
3576
|
+
set_uniform_1i(uniform_location: number, value: number): void
|
|
3577
|
+
/**
|
|
3578
|
+
* Sets new values for the uniform at `uniform_location`. If this
|
|
3579
|
+
* pipeline has a user program attached and is later used as a source
|
|
3580
|
+
* for drawing, the given values will be assigned to the uniform which
|
|
3581
|
+
* can be accessed from the shader's source. The value for
|
|
3582
|
+
* `uniform_location` should be retrieved from the string name of the
|
|
3583
|
+
* uniform by calling cogl_pipeline_get_uniform_location().
|
|
3584
|
+
*
|
|
3585
|
+
* This function can be used to set any floating point type uniform,
|
|
3586
|
+
* including float arrays and float vectors. For example, to set a
|
|
3587
|
+
* single vec4 uniform you would use 4 for `n_components` and 1 for
|
|
3588
|
+
* `count`. To set an array of 8 float values, you could use 1 for
|
|
3589
|
+
* `n_components` and 8 for `count`.
|
|
3590
|
+
* @param uniform_location The uniform's location identifier
|
|
3591
|
+
* @param n_components The number of components in the corresponding uniform's type
|
|
3592
|
+
* @param count The number of values to set
|
|
3593
|
+
* @param value Pointer to the new values to set
|
|
3594
|
+
*/
|
|
3595
|
+
set_uniform_float(uniform_location: number, n_components: number, count: number, value: number): void
|
|
3596
|
+
/**
|
|
3597
|
+
* Sets new values for the uniform at `uniform_location`. If this
|
|
3598
|
+
* pipeline has a user program attached and is later used as a source
|
|
3599
|
+
* for drawing, the given values will be assigned to the uniform which
|
|
3600
|
+
* can be accessed from the shader's source. The value for
|
|
3601
|
+
* `uniform_location` should be retrieved from the string name of the
|
|
3602
|
+
* uniform by calling cogl_pipeline_get_uniform_location().
|
|
3603
|
+
*
|
|
3604
|
+
* This function can be used to set any integer type uniform,
|
|
3605
|
+
* including int arrays and int vectors. For example, to set a single
|
|
3606
|
+
* ivec4 uniform you would use 4 for `n_components` and 1 for
|
|
3607
|
+
* `count`. To set an array of 8 int values, you could use 1 for
|
|
3608
|
+
* `n_components` and 8 for `count`.
|
|
3609
|
+
* @param uniform_location The uniform's location identifier
|
|
3610
|
+
* @param n_components The number of components in the corresponding uniform's type
|
|
3611
|
+
* @param count The number of values to set
|
|
3612
|
+
* @param value Pointer to the new values to set
|
|
3613
|
+
*/
|
|
3614
|
+
set_uniform_int(uniform_location: number, n_components: number, count: number, value: number): void
|
|
3615
|
+
/**
|
|
3616
|
+
* Sets new values for the uniform at `uniform_location`. If this
|
|
3617
|
+
* pipeline has a user program attached and is later used as a source
|
|
3618
|
+
* for drawing, the given values will be assigned to the uniform which
|
|
3619
|
+
* can be accessed from the shader's source. The value for
|
|
3620
|
+
* `uniform_location` should be retrieved from the string name of the
|
|
3621
|
+
* uniform by calling cogl_pipeline_get_uniform_location().
|
|
3622
|
+
*
|
|
3623
|
+
* This function can be used to set any matrix type uniform, including
|
|
3624
|
+
* matrix arrays. For example, to set a single mat4 uniform you would
|
|
3625
|
+
* use 4 for `dimensions` and 1 for `count`. To set an array of 8
|
|
3626
|
+
* mat3 values, you could use 3 for `dimensions` and 8 for `count`.
|
|
3627
|
+
*
|
|
3628
|
+
* If `transpose` is %FALSE then the matrix is expected to be in
|
|
3629
|
+
* column-major order or if it is %TRUE then the matrix is in
|
|
3630
|
+
* row-major order. You can pass a #graphene_matrix_t by calling by passing
|
|
3631
|
+
* the result of graphene_matrix_to_float() in `value` and setting
|
|
3632
|
+
* `transpose` to %FALSE.
|
|
3633
|
+
* @param uniform_location The uniform's location identifier
|
|
3634
|
+
* @param dimensions The size of the matrix
|
|
3635
|
+
* @param count The number of values to set
|
|
3636
|
+
* @param transpose Whether to transpose the matrix
|
|
3637
|
+
* @param value Pointer to the new values to set
|
|
3638
|
+
*/
|
|
3639
|
+
set_uniform_matrix(uniform_location: number, dimensions: number, count: number, transpose: boolean, value: number): void
|
|
3640
|
+
/**
|
|
3641
|
+
* Associates a linked CoglProgram with the given pipeline so that the
|
|
3642
|
+
* program can take full control of vertex and/or fragment processing.
|
|
3643
|
+
*
|
|
3644
|
+
* This is an example of how it can be used to associate an ARBfp
|
|
3645
|
+
* program with a #CoglPipeline:
|
|
3646
|
+
*
|
|
3647
|
+
* ```
|
|
3648
|
+
* CoglHandle shader;
|
|
3649
|
+
* CoglHandle program;
|
|
3650
|
+
* CoglPipeline *pipeline;
|
|
3651
|
+
*
|
|
3652
|
+
* shader = cogl_create_shader (COGL_SHADER_TYPE_FRAGMENT);
|
|
3653
|
+
* cogl_shader_source (shader,
|
|
3654
|
+
* "!!ARBfp1.0\n"
|
|
3655
|
+
* "MOV result.color,fragment.color;\n"
|
|
3656
|
+
* "END\n");
|
|
3657
|
+
*
|
|
3658
|
+
* program = cogl_create_program ();
|
|
3659
|
+
* cogl_program_attach_shader (program, shader);
|
|
3660
|
+
* cogl_program_link (program);
|
|
3661
|
+
*
|
|
3662
|
+
* pipeline = cogl_pipeline_new ();
|
|
3663
|
+
* cogl_pipeline_set_user_program (pipeline, program);
|
|
3664
|
+
*
|
|
3665
|
+
* cogl_set_source_color4ub (0xff, 0x00, 0x00, 0xff);
|
|
3666
|
+
* cogl_rectangle (0, 0, 100, 100);
|
|
3667
|
+
* ```
|
|
3668
|
+
*
|
|
3669
|
+
*
|
|
3670
|
+
* It is possibly worth keeping in mind that this API is not part of
|
|
3671
|
+
* the long term design for how we want to expose shaders to Cogl
|
|
3672
|
+
* developers (We are planning on deprecating the cogl_program and
|
|
3673
|
+
* cogl_shader APIs in favour of a "snippet" framework) but in the
|
|
3674
|
+
* meantime we hope this will handle most practical GLSL and ARBfp
|
|
3675
|
+
* requirements.
|
|
3676
|
+
* @param program A #CoglHandle to a linked CoglProgram
|
|
3677
|
+
*/
|
|
3678
|
+
set_user_program(program: Handle): void
|
|
3679
|
+
|
|
3680
|
+
// Class property signals of Cogl-10.Cogl.Pipeline
|
|
3681
|
+
|
|
3682
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
3683
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
3684
|
+
emit(sigName: string, ...args: any[]): void
|
|
3685
|
+
disconnect(id: number): void
|
|
3686
|
+
}
|
|
3687
|
+
|
|
3688
|
+
class Pipeline extends Object {
|
|
3689
|
+
|
|
3690
|
+
// Own properties of Cogl-10.Cogl.Pipeline
|
|
3691
|
+
|
|
3692
|
+
static name: string
|
|
3693
|
+
static $gtype: GObject.GType<Pipeline>
|
|
3694
|
+
|
|
3695
|
+
// Constructors of Cogl-10.Cogl.Pipeline
|
|
3696
|
+
|
|
3697
|
+
constructor(config?: Pipeline.ConstructorProperties)
|
|
3698
|
+
/**
|
|
3699
|
+
* Allocates and initializes a default simple pipeline that will color
|
|
3700
|
+
* a primitive white.
|
|
3701
|
+
* @constructor
|
|
3702
|
+
* @param context a #CoglContext
|
|
3703
|
+
* @returns a pointer to a new #CoglPipeline
|
|
3704
|
+
*/
|
|
3705
|
+
constructor(context: Context)
|
|
3706
|
+
/**
|
|
3707
|
+
* Allocates and initializes a default simple pipeline that will color
|
|
3708
|
+
* a primitive white.
|
|
3709
|
+
* @constructor
|
|
3710
|
+
* @param context a #CoglContext
|
|
3711
|
+
* @returns a pointer to a new #CoglPipeline
|
|
3712
|
+
*/
|
|
3713
|
+
static new(context: Context): Pipeline
|
|
3714
|
+
_init(config?: Pipeline.ConstructorProperties): void
|
|
3715
|
+
}
|
|
3716
|
+
|
|
3717
|
+
module Texture2D {
|
|
3718
|
+
|
|
3719
|
+
// Constructor properties interface
|
|
3720
|
+
|
|
3721
|
+
interface ConstructorProperties extends Texture.ConstructorProperties, Object.ConstructorProperties {
|
|
3722
|
+
}
|
|
3723
|
+
|
|
3724
|
+
}
|
|
3725
|
+
|
|
3726
|
+
interface Texture2D extends Texture {
|
|
3727
|
+
|
|
3728
|
+
// Owm methods of Cogl-10.Cogl.Texture2D
|
|
3729
|
+
|
|
3730
|
+
egl_image_external_alloc_finish(user_data: any | null, destroy: GLib.DestroyNotify): void
|
|
3731
|
+
egl_image_external_bind(): void
|
|
3732
|
+
|
|
3733
|
+
// Conflicting methods
|
|
3734
|
+
|
|
3735
|
+
/**
|
|
3736
|
+
* Copies the pixel data from a cogl texture to system memory.
|
|
3737
|
+
*
|
|
3738
|
+
* <note>Don't pass the value of cogl_texture_get_rowstride() as the
|
|
3739
|
+
* `rowstride` argument, the rowstride should be the rowstride you
|
|
3740
|
+
* want for the destination `data` buffer not the rowstride of the
|
|
3741
|
+
* source texture</note>
|
|
3742
|
+
* @param format the #CoglPixelFormat to store the texture as.
|
|
3743
|
+
* @param rowstride the rowstride of `data` in bytes or pass 0 to calculate from the bytes-per-pixel of `format` multiplied by the `texture` width.
|
|
3744
|
+
* @param data memory location to write the `texture'`s contents, or %NULL to only query the data size through the return value.
|
|
3745
|
+
* @returns the size of the texture data in bytes
|
|
3746
|
+
*/
|
|
3747
|
+
get_data(format: PixelFormat, rowstride: number, data: Uint8Array | null): number
|
|
3748
|
+
|
|
3749
|
+
// Overloads of get_data
|
|
3750
|
+
|
|
3751
|
+
/**
|
|
3752
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
3753
|
+
* @param key name of the key for that association
|
|
3754
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
3755
|
+
*/
|
|
3756
|
+
get_data(key: string | null): any | null
|
|
3757
|
+
/**
|
|
3758
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
3759
|
+
* @param key name of the key for that association
|
|
3760
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
3761
|
+
*/
|
|
3762
|
+
get_data(key: string | null): any | null
|
|
3763
|
+
/**
|
|
3764
|
+
* `texture` a #CoglTexture.
|
|
3765
|
+
* Sets all the pixels for a given mipmap `level` by copying the pixel
|
|
3766
|
+
* data pointed to by the `data` argument into the given `texture`.
|
|
3767
|
+
*
|
|
3768
|
+
* `data` should point to the first pixel to copy corresponding
|
|
3769
|
+
* to the top left of the mipmap `level` being set.
|
|
3770
|
+
*
|
|
3771
|
+
* If `rowstride` equals 0 then it will be automatically calculated
|
|
3772
|
+
* from the width of the mipmap level and the bytes-per-pixel for the
|
|
3773
|
+
* given `format`.
|
|
3774
|
+
*
|
|
3775
|
+
* A mipmap `level` of 0 corresponds to the largest, base image of a
|
|
3776
|
+
* texture and `level` 1 is half the width and height of level 0. If
|
|
3777
|
+
* dividing any dimension of the previous level by two results in a
|
|
3778
|
+
* fraction then round the number down (floor()), but clamp to 1
|
|
3779
|
+
* something like this:
|
|
3780
|
+
*
|
|
3781
|
+
*
|
|
3782
|
+
* ```
|
|
3783
|
+
* next_width = MAX (1, floor (prev_width));
|
|
3784
|
+
* ```
|
|
3785
|
+
*
|
|
3786
|
+
*
|
|
3787
|
+
* You can determine the number of mipmap levels for a given texture
|
|
3788
|
+
* like this:
|
|
3789
|
+
*
|
|
3790
|
+
*
|
|
3791
|
+
* ```
|
|
3792
|
+
* n_levels = 1 + floor (log2 (max_dimension));
|
|
3793
|
+
* ```
|
|
3794
|
+
*
|
|
3795
|
+
*
|
|
3796
|
+
* Where %max_dimension is the larger of cogl_texture_get_width() and
|
|
3797
|
+
* cogl_texture_get_height().
|
|
3798
|
+
*
|
|
3799
|
+
* It is an error to pass a `level` number >= the number of levels that
|
|
3800
|
+
* `texture` can have according to the above calculation.
|
|
3801
|
+
*
|
|
3802
|
+
* <note>Since the storage for a #CoglTexture is allocated lazily then
|
|
3803
|
+
* if the given `texture` has not previously been allocated then this
|
|
3804
|
+
* api can return %FALSE and throw an exceptional `error` if there is
|
|
3805
|
+
* not enough memory to allocate storage for `texture`.</note>
|
|
3806
|
+
* @param format the #CoglPixelFormat used in the source `data` buffer.
|
|
3807
|
+
* @param rowstride rowstride of the source `data` buffer (computed from the texture width and `format` if it equals 0)
|
|
3808
|
+
* @param data the source data, pointing to the first top-left pixel to set
|
|
3809
|
+
* @param level The mipmap level to update (Normally 0 for the largest, base texture)
|
|
3810
|
+
* @returns %TRUE if the data upload was successful, and %FALSE otherwise
|
|
3811
|
+
*/
|
|
3812
|
+
set_data(format: PixelFormat, rowstride: number, data: Uint8Array, level: number): boolean
|
|
3813
|
+
|
|
3814
|
+
// Overloads of set_data
|
|
3815
|
+
|
|
3816
|
+
/**
|
|
3817
|
+
* Each object carries around a table of associations from
|
|
3818
|
+
* strings to pointers. This function lets you set an association.
|
|
3819
|
+
*
|
|
3820
|
+
* If the object already had an association with that name,
|
|
3821
|
+
* the old association will be destroyed.
|
|
3822
|
+
*
|
|
3823
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
3824
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
3825
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
3826
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
3827
|
+
* @param key name of the key
|
|
3828
|
+
* @param data data to associate with that key
|
|
3829
|
+
*/
|
|
3830
|
+
set_data(key: string | null, data: any | null): void
|
|
3831
|
+
/**
|
|
3832
|
+
* Each object carries around a table of associations from
|
|
3833
|
+
* strings to pointers. This function lets you set an association.
|
|
3834
|
+
*
|
|
3835
|
+
* If the object already had an association with that name,
|
|
3836
|
+
* the old association will be destroyed.
|
|
3837
|
+
*
|
|
3838
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
3839
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
3840
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
3841
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
3842
|
+
* @param key name of the key
|
|
3843
|
+
* @param data data to associate with that key
|
|
3844
|
+
*/
|
|
3845
|
+
set_data(key: string | null, data: any | null): void
|
|
3846
|
+
|
|
3847
|
+
// Class property signals of Cogl-10.Cogl.Texture2D
|
|
3848
|
+
|
|
3849
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
3850
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
3851
|
+
emit(sigName: string, ...args: any[]): void
|
|
3852
|
+
disconnect(id: number): void
|
|
3853
|
+
}
|
|
3854
|
+
|
|
3855
|
+
class Texture2D extends Object {
|
|
3856
|
+
|
|
3857
|
+
// Own properties of Cogl-10.Cogl.Texture2D
|
|
3858
|
+
|
|
3859
|
+
static name: string
|
|
3860
|
+
static $gtype: GObject.GType<Texture2D>
|
|
3861
|
+
|
|
3862
|
+
// Constructors of Cogl-10.Cogl.Texture2D
|
|
3863
|
+
|
|
3864
|
+
constructor(config?: Texture2D.ConstructorProperties)
|
|
3865
|
+
/**
|
|
3866
|
+
* Creates a low-level #CoglTexture2D texture based on data residing
|
|
3867
|
+
* in a #CoglBitmap.
|
|
3868
|
+
*
|
|
3869
|
+
* The storage for the texture is not allocated before this function
|
|
3870
|
+
* returns. You can call cogl_texture_allocate() to explicitly
|
|
3871
|
+
* allocate the underlying storage or preferably let Cogl
|
|
3872
|
+
* automatically allocate storage lazily when it may know more about
|
|
3873
|
+
* how the texture is being used and can optimize how it is allocated.
|
|
3874
|
+
*
|
|
3875
|
+
* The texture is still configurable until it has been allocated so
|
|
3876
|
+
* for example you can influence the internal format of the texture
|
|
3877
|
+
* using cogl_texture_set_components() and
|
|
3878
|
+
* cogl_texture_set_premultiplied().
|
|
3879
|
+
* @constructor
|
|
3880
|
+
* @param bitmap A #CoglBitmap
|
|
3881
|
+
* @returns A newly allocated #CoglTexture2D
|
|
3882
|
+
*/
|
|
3883
|
+
static new_from_bitmap(bitmap: Bitmap): Texture2D
|
|
3884
|
+
|
|
3885
|
+
// Overloads of new_from_bitmap
|
|
3886
|
+
|
|
3887
|
+
/**
|
|
3888
|
+
* Creates a #CoglTexture from a #CoglBitmap.
|
|
3889
|
+
* @param bitmap A #CoglBitmap pointer
|
|
3890
|
+
* @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
|
|
3891
|
+
* @param internal_format the #CoglPixelFormat to use for the GPU storage of the texture
|
|
3892
|
+
* @returns A newly created #CoglTexture or %NULL on failure
|
|
3893
|
+
*/
|
|
3894
|
+
static new_from_bitmap(bitmap: Bitmap, flags: TextureFlags, internal_format: PixelFormat): Texture
|
|
3895
|
+
_init(config?: Texture2D.ConstructorProperties): void
|
|
3896
|
+
}
|
|
3897
|
+
|
|
3898
|
+
module Texture2DSliced {
|
|
3899
|
+
|
|
3900
|
+
// Constructor properties interface
|
|
3901
|
+
|
|
3902
|
+
interface ConstructorProperties extends Texture.ConstructorProperties, Object.ConstructorProperties {
|
|
3903
|
+
}
|
|
3904
|
+
|
|
3905
|
+
}
|
|
3906
|
+
|
|
3907
|
+
interface Texture2DSliced extends Texture {
|
|
3908
|
+
|
|
3909
|
+
// Conflicting methods
|
|
3910
|
+
|
|
3911
|
+
/**
|
|
3912
|
+
* Copies the pixel data from a cogl texture to system memory.
|
|
3913
|
+
*
|
|
3914
|
+
* <note>Don't pass the value of cogl_texture_get_rowstride() as the
|
|
3915
|
+
* `rowstride` argument, the rowstride should be the rowstride you
|
|
3916
|
+
* want for the destination `data` buffer not the rowstride of the
|
|
3917
|
+
* source texture</note>
|
|
3918
|
+
* @param format the #CoglPixelFormat to store the texture as.
|
|
3919
|
+
* @param rowstride the rowstride of `data` in bytes or pass 0 to calculate from the bytes-per-pixel of `format` multiplied by the `texture` width.
|
|
3920
|
+
* @param data memory location to write the `texture'`s contents, or %NULL to only query the data size through the return value.
|
|
3921
|
+
* @returns the size of the texture data in bytes
|
|
3922
|
+
*/
|
|
3923
|
+
get_data(format: PixelFormat, rowstride: number, data: Uint8Array | null): number
|
|
3924
|
+
|
|
3925
|
+
// Overloads of get_data
|
|
3926
|
+
|
|
3927
|
+
/**
|
|
3928
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
3929
|
+
* @param key name of the key for that association
|
|
3930
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
3931
|
+
*/
|
|
3932
|
+
get_data(key: string | null): any | null
|
|
3933
|
+
/**
|
|
3934
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
3935
|
+
* @param key name of the key for that association
|
|
3936
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
3937
|
+
*/
|
|
3938
|
+
get_data(key: string | null): any | null
|
|
3939
|
+
/**
|
|
3940
|
+
* `texture` a #CoglTexture.
|
|
3941
|
+
* Sets all the pixels for a given mipmap `level` by copying the pixel
|
|
3942
|
+
* data pointed to by the `data` argument into the given `texture`.
|
|
3943
|
+
*
|
|
3944
|
+
* `data` should point to the first pixel to copy corresponding
|
|
3945
|
+
* to the top left of the mipmap `level` being set.
|
|
3946
|
+
*
|
|
3947
|
+
* If `rowstride` equals 0 then it will be automatically calculated
|
|
3948
|
+
* from the width of the mipmap level and the bytes-per-pixel for the
|
|
3949
|
+
* given `format`.
|
|
3950
|
+
*
|
|
3951
|
+
* A mipmap `level` of 0 corresponds to the largest, base image of a
|
|
3952
|
+
* texture and `level` 1 is half the width and height of level 0. If
|
|
3953
|
+
* dividing any dimension of the previous level by two results in a
|
|
3954
|
+
* fraction then round the number down (floor()), but clamp to 1
|
|
3955
|
+
* something like this:
|
|
3956
|
+
*
|
|
3957
|
+
*
|
|
3958
|
+
* ```
|
|
3959
|
+
* next_width = MAX (1, floor (prev_width));
|
|
3960
|
+
* ```
|
|
3961
|
+
*
|
|
3962
|
+
*
|
|
3963
|
+
* You can determine the number of mipmap levels for a given texture
|
|
3964
|
+
* like this:
|
|
3965
|
+
*
|
|
3966
|
+
*
|
|
3967
|
+
* ```
|
|
3968
|
+
* n_levels = 1 + floor (log2 (max_dimension));
|
|
3969
|
+
* ```
|
|
3970
|
+
*
|
|
3971
|
+
*
|
|
3972
|
+
* Where %max_dimension is the larger of cogl_texture_get_width() and
|
|
3973
|
+
* cogl_texture_get_height().
|
|
3974
|
+
*
|
|
3975
|
+
* It is an error to pass a `level` number >= the number of levels that
|
|
3976
|
+
* `texture` can have according to the above calculation.
|
|
3977
|
+
*
|
|
3978
|
+
* <note>Since the storage for a #CoglTexture is allocated lazily then
|
|
3979
|
+
* if the given `texture` has not previously been allocated then this
|
|
3980
|
+
* api can return %FALSE and throw an exceptional `error` if there is
|
|
3981
|
+
* not enough memory to allocate storage for `texture`.</note>
|
|
3982
|
+
* @param format the #CoglPixelFormat used in the source `data` buffer.
|
|
3983
|
+
* @param rowstride rowstride of the source `data` buffer (computed from the texture width and `format` if it equals 0)
|
|
3984
|
+
* @param data the source data, pointing to the first top-left pixel to set
|
|
3985
|
+
* @param level The mipmap level to update (Normally 0 for the largest, base texture)
|
|
3986
|
+
* @returns %TRUE if the data upload was successful, and %FALSE otherwise
|
|
3987
|
+
*/
|
|
3988
|
+
set_data(format: PixelFormat, rowstride: number, data: Uint8Array, level: number): boolean
|
|
3989
|
+
|
|
3990
|
+
// Overloads of set_data
|
|
3991
|
+
|
|
3992
|
+
/**
|
|
3993
|
+
* Each object carries around a table of associations from
|
|
3994
|
+
* strings to pointers. This function lets you set an association.
|
|
3995
|
+
*
|
|
3996
|
+
* If the object already had an association with that name,
|
|
3997
|
+
* the old association will be destroyed.
|
|
3998
|
+
*
|
|
3999
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
4000
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
4001
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
4002
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
4003
|
+
* @param key name of the key
|
|
4004
|
+
* @param data data to associate with that key
|
|
4005
|
+
*/
|
|
4006
|
+
set_data(key: string | null, data: any | null): void
|
|
4007
|
+
/**
|
|
4008
|
+
* Each object carries around a table of associations from
|
|
4009
|
+
* strings to pointers. This function lets you set an association.
|
|
4010
|
+
*
|
|
4011
|
+
* If the object already had an association with that name,
|
|
4012
|
+
* the old association will be destroyed.
|
|
4013
|
+
*
|
|
4014
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
4015
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
4016
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
4017
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
4018
|
+
* @param key name of the key
|
|
4019
|
+
* @param data data to associate with that key
|
|
4020
|
+
*/
|
|
4021
|
+
set_data(key: string | null, data: any | null): void
|
|
4022
|
+
|
|
4023
|
+
// Class property signals of Cogl-10.Cogl.Texture2DSliced
|
|
4024
|
+
|
|
4025
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
4026
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
4027
|
+
emit(sigName: string, ...args: any[]): void
|
|
4028
|
+
disconnect(id: number): void
|
|
4029
|
+
}
|
|
4030
|
+
|
|
4031
|
+
class Texture2DSliced extends Object {
|
|
4032
|
+
|
|
4033
|
+
// Own properties of Cogl-10.Cogl.Texture2DSliced
|
|
4034
|
+
|
|
4035
|
+
static name: string
|
|
4036
|
+
static $gtype: GObject.GType<Texture2DSliced>
|
|
4037
|
+
|
|
4038
|
+
// Constructors of Cogl-10.Cogl.Texture2DSliced
|
|
4039
|
+
|
|
4040
|
+
constructor(config?: Texture2DSliced.ConstructorProperties)
|
|
4041
|
+
/**
|
|
4042
|
+
* Creates a new #CoglTexture2DSliced texture based on data residing
|
|
4043
|
+
* in a bitmap.
|
|
4044
|
+
*
|
|
4045
|
+
* A #CoglTexture2DSliced may internally be comprised of 1 or more
|
|
4046
|
+
* #CoglTexture2D textures depending on GPU limitations. For example
|
|
4047
|
+
* if the GPU only supports power-of-two sized textures then a sliced
|
|
4048
|
+
* texture will turn a non-power-of-two size into a combination of
|
|
4049
|
+
* smaller power-of-two sized textures. If the requested texture size
|
|
4050
|
+
* is larger than is supported by the hardware then the texture will
|
|
4051
|
+
* be sliced into smaller textures that can be accessed by the
|
|
4052
|
+
* hardware.
|
|
4053
|
+
*
|
|
4054
|
+
* `max_waste` is used as a threshold for recursively slicing the
|
|
4055
|
+
* right-most or bottom-most slices into smaller sizes until the
|
|
4056
|
+
* wasted padding at the bottom and right of the textures is less than
|
|
4057
|
+
* specified. A negative `max_waste` will disable slicing.
|
|
4058
|
+
*
|
|
4059
|
+
* The storage for the texture is not allocated before this function
|
|
4060
|
+
* returns. You can call cogl_texture_allocate() to explicitly
|
|
4061
|
+
* allocate the underlying storage or let Cogl automatically allocate
|
|
4062
|
+
* storage lazily.
|
|
4063
|
+
*
|
|
4064
|
+
* <note>It's possible for the allocation of a sliced texture to fail
|
|
4065
|
+
* later due to impossible slicing constraints if a negative
|
|
4066
|
+
* `max_waste` value is given. If the given virtual texture size is
|
|
4067
|
+
* larger than is supported by the hardware but slicing is disabled
|
|
4068
|
+
* the texture size would be too large to handle.</note>
|
|
4069
|
+
* @constructor
|
|
4070
|
+
* @param bmp A #CoglBitmap
|
|
4071
|
+
* @param max_waste The threshold of how wide a strip of wasted texels are allowed along the right and bottom textures before they must be sliced to reduce the amount of waste. A negative can be passed to disable slicing.
|
|
4072
|
+
* @returns A newly created #CoglTexture2DSliced or %NULL on failure and @error will be updated.
|
|
4073
|
+
*/
|
|
4074
|
+
static new_from_bitmap(bmp: Bitmap, max_waste: number): Texture2DSliced
|
|
4075
|
+
|
|
4076
|
+
// Overloads of new_from_bitmap
|
|
4077
|
+
|
|
4078
|
+
/**
|
|
4079
|
+
* Creates a #CoglTexture from a #CoglBitmap.
|
|
4080
|
+
* @param bitmap A #CoglBitmap pointer
|
|
4081
|
+
* @param flags Optional flags for the texture, or %COGL_TEXTURE_NONE
|
|
4082
|
+
* @param internal_format the #CoglPixelFormat to use for the GPU storage of the texture
|
|
4083
|
+
* @returns A newly created #CoglTexture or %NULL on failure
|
|
4084
|
+
*/
|
|
4085
|
+
static new_from_bitmap(bitmap: Bitmap, flags: TextureFlags, internal_format: PixelFormat): Texture
|
|
4086
|
+
_init(config?: Texture2DSliced.ConstructorProperties): void
|
|
4087
|
+
}
|
|
4088
|
+
|
|
4089
|
+
interface Color {
|
|
4090
|
+
|
|
4091
|
+
// Owm methods of Cogl-10.Cogl.Color
|
|
4092
|
+
|
|
4093
|
+
/**
|
|
4094
|
+
* Creates a copy of `color`
|
|
4095
|
+
* @returns a newly-allocated #CoglColor. Use cogl_color_free() to free the allocate resources
|
|
4096
|
+
*/
|
|
4097
|
+
copy(): Color
|
|
4098
|
+
/**
|
|
4099
|
+
* Frees the resources allocated by cogl_color_new() and cogl_color_copy()
|
|
4100
|
+
*/
|
|
4101
|
+
free(): void
|
|
4102
|
+
/**
|
|
4103
|
+
* Retrieves the alpha channel of `color` as a fixed point
|
|
4104
|
+
* value between 0 and 1.0.
|
|
4105
|
+
* @returns the alpha channel of the passed color
|
|
4106
|
+
*/
|
|
4107
|
+
get_alpha(): number
|
|
4108
|
+
/**
|
|
4109
|
+
* Retrieves the alpha channel of `color` as a byte value
|
|
4110
|
+
* between 0 and 255
|
|
4111
|
+
* @returns the alpha channel of the passed color
|
|
4112
|
+
*/
|
|
4113
|
+
get_alpha_byte(): number
|
|
4114
|
+
/**
|
|
4115
|
+
* Retrieves the alpha channel of `color` as a floating point
|
|
4116
|
+
* value between 0.0 and 1.0
|
|
4117
|
+
* @returns the alpha channel of the passed color
|
|
4118
|
+
*/
|
|
4119
|
+
get_alpha_float(): number
|
|
4120
|
+
/**
|
|
4121
|
+
* Retrieves the blue channel of `color` as a fixed point
|
|
4122
|
+
* value between 0 and 1.0.
|
|
4123
|
+
* @returns the blue channel of the passed color
|
|
4124
|
+
*/
|
|
4125
|
+
get_blue(): number
|
|
4126
|
+
/**
|
|
4127
|
+
* Retrieves the blue channel of `color` as a byte value
|
|
4128
|
+
* between 0 and 255
|
|
4129
|
+
* @returns the blue channel of the passed color
|
|
4130
|
+
*/
|
|
4131
|
+
get_blue_byte(): number
|
|
4132
|
+
/**
|
|
4133
|
+
* Retrieves the blue channel of `color` as a floating point
|
|
4134
|
+
* value between 0.0 and 1.0
|
|
4135
|
+
* @returns the blue channel of the passed color
|
|
4136
|
+
*/
|
|
4137
|
+
get_blue_float(): number
|
|
4138
|
+
/**
|
|
4139
|
+
* Retrieves the green channel of `color` as a fixed point
|
|
4140
|
+
* value between 0 and 1.0.
|
|
4141
|
+
* @returns the green channel of the passed color
|
|
4142
|
+
*/
|
|
4143
|
+
get_green(): number
|
|
4144
|
+
/**
|
|
4145
|
+
* Retrieves the green channel of `color` as a byte value
|
|
4146
|
+
* between 0 and 255
|
|
4147
|
+
* @returns the green channel of the passed color
|
|
4148
|
+
*/
|
|
4149
|
+
get_green_byte(): number
|
|
4150
|
+
/**
|
|
4151
|
+
* Retrieves the green channel of `color` as a floating point
|
|
4152
|
+
* value between 0.0 and 1.0
|
|
4153
|
+
* @returns the green channel of the passed color
|
|
4154
|
+
*/
|
|
4155
|
+
get_green_float(): number
|
|
4156
|
+
/**
|
|
4157
|
+
* Retrieves the red channel of `color` as a fixed point
|
|
4158
|
+
* value between 0 and 1.0.
|
|
4159
|
+
* @returns the red channel of the passed color
|
|
4160
|
+
*/
|
|
4161
|
+
get_red(): number
|
|
4162
|
+
/**
|
|
4163
|
+
* Retrieves the red channel of `color` as a byte value
|
|
4164
|
+
* between 0 and 255
|
|
4165
|
+
* @returns the red channel of the passed color
|
|
4166
|
+
*/
|
|
4167
|
+
get_red_byte(): number
|
|
4168
|
+
/**
|
|
4169
|
+
* Retrieves the red channel of `color` as a floating point
|
|
4170
|
+
* value between 0.0 and 1.0
|
|
4171
|
+
* @returns the red channel of the passed color
|
|
4172
|
+
*/
|
|
4173
|
+
get_red_float(): number
|
|
4174
|
+
/**
|
|
4175
|
+
* Sets the values of the passed channels into a #CoglColor
|
|
4176
|
+
* @param red value of the red channel, between 0 and 1.0
|
|
4177
|
+
* @param green value of the green channel, between 0 and 1.0
|
|
4178
|
+
* @param blue value of the blue channel, between 0 and 1.0
|
|
4179
|
+
* @param alpha value of the alpha channel, between 0 and 1.0
|
|
4180
|
+
*/
|
|
4181
|
+
init_from_4f(red: number, green: number, blue: number, alpha: number): void
|
|
4182
|
+
/**
|
|
4183
|
+
* Sets the values of the passed channels into a #CoglColor
|
|
4184
|
+
* @param color_array a pointer to an array of 4 float color components
|
|
4185
|
+
*/
|
|
4186
|
+
init_from_4fv(color_array: number): void
|
|
4187
|
+
/**
|
|
4188
|
+
* Sets the values of the passed channels into a #CoglColor.
|
|
4189
|
+
* @param red value of the red channel, between 0 and 255
|
|
4190
|
+
* @param green value of the green channel, between 0 and 255
|
|
4191
|
+
* @param blue value of the blue channel, between 0 and 255
|
|
4192
|
+
* @param alpha value of the alpha channel, between 0 and 255
|
|
4193
|
+
*/
|
|
4194
|
+
init_from_4ub(red: number, green: number, blue: number, alpha: number): void
|
|
4195
|
+
/**
|
|
4196
|
+
* Converts a non-premultiplied color to a pre-multiplied color. For
|
|
4197
|
+
* example, semi-transparent red is (1.0, 0, 0, 0.5) when non-premultiplied
|
|
4198
|
+
* and (0.5, 0, 0, 0.5) when premultiplied.
|
|
4199
|
+
*/
|
|
4200
|
+
premultiply(): void
|
|
4201
|
+
/**
|
|
4202
|
+
* Sets the alpha channel of `color` to `alpha`.
|
|
4203
|
+
* @param alpha a float value between 0.0f and 1.0f
|
|
4204
|
+
*/
|
|
4205
|
+
set_alpha(alpha: number): void
|
|
4206
|
+
/**
|
|
4207
|
+
* Sets the alpha channel of `color` to `alpha`.
|
|
4208
|
+
* @param alpha a byte value between 0 and 255
|
|
4209
|
+
*/
|
|
4210
|
+
set_alpha_byte(alpha: number): void
|
|
4211
|
+
/**
|
|
4212
|
+
* Sets the alpha channel of `color` to `alpha`.
|
|
4213
|
+
* @param alpha a float value between 0.0f and 1.0f
|
|
4214
|
+
*/
|
|
4215
|
+
set_alpha_float(alpha: number): void
|
|
4216
|
+
/**
|
|
4217
|
+
* Sets the blue channel of `color` to `blue`.
|
|
4218
|
+
* @param blue a float value between 0.0f and 1.0f
|
|
4219
|
+
*/
|
|
4220
|
+
set_blue(blue: number): void
|
|
4221
|
+
/**
|
|
4222
|
+
* Sets the blue channel of `color` to `blue`.
|
|
4223
|
+
* @param blue a byte value between 0 and 255
|
|
4224
|
+
*/
|
|
4225
|
+
set_blue_byte(blue: number): void
|
|
4226
|
+
/**
|
|
4227
|
+
* Sets the blue channel of `color` to `blue`.
|
|
4228
|
+
* @param blue a float value between 0.0f and 1.0f
|
|
4229
|
+
*/
|
|
4230
|
+
set_blue_float(blue: number): void
|
|
4231
|
+
/**
|
|
4232
|
+
* Sets the green channel of `color` to `green`.
|
|
4233
|
+
* @param green a float value between 0.0f and 1.0f
|
|
4234
|
+
*/
|
|
4235
|
+
set_green(green: number): void
|
|
4236
|
+
/**
|
|
4237
|
+
* Sets the green channel of `color` to `green`.
|
|
4238
|
+
* @param green a byte value between 0 and 255
|
|
4239
|
+
*/
|
|
4240
|
+
set_green_byte(green: number): void
|
|
4241
|
+
/**
|
|
4242
|
+
* Sets the green channel of `color` to `green`.
|
|
4243
|
+
* @param green a float value between 0.0f and 1.0f
|
|
4244
|
+
*/
|
|
4245
|
+
set_green_float(green: number): void
|
|
4246
|
+
/**
|
|
4247
|
+
* Sets the red channel of `color` to `red`.
|
|
4248
|
+
* @param red a float value between 0.0f and 1.0f
|
|
4249
|
+
*/
|
|
4250
|
+
set_red(red: number): void
|
|
4251
|
+
/**
|
|
4252
|
+
* Sets the red channel of `color` to `red`.
|
|
4253
|
+
* @param red a byte value between 0 and 255
|
|
4254
|
+
*/
|
|
4255
|
+
set_red_byte(red: number): void
|
|
4256
|
+
/**
|
|
4257
|
+
* Sets the red channel of `color` to `red`.
|
|
4258
|
+
* @param red a float value between 0.0f and 1.0f
|
|
4259
|
+
*/
|
|
4260
|
+
set_red_float(red: number): void
|
|
4261
|
+
/**
|
|
4262
|
+
* Converts `color` to the HLS format.
|
|
4263
|
+
*
|
|
4264
|
+
* The `hue` value is in the 0 .. 360 range. The `luminance` and
|
|
4265
|
+
* `saturation` values are in the 0 .. 1 range.
|
|
4266
|
+
*/
|
|
4267
|
+
to_hsl(): [ /* hue */ number, /* saturation */ number, /* luminance */ number ]
|
|
4268
|
+
/**
|
|
4269
|
+
* Converts a pre-multiplied color to a non-premultiplied color. For
|
|
4270
|
+
* example, semi-transparent red is (0.5, 0, 0, 0.5) when premultiplied
|
|
4271
|
+
* and (1.0, 0, 0, 0.5) when non-premultiplied.
|
|
4272
|
+
*/
|
|
4273
|
+
unpremultiply(): void
|
|
4274
|
+
}
|
|
4275
|
+
|
|
4276
|
+
/**
|
|
4277
|
+
* A structure for holding a color definition. The contents of
|
|
4278
|
+
* the CoglColor structure are private and should never by accessed
|
|
4279
|
+
* directly.
|
|
4280
|
+
* @record
|
|
4281
|
+
*/
|
|
4282
|
+
class Color {
|
|
4283
|
+
|
|
4284
|
+
// Own properties of Cogl-10.Cogl.Color
|
|
4285
|
+
|
|
4286
|
+
static name: string
|
|
4287
|
+
|
|
4288
|
+
// Constructors of Cogl-10.Cogl.Color
|
|
4289
|
+
|
|
4290
|
+
/**
|
|
4291
|
+
* Creates a new (empty) color
|
|
4292
|
+
* @constructor
|
|
4293
|
+
* @returns a newly-allocated #CoglColor. Use cogl_color_free() to free the allocated resources
|
|
4294
|
+
*/
|
|
4295
|
+
constructor()
|
|
4296
|
+
/**
|
|
4297
|
+
* Creates a new (empty) color
|
|
4298
|
+
* @constructor
|
|
4299
|
+
* @returns a newly-allocated #CoglColor. Use cogl_color_free() to free the allocated resources
|
|
4300
|
+
*/
|
|
4301
|
+
static new(): Color
|
|
4302
|
+
/**
|
|
4303
|
+
* Compares two #CoglColor<!-- -->s and checks if they are the same.
|
|
4304
|
+
*
|
|
4305
|
+
* This function can be passed to g_hash_table_new() as the `key_equal_func`
|
|
4306
|
+
* parameter, when using #CoglColor<!-- -->s as keys in a #GHashTable.
|
|
4307
|
+
* @param v1 a #CoglColor
|
|
4308
|
+
* @param v2 a #CoglColor
|
|
4309
|
+
* @returns %TRUE if the two colors are the same.
|
|
4310
|
+
*/
|
|
4311
|
+
static equal(v1: any | null, v2: any | null): boolean
|
|
4312
|
+
/**
|
|
4313
|
+
* Converts a color expressed in HLS (hue, luminance and saturation)
|
|
4314
|
+
* values into a #CoglColor.
|
|
4315
|
+
* @param hue hue value, in the 0 .. 360 range
|
|
4316
|
+
* @param saturation saturation value, in the 0 .. 1 range
|
|
4317
|
+
* @param luminance luminance value, in the 0 .. 1 range
|
|
4318
|
+
*/
|
|
4319
|
+
static init_from_hsl(hue: number, saturation: number, luminance: number): /* color */ Color
|
|
4320
|
+
}
|
|
4321
|
+
|
|
4322
|
+
interface DebugObjectTypeInfo {
|
|
4323
|
+
|
|
4324
|
+
// Own fields of Cogl-10.Cogl.DebugObjectTypeInfo
|
|
4325
|
+
|
|
4326
|
+
/**
|
|
4327
|
+
* A human readable name for the type.
|
|
4328
|
+
* @field
|
|
4329
|
+
*/
|
|
4330
|
+
name: string | null
|
|
4331
|
+
/**
|
|
4332
|
+
* The number of objects of this type that are
|
|
4333
|
+
* currently in use
|
|
4334
|
+
* @field
|
|
4335
|
+
*/
|
|
4336
|
+
instance_count: number
|
|
4337
|
+
}
|
|
4338
|
+
|
|
4339
|
+
/**
|
|
4340
|
+
* This struct is used to pass information to the callback when
|
|
4341
|
+
* cogl_debug_object_foreach_type() is called.
|
|
4342
|
+
* @record
|
|
4343
|
+
*/
|
|
4344
|
+
class DebugObjectTypeInfo {
|
|
4345
|
+
|
|
4346
|
+
// Own properties of Cogl-10.Cogl.DebugObjectTypeInfo
|
|
4347
|
+
|
|
4348
|
+
static name: string
|
|
4349
|
+
}
|
|
4350
|
+
|
|
4351
|
+
interface DmaBufHandle {
|
|
4352
|
+
}
|
|
4353
|
+
|
|
4354
|
+
/**
|
|
4355
|
+
* An opaque type that tracks the lifetime of a DMA buffer fd. Release
|
|
4356
|
+
* with cogl_dma_buf_handle_free().
|
|
4357
|
+
* @record
|
|
4358
|
+
*/
|
|
4359
|
+
class DmaBufHandle {
|
|
4360
|
+
|
|
4361
|
+
// Own properties of Cogl-10.Cogl.DmaBufHandle
|
|
4362
|
+
|
|
4363
|
+
static name: string
|
|
4364
|
+
}
|
|
4365
|
+
|
|
4366
|
+
interface FrameClosure {
|
|
4367
|
+
}
|
|
4368
|
+
|
|
4369
|
+
/**
|
|
4370
|
+
* An opaque type that tracks a #CoglFrameCallback and associated user
|
|
4371
|
+
* data. A #CoglFrameClosure pointer will be returned from
|
|
4372
|
+
* cogl_onscreen_add_frame_callback() and it allows you to remove a
|
|
4373
|
+
* callback later using cogl_onscreen_remove_frame_callback().
|
|
4374
|
+
* @record
|
|
4375
|
+
*/
|
|
4376
|
+
class FrameClosure {
|
|
4377
|
+
|
|
4378
|
+
// Own properties of Cogl-10.Cogl.FrameClosure
|
|
4379
|
+
|
|
4380
|
+
static name: string
|
|
4381
|
+
}
|
|
4382
|
+
|
|
4383
|
+
interface FramebufferClass {
|
|
4384
|
+
|
|
4385
|
+
// Own fields of Cogl-10.Cogl.FramebufferClass
|
|
4386
|
+
|
|
4387
|
+
allocate: (framebuffer: Framebuffer) => boolean
|
|
4388
|
+
is_y_flipped: (framebuffer: Framebuffer) => boolean
|
|
4389
|
+
}
|
|
4390
|
+
|
|
4391
|
+
abstract class FramebufferClass {
|
|
4392
|
+
|
|
4393
|
+
// Own properties of Cogl-10.Cogl.FramebufferClass
|
|
4394
|
+
|
|
4395
|
+
static name: string
|
|
4396
|
+
}
|
|
4397
|
+
|
|
4398
|
+
interface FramebufferDriverConfig {
|
|
4399
|
+
}
|
|
4400
|
+
|
|
4401
|
+
class FramebufferDriverConfig {
|
|
4402
|
+
|
|
4403
|
+
// Own properties of Cogl-10.Cogl.FramebufferDriverConfig
|
|
4404
|
+
|
|
4405
|
+
static name: string
|
|
4406
|
+
}
|
|
4407
|
+
|
|
4408
|
+
interface OffscreenClass {
|
|
4409
|
+
|
|
4410
|
+
// Own fields of Cogl-10.Cogl.OffscreenClass
|
|
4411
|
+
|
|
4412
|
+
parent_class: FramebufferClass
|
|
4413
|
+
}
|
|
4414
|
+
|
|
4415
|
+
abstract class OffscreenClass {
|
|
4416
|
+
|
|
4417
|
+
// Own properties of Cogl-10.Cogl.OffscreenClass
|
|
4418
|
+
|
|
4419
|
+
static name: string
|
|
4420
|
+
}
|
|
4421
|
+
|
|
4422
|
+
interface OnscreenClass {
|
|
4423
|
+
|
|
4424
|
+
// Own fields of Cogl-10.Cogl.OnscreenClass
|
|
4425
|
+
|
|
4426
|
+
bind: (onscreen: Onscreen) => void
|
|
4427
|
+
swap_buffers_with_damage: (onscreen: Onscreen, rectangles: number, n_rectangles: number, info: FrameInfo) => void
|
|
4428
|
+
swap_region: (onscreen: Onscreen, rectangles: number, n_rectangles: number, info: FrameInfo) => void
|
|
4429
|
+
queue_damage_region: (onscreen: Onscreen, rectangles: number, n_rectangles: number) => void
|
|
4430
|
+
direct_scanout: (onscreen: Onscreen, scanout: Scanout, info: FrameInfo) => boolean
|
|
4431
|
+
get_buffer_age: (onscreen: Onscreen) => number
|
|
4432
|
+
}
|
|
4433
|
+
|
|
4434
|
+
abstract class OnscreenClass {
|
|
4435
|
+
|
|
4436
|
+
// Own properties of Cogl-10.Cogl.OnscreenClass
|
|
4437
|
+
|
|
4438
|
+
static name: string
|
|
4439
|
+
}
|
|
4440
|
+
|
|
4441
|
+
interface OnscreenDirtyClosure {
|
|
4442
|
+
}
|
|
4443
|
+
|
|
4444
|
+
/**
|
|
4445
|
+
* An opaque type that tracks a #CoglOnscreenDirtyCallback and associated
|
|
4446
|
+
* user data. A #CoglOnscreenDirtyClosure pointer will be returned from
|
|
4447
|
+
* cogl_onscreen_add_dirty_callback() and it allows you to remove a
|
|
4448
|
+
* callback later using cogl_onscreen_remove_dirty_callback().
|
|
4449
|
+
* @record
|
|
4450
|
+
*/
|
|
4451
|
+
class OnscreenDirtyClosure {
|
|
4452
|
+
|
|
4453
|
+
// Own properties of Cogl-10.Cogl.OnscreenDirtyClosure
|
|
4454
|
+
|
|
4455
|
+
static name: string
|
|
4456
|
+
}
|
|
4457
|
+
|
|
4458
|
+
interface OnscreenDirtyInfo {
|
|
4459
|
+
|
|
4460
|
+
// Own fields of Cogl-10.Cogl.OnscreenDirtyInfo
|
|
4461
|
+
|
|
4462
|
+
/**
|
|
4463
|
+
* Left edge of the dirty rectangle
|
|
4464
|
+
* @field
|
|
4465
|
+
*/
|
|
4466
|
+
x: number
|
|
4467
|
+
/**
|
|
4468
|
+
* Top edge of the dirty rectangle, measured from the top of the window
|
|
4469
|
+
* @field
|
|
4470
|
+
*/
|
|
4471
|
+
y: number
|
|
4472
|
+
/**
|
|
4473
|
+
* Width of the dirty rectangle
|
|
4474
|
+
* @field
|
|
4475
|
+
*/
|
|
4476
|
+
width: number
|
|
4477
|
+
/**
|
|
4478
|
+
* Height of the dirty rectangle
|
|
4479
|
+
* @field
|
|
4480
|
+
*/
|
|
4481
|
+
height: number
|
|
4482
|
+
}
|
|
4483
|
+
|
|
4484
|
+
/**
|
|
4485
|
+
* A structure passed to callbacks registered using
|
|
4486
|
+
* cogl_onscreen_add_dirty_callback(). The members describe a
|
|
4487
|
+
* rectangle within the onscreen buffer that should be redrawn.
|
|
4488
|
+
* @record
|
|
4489
|
+
*/
|
|
4490
|
+
class OnscreenDirtyInfo {
|
|
4491
|
+
|
|
4492
|
+
// Own properties of Cogl-10.Cogl.OnscreenDirtyInfo
|
|
4493
|
+
|
|
4494
|
+
static name: string
|
|
4495
|
+
}
|
|
4496
|
+
|
|
4497
|
+
interface Scanout {
|
|
4498
|
+
}
|
|
4499
|
+
|
|
4500
|
+
class Scanout {
|
|
4501
|
+
|
|
4502
|
+
// Own properties of Cogl-10.Cogl.Scanout
|
|
4503
|
+
|
|
4504
|
+
static name: string
|
|
4505
|
+
|
|
4506
|
+
// Constructors of Cogl-10.Cogl.Scanout
|
|
4507
|
+
|
|
4508
|
+
static error_quark(): GLib.Quark
|
|
4509
|
+
}
|
|
4510
|
+
|
|
4511
|
+
interface TextureVertex {
|
|
4512
|
+
|
|
4513
|
+
// Own fields of Cogl-10.Cogl.TextureVertex
|
|
4514
|
+
|
|
4515
|
+
/**
|
|
4516
|
+
* Model x-coordinate
|
|
4517
|
+
* @field
|
|
4518
|
+
*/
|
|
4519
|
+
x: number
|
|
4520
|
+
/**
|
|
4521
|
+
* Model y-coordinate
|
|
4522
|
+
* @field
|
|
4523
|
+
*/
|
|
4524
|
+
y: number
|
|
4525
|
+
/**
|
|
4526
|
+
* Model z-coordinate
|
|
4527
|
+
* @field
|
|
4528
|
+
*/
|
|
4529
|
+
z: number
|
|
4530
|
+
/**
|
|
4531
|
+
* Texture x-coordinate
|
|
4532
|
+
* @field
|
|
4533
|
+
*/
|
|
4534
|
+
tx: number
|
|
4535
|
+
/**
|
|
4536
|
+
* Texture y-coordinate
|
|
4537
|
+
* @field
|
|
4538
|
+
*/
|
|
4539
|
+
ty: number
|
|
4540
|
+
/**
|
|
4541
|
+
* The color to use at this vertex. This is ignored if
|
|
4542
|
+
* use_color is %FALSE when calling cogl_polygon()
|
|
4543
|
+
* @field
|
|
4544
|
+
*/
|
|
4545
|
+
color: Color
|
|
4546
|
+
}
|
|
4547
|
+
|
|
4548
|
+
/**
|
|
4549
|
+
* Used to specify vertex information when calling cogl_polygon()
|
|
4550
|
+
* @record
|
|
4551
|
+
*/
|
|
4552
|
+
class TextureVertex {
|
|
4553
|
+
|
|
4554
|
+
// Own properties of Cogl-10.Cogl.TextureVertex
|
|
4555
|
+
|
|
4556
|
+
static name: string
|
|
4557
|
+
}
|
|
4558
|
+
|
|
4559
|
+
interface TimestampQuery {
|
|
4560
|
+
}
|
|
4561
|
+
|
|
4562
|
+
class TimestampQuery {
|
|
4563
|
+
|
|
4564
|
+
// Own properties of Cogl-10.Cogl.TimestampQuery
|
|
4565
|
+
|
|
4566
|
+
static name: string
|
|
4567
|
+
}
|
|
4568
|
+
|
|
4569
|
+
interface TraceContext {
|
|
4570
|
+
}
|
|
4571
|
+
|
|
4572
|
+
class TraceContext {
|
|
4573
|
+
|
|
4574
|
+
// Own properties of Cogl-10.Cogl.TraceContext
|
|
4575
|
+
|
|
4576
|
+
static name: string
|
|
4577
|
+
}
|
|
4578
|
+
|
|
4579
|
+
interface TraceHead {
|
|
4580
|
+
|
|
4581
|
+
// Own fields of Cogl-10.Cogl.TraceHead
|
|
4582
|
+
|
|
4583
|
+
begin_time: number
|
|
4584
|
+
name: string | null
|
|
4585
|
+
description: string | null
|
|
4586
|
+
}
|
|
4587
|
+
|
|
4588
|
+
class TraceHead {
|
|
4589
|
+
|
|
4590
|
+
// Own properties of Cogl-10.Cogl.TraceHead
|
|
4591
|
+
|
|
4592
|
+
static name: string
|
|
4593
|
+
}
|
|
4594
|
+
|
|
4595
|
+
interface UserDataKey {
|
|
4596
|
+
|
|
4597
|
+
// Own fields of Cogl-10.Cogl.UserDataKey
|
|
4598
|
+
|
|
4599
|
+
/**
|
|
4600
|
+
* ignored.
|
|
4601
|
+
* @field
|
|
4602
|
+
*/
|
|
4603
|
+
unused: number
|
|
4604
|
+
}
|
|
4605
|
+
|
|
4606
|
+
/**
|
|
4607
|
+
* A #CoglUserDataKey is used to declare a key for attaching data to a
|
|
4608
|
+
* #CoglObject using cogl_object_set_user_data. The typedef only exists as a
|
|
4609
|
+
* formality to make code self documenting since only the unique address of a
|
|
4610
|
+
* #CoglUserDataKey is used.
|
|
4611
|
+
*
|
|
4612
|
+
* Typically you would declare a static #CoglUserDataKey and set private data
|
|
4613
|
+
* on an object something like this:
|
|
4614
|
+
*
|
|
4615
|
+
*
|
|
4616
|
+
* ```
|
|
4617
|
+
* static CoglUserDataKey path_private_key;
|
|
4618
|
+
*
|
|
4619
|
+
* static void
|
|
4620
|
+
* destroy_path_private_cb (void *data)
|
|
4621
|
+
* {
|
|
4622
|
+
* g_free (data);
|
|
4623
|
+
* }
|
|
4624
|
+
*
|
|
4625
|
+
* static void
|
|
4626
|
+
* my_path_set_data (CoglPipeline *pipeline, void *data)
|
|
4627
|
+
* {
|
|
4628
|
+
* cogl_object_set_user_data (COGL_OBJECT (pipeline),
|
|
4629
|
+
* &private_key,
|
|
4630
|
+
* data,
|
|
4631
|
+
* destroy_pipeline_private_cb);
|
|
4632
|
+
* }
|
|
4633
|
+
* ```
|
|
4634
|
+
*
|
|
4635
|
+
* @record
|
|
4636
|
+
*/
|
|
4637
|
+
class UserDataKey {
|
|
4638
|
+
|
|
4639
|
+
// Own properties of Cogl-10.Cogl.UserDataKey
|
|
4640
|
+
|
|
4641
|
+
static name: string
|
|
4642
|
+
}
|
|
4643
|
+
|
|
4644
|
+
interface _ColorSizeCheck {
|
|
4645
|
+
|
|
4646
|
+
// Own fields of Cogl-10.Cogl._ColorSizeCheck
|
|
4647
|
+
|
|
4648
|
+
compile_time_assert_CoglColor_size: number[]
|
|
4649
|
+
}
|
|
4650
|
+
|
|
4651
|
+
class _ColorSizeCheck {
|
|
4652
|
+
|
|
4653
|
+
// Own properties of Cogl-10.Cogl._ColorSizeCheck
|
|
4654
|
+
|
|
4655
|
+
static name: string
|
|
4656
|
+
}
|
|
4657
|
+
|
|
4658
|
+
interface _TextureVertexSizeCheck {
|
|
4659
|
+
|
|
4660
|
+
// Own fields of Cogl-10.Cogl._TextureVertexSizeCheck
|
|
4661
|
+
|
|
4662
|
+
compile_time_assert_CoglTextureVertex_size: number[]
|
|
4663
|
+
}
|
|
4664
|
+
|
|
4665
|
+
class _TextureVertexSizeCheck {
|
|
4666
|
+
|
|
4667
|
+
// Own properties of Cogl-10.Cogl._TextureVertexSizeCheck
|
|
4668
|
+
|
|
4669
|
+
static name: string
|
|
4670
|
+
}
|
|
4671
|
+
|
|
4672
|
+
type Angle = number
|
|
4673
|
+
type Handle = any
|
|
4674
|
+
type PipelineKey = string
|
|
4675
|
+
type UserDataDestroyCallback = GLib.DestroyNotify
|
|
4676
|
+
/**
|
|
4677
|
+
* Name of the imported GIR library
|
|
4678
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
4679
|
+
*/
|
|
4680
|
+
const __name__: string
|
|
4681
|
+
/**
|
|
4682
|
+
* Version of the imported GIR library
|
|
4683
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
4684
|
+
*/
|
|
4685
|
+
const __version__: string
|
|
4686
|
+
}
|
|
4687
|
+
|
|
4688
|
+
export default Cogl;
|
|
4689
|
+
// END
|