/
Cogl-2.0.d.ts
10376 lines (9850 loc) · 408 KB
/
Cogl-2.0.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// @ts-nocheck
/*
* Type Definitions for node-gtk (https://github.com/romgrk/node-gtk)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in ts-for-gir itself or create a bug report on https://github.com/sammydre/ts-for-gjs
*/
/**
* Cogl-2.0
*/
import type GObject from './GObject-2.0';
import type GLib from './GLib-2.0';
import type GL from './GL-1.0';
export namespace Cogl {
/**
* Data types for the components of a vertex attribute.
*/
enum AttributeType {
/**
* Data is the same size of a byte
*/
BYTE,
/**
* Data is the same size of an
* unsigned byte
*/
UNSIGNED_BYTE,
/**
* Data is the same size of a short integer
*/
SHORT,
/**
* Data is the same size of
* an unsigned short integer
*/
UNSIGNED_SHORT,
/**
* Data is the same size of a float
*/
FLOAT,
}
/**
* Error codes that can be thrown when performing bitmap
* operations. Note that gdk_pixbuf_new_from_file() can also throw
* errors directly from the underlying image loading library. For
* example, if GdkPixbuf is used then errors #GdkPixbufError<!-- -->s
* will be used directly.
*/
enum BitmapError {
/**
* Generic failure code, something went
* wrong.
*/
FAILED,
/**
* Unknown image type.
*/
UNKNOWN_TYPE,
/**
* An image file was broken somehow.
*/
CORRUPT_IMAGE,
}
/**
* Error enumeration for the blend strings parser
*/
enum BlendStringError {
/**
* Generic parse error
*/
PARSE_ERROR,
/**
* Argument parse error
*/
ARGUMENT_PARSE_ERROR,
/**
* Internal parser error
*/
INVALID_ERROR,
/**
* Blend string not
* supported by the GPU
*/
GPU_UNSUPPORTED_ERROR,
}
/**
* Error enumeration for #CoglBuffer
*/
enum BufferError {
/**
* A buffer could not be mapped either
* because the feature isn't supported or because a system
* limitation was hit.
*/
BUFFER_ERROR_MAP,
}
/**
* The update hint on a buffer allows the user to give some detail on how often
* the buffer data is going to be updated.
*/
enum BufferUpdateHint {
/**
* the buffer will not change over time
*/
STATIC,
/**
* the buffer will change from time to time
*/
DYNAMIC,
/**
* the buffer will be used once or a couple of
* times
*/
STREAM,
}
/**
* When using depth testing one of these functions is used to compare
* the depth of an incoming fragment against the depth value currently
* stored in the depth buffer. The function is changed using
* cogl_depth_state_set_test_function().
*
* The test is only done when depth testing is explicitly enabled. (See
* cogl_depth_state_set_test_enabled())
*/
enum DepthTestFunction {
/**
* Never passes.
*/
NEVER,
/**
* Passes if the fragment's depth
* value is less than the value currently in the depth buffer.
*/
LESS,
/**
* Passes if the fragment's depth
* value is equal to the value currently in the depth buffer.
*/
EQUAL,
/**
* Passes if the fragment's depth
* value is less or equal to the value currently in the depth buffer.
*/
LEQUAL,
/**
* Passes if the fragment's depth
* value is greater than the value currently in the depth buffer.
*/
GREATER,
/**
* Passes if the fragment's depth
* value is not equal to the value currently in the depth buffer.
*/
NOTEQUAL,
/**
* Passes if the fragment's depth
* value greater than or equal to the value currently in the depth buffer.
*/
GEQUAL,
/**
* Always passes.
*/
ALWAYS,
}
/**
* Identifiers for underlying hardware drivers that may be used by
* Cogl for rendering.
*/
enum Driver {
/**
* Implies no preference for which driver is used
*/
ANY,
/**
* A No-Op driver.
*/
NOP,
/**
* An OpenGL driver.
*/
GL,
/**
* An OpenGL driver using the core GL 3.1 profile
*/
GL3,
/**
* An OpenGL ES 1.1 driver.
*/
GLES1,
/**
* An OpenGL ES 2.0 driver.
*/
GLES2,
/**
* A WebGL driver.
*/
WEBGL,
}
/**
* All the capabilities that can vary between different GPUs supported
* by Cogl. Applications that depend on any of these features should explicitly
* check for them using cogl_has_feature() or cogl_has_features().
*/
enum FeatureID {
/**
* The hardware supports non power
* of two textures, but you also need to check the
* %COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP and %COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT
* features to know if the hardware supports npot texture mipmaps
* or repeat modes other than
* %COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE respectively.
*/
OGL_FEATURE_ID_TEXTURE_NPOT_BASIC,
/**
* Mipmapping is supported in
* conjuntion with non power of two textures.
*/
OGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP,
/**
* Repeat modes other than
* %COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE are supported by the
* hardware.
*/
OGL_FEATURE_ID_TEXTURE_NPOT_REPEAT,
/**
* Non power of two textures are supported
* by the hardware. This is a equivalent to the
* %COGL_FEATURE_ID_TEXTURE_NPOT_BASIC, %COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP
* and %COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT features combined.
*/
OGL_FEATURE_ID_TEXTURE_NPOT,
/**
* Support for rectangular
* textures with non-normalized texture coordinates.
*/
OGL_FEATURE_ID_TEXTURE_RECTANGLE,
/**
* 3D texture support
*/
OGL_FEATURE_ID_TEXTURE_3D,
/**
* GLSL support
*/
OGL_FEATURE_ID_GLSL,
/**
* ARBFP support
*/
OGL_FEATURE_ID_ARBFP,
/**
* Offscreen rendering support
*/
OGL_FEATURE_ID_OFFSCREEN,
/**
* Multisample support for
* offscreen framebuffers
*/
OGL_FEATURE_ID_OFFSCREEN_MULTISAMPLE,
/**
* Multiple onscreen framebuffers
* supported.
*/
OGL_FEATURE_ID_ONSCREEN_MULTIPLE,
/**
* Set if
* %COGL_INDICES_TYPE_UNSIGNED_INT is supported in
* cogl_indices_new().
*/
OGL_FEATURE_ID_UNSIGNED_INT_INDICES,
/**
* cogl_pipeline_set_depth_range() support
*/
OGL_FEATURE_ID_DEPTH_RANGE,
/**
* Whether
* cogl_pipeline_set_layer_point_sprite_coords_enabled() is supported.
*/
OGL_FEATURE_ID_POINT_SPRITE,
/**
* Whether cogl_buffer_map() is
* supported with CoglBufferAccess including read support.
*/
OGL_FEATURE_ID_MAP_BUFFER_FOR_READ,
/**
* Whether cogl_buffer_map() is
* supported with CoglBufferAccess including write support.
*/
OGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE,
/**
* Whether
* %COGL_PIPELINE_WRAP_MODE_MIRRORED_REPEAT is supported.
*/
OGL_FEATURE_ID_MIRRORED_REPEAT,
/**
* Available if the window system supports reporting an event
* for swap buffer completions.
*/
OGL_FEATURE_ID_SWAP_BUFFERS_EVENT,
/**
* Whether creating new GLES2 contexts is
* suported.
*/
OGL_FEATURE_ID_GLES2_CONTEXT,
/**
* Whether #CoglFramebuffer support rendering
* the depth buffer to a texture.
*/
OGL_FEATURE_ID_DEPTH_TEXTURE,
/**
* Whether frame presentation
* time stamps will be recorded in #CoglFrameInfo objects.
*/
OGL_FEATURE_ID_PRESENTATION_TIME,
OGL_FEATURE_ID_FENCE,
/**
* Whether cogl_point_size_in
* can be used as an attribute to set a per-vertex point size.
*/
OGL_FEATURE_ID_PER_VERTEX_POINT_SIZE,
/**
* Support for
* %COGL_TEXTURE_COMPONENTS_RG as the internal components of a
* texture.
*/
OGL_FEATURE_ID_TEXTURE_RG,
/**
* Available if the age of #CoglOnscreen back
* buffers are tracked and so cogl_onscreen_get_buffer_age() can be
* expected to return age values other than 0.
*/
OGL_FEATURE_ID_BUFFER_AGE,
}
/**
* Return values for the #CoglXlibFilterFunc and #CoglWin32FilterFunc functions.
*/
enum FilterReturn {
/**
* The event was not handled, continues the
* processing
*/
CONTINUE,
/**
* Remove the event, stops the processing
*/
REMOVE,
}
/**
* The fog mode determines the equation used to calculate the fogging blend
* factor while fogging is enabled. The simplest %COGL_FOG_MODE_LINEAR mode
* determines f as:
*
* |[
* f = end - eye_distance / end - start
* ```
*
*
* Where eye_distance is the distance of the current fragment in eye
* coordinates from the origin.
*/
enum FogMode {
/**
* Calculates the fog blend factor as:
* |[
* f = end - eye_distance / end - start
* ```
*
*/
LINEAR,
/**
* Calculates the fog blend factor as:
* |[
* f = e ^ -(density * eye_distance)
* ```
*
*/
EXPONENTIAL,
/**
* Calculates the fog blend factor as:
* |[
* f = e ^ -(density * eye_distance)^2
* ```
*
*/
EXPONENTIAL_SQUARED,
}
/**
* Identifiers that are passed to #CoglFrameCallback functions
* (registered using cogl_onscreen_add_frame_callback()) that
* mark the progression of a frame in some way which usually
* means that new information will have been accumulated in the
* frame's corresponding #CoglFrameInfo object.
*
* The last event that will be sent for a frame will be a
* `COGL_FRAME_EVENT_COMPLETE` event and so these are a good
* opportunity to collect statistics about a frame since the
* #CoglFrameInfo should hold the most data at this point.
*
* <note>A frame may not be completed before the next frame can start
* so applications should avoid needing to collect all statistics for
* a particular frame before they can start a new frame.</note>
*/
enum FrameEvent {
/**
* Notifies that the system compositor has
* acknowledged a frame and is ready for a
* new frame to be created.
*/
SYNC,
/**
* Notifies that a frame has ended. This
* is a good time for applications to
* collect statistics about the frame
* since the #CoglFrameInfo should hold
* the most data at this point. No other
* events should be expected after a
* `COGL_FRAME_EVENT_COMPLETE` event.
*/
COMPLETE,
}
enum FramebufferError {
FRAMEBUFFER_ERROR_ALLOCATE,
}
/**
* Error codes that relate to the cogl_gles2_context api.
*/
enum GLES2ContextError {
/**
* Creating GLES2 contexts
* isn't supported. Applications should use cogl_has_feature() to
* check for the %COGL_FEATURE_ID_GLES2_CONTEXT.
*/
UNSUPPORTED,
/**
* An underlying driver error
* occured.
*/
DRIVER,
}
/**
* You should aim to use the smallest data type that gives you enough
* range, since it reduces the size of your index array and can help
* reduce the demand on memory bandwidth.
*
* Note that %COGL_INDICES_TYPE_UNSIGNED_INT is only supported if the
* %COGL_FEATURE_ID_UNSIGNED_INT_INDICES feature is available. This
* should always be available on OpenGL but on OpenGL ES it will only
* be available if the GL_OES_element_index_uint extension is
* advertized.
*/
enum IndicesType {
/**
* Your indices are unsigned bytes
*/
BYTE,
/**
* Your indices are unsigned shorts
*/
SHORT,
/**
* Your indices are unsigned ints
*/
INT,
}
enum MaterialAlphaFunc {
NEVER,
LESS,
EQUAL,
LEQUAL,
GREATER,
NOTEQUAL,
GEQUAL,
ALWAYS,
}
enum MaterialFilter {
NEAREST,
LINEAR,
NEAREST_MIPMAP_NEAREST,
LINEAR_MIPMAP_NEAREST,
NEAREST_MIPMAP_LINEAR,
LINEAR_MIPMAP_LINEAR,
}
enum MaterialLayerType {
TEXTURE,
}
enum MaterialWrapMode {
REPEAT,
CLAMP_TO_EDGE,
AUTOMATIC,
}
/**
* Alpha testing happens before blending primitives with the framebuffer and
* gives an opportunity to discard fragments based on a comparison with the
* incoming alpha value and a reference alpha value. The #CoglPipelineAlphaFunc
* determines how the comparison is done.
*/
enum PipelineAlphaFunc {
/**
* Never let the fragment through.
*/
NEVER,
/**
* Let the fragment through if the incoming
* alpha value is less than the reference alpha value
*/
LESS,
/**
* Let the fragment through if the incoming
* alpha value equals the reference alpha value
*/
EQUAL,
/**
* Let the fragment through if the incoming
* alpha value is less than or equal to the reference alpha value
*/
LEQUAL,
/**
* Let the fragment through if the incoming
* alpha value is greater than the reference alpha value
*/
GREATER,
/**
* Let the fragment through if the incoming
* alpha value does not equal the reference alpha value
*/
NOTEQUAL,
/**
* Let the fragment through if the incoming
* alpha value is greater than or equal to the reference alpha value.
*/
GEQUAL,
/**
* Always let the fragment through.
*/
ALWAYS,
}
/**
* Specifies which faces should be culled. This can be set on a
* pipeline using cogl_pipeline_set_cull_face_mode().
*/
enum PipelineCullFaceMode {
/**
* Neither face will be
* culled. This is the default.
*/
NONE,
/**
* Front faces will be culled.
*/
FRONT,
/**
* Back faces will be culled.
*/
BACK,
/**
* All faces will be culled.
*/
BOTH,
}
/**
* Texture filtering is used whenever the current pixel maps either to more
* than one texture element (texel) or less than one. These filter enums
* correspond to different strategies used to come up with a pixel color, by
* possibly referring to multiple neighbouring texels and taking a weighted
* average or simply using the nearest texel.
*/
enum PipelineFilter {
/**
* Measuring in manhatten distance from the,
* current pixel center, use the nearest texture texel
*/
NEAREST,
/**
* Use the weighted average of the 4 texels
* nearest the current pixel center
*/
LINEAR,
/**
* Select the mimap level whose
* texel size most closely matches the current pixel, and use the
* %COGL_PIPELINE_FILTER_NEAREST criterion
*/
NEAREST_MIPMAP_NEAREST,
/**
* Select the mimap level whose
* texel size most closely matches the current pixel, and use the
* %COGL_PIPELINE_FILTER_LINEAR criterion
*/
LINEAR_MIPMAP_NEAREST,
/**
* Select the two mimap levels
* whose texel size most closely matches the current pixel, use
* the %COGL_PIPELINE_FILTER_NEAREST criterion on each one and take
* their weighted average
*/
NEAREST_MIPMAP_LINEAR,
/**
* Select the two mimap levels
* whose texel size most closely matches the current pixel, use
* the %COGL_PIPELINE_FILTER_LINEAR criterion on each one and take
* their weighted average
*/
LINEAR_MIPMAP_LINEAR,
}
/**
* The wrap mode specifies what happens when texture coordinates
* outside the range 0→1 are used. Note that if the filter mode is
* anything but %COGL_PIPELINE_FILTER_NEAREST then texels outside the
* range 0→1 might be used even when the coordinate is exactly 0 or 1
* because OpenGL will try to sample neighbouring pixels. For example
* if you are trying to render the full texture then you may get
* artifacts around the edges when the pixels from the other side are
* merged in if the wrap mode is set to repeat.
*/
enum PipelineWrapMode {
/**
* The texture will be repeated. This
* is useful for example to draw a tiled background.
*/
REPEAT,
MIRRORED_REPEAT,
/**
* The coordinates outside the
* range 0→1 will sample copies of the edge pixels of the
* texture. This is useful to avoid artifacts if only one copy of
* the texture is being rendered.
*/
CLAMP_TO_EDGE,
/**
* Cogl will try to automatically
* decide which of the above two to use. For cogl_rectangle(), it
* will use repeat mode if any of the texture coordinates are
* outside the range 0→1, otherwise it will use clamp to edge. For
* cogl_polygon() it will always use repeat mode. For
* cogl_vertex_buffer_draw() it will use repeat mode except for
* layers that have point sprite coordinate generation enabled. This
* is the default value.
*/
AUTOMATIC,
}
/**
* Pixel formats used by Cogl. For the formats with a byte per
* component, the order of the components specify the order in
* increasing memory addresses. So for example
* %COGL_PIXEL_FORMAT_RGB_888 would have the red component in the
* lowest address, green in the next address and blue after that
* regardless of the endianness of the system.
*
* For the formats with non byte aligned components the component
* order specifies the order within a 16-bit or 32-bit number from
* most significant bit to least significant. So for
* %COGL_PIXEL_FORMAT_RGB_565, the red component would be in bits
* 11-15, the green component would be in 6-11 and the blue component
* would be in 1-5. Therefore the order in memory depends on the
* endianness of the system.
*
* When uploading a texture %COGL_PIXEL_FORMAT_ANY can be used as the
* internal format. Cogl will try to pick the best format to use
* internally and convert the texture data if necessary.
*/
enum PixelFormat {
/**
* Any format
*/
ANY,
/**
* 8 bits alpha mask
*/
A_8,
/**
* RGB, 16 bits
*/
RGB_565,
/**
* RGBA, 16 bits
*/
RGBA_4444,
/**
* RGBA, 16 bits
*/
RGBA_5551,
/**
* Not currently supported
*/
YUV,
/**
* Single luminance component
*/
G_8,
/**
* RG, 16 bits. Note that red-green textures
* are only available if %COGL_FEATURE_ID_TEXTURE_RG is advertised.
* See cogl_texture_set_components() for details.
*/
RG_88,
/**
* RGB, 24 bits
*/
RGB_888,
/**
* BGR, 24 bits
*/
BGR_888,
/**
* RGBA, 32 bits
*/
RGBA_8888,
/**
* BGRA, 32 bits
*/
BGRA_8888,
/**
* ARGB, 32 bits
*/
ARGB_8888,
/**
* ABGR, 32 bits
*/
ABGR_8888,
/**
* RGBA, 32 bits, 10 bpc
*/
RGBA_1010102,
/**
* BGRA, 32 bits, 10 bpc
*/
BGRA_1010102,
/**
* ARGB, 32 bits, 10 bpc
*/
ARGB_2101010,
/**
* ABGR, 32 bits, 10 bpc
*/
ABGR_2101010,
/**
* Premultiplied RGBA, 32 bits
*/
RGBA_8888_PRE,
/**
* Premultiplied BGRA, 32 bits
*/
BGRA_8888_PRE,
/**
* Premultiplied ARGB, 32 bits
*/
ARGB_8888_PRE,
/**
* Premultiplied ABGR, 32 bits
*/
ABGR_8888_PRE,
/**
* Premultiplied RGBA, 16 bits
*/
RGBA_4444_PRE,
/**
* Premultiplied RGBA, 16 bits
*/
RGBA_5551_PRE,
/**
* Premultiplied RGBA, 32 bits, 10 bpc
*/
RGBA_1010102_PRE,
/**
* Premultiplied BGRA, 32 bits, 10 bpc
*/
BGRA_1010102_PRE,
/**
* Premultiplied ARGB, 32 bits, 10 bpc
*/
ARGB_2101010_PRE,
/**
* Premultiplied ABGR, 32 bits, 10 bpc
*/
ABGR_2101010_PRE,
DEPTH_16,
DEPTH_32,
DEPTH_24_STENCIL_8,
}
/**
* A bitmask of events that Cogl may need to wake on for a file
* descriptor. Note that these all have the same values as the
* corresponding defines for the poll function call on Unix so they
* may be directly passed to poll.
*/
enum PollFDEvent {
/**
* there is data to read
*/
IN,
/**
* data can be written (without blocking)
*/
PRI,
/**
* there is urgent data to read.
*/
OUT,
/**
* error condition
*/
ERR,
/**
* hung up (the connection has been broken, usually
* for pipes and sockets).
*/
HUP,
/**
* invalid request. The file descriptor is not open.
*/
NVAL,
}
enum RendererError {
XLIB_DISPLAY_OPEN,
BAD_CONSTRAINT,
}
enum ShaderType {
VERTEX,
FRAGMENT,
}
/**
* #CoglSnippetHook is used to specify a location within a
* #CoglPipeline where the code of the snippet should be used when it
* is attached to a pipeline.
*
* <glosslist>
* <glossentry>
* <glossterm>%COGL_SNIPPET_HOOK_VERTEX_GLOBALS</glossterm>
* <glossdef>
* <para>
* Adds a shader snippet at the beginning of the global section of the
* shader for the vertex processing. Any declarations here can be
* shared with all other snippets that are attached to a vertex hook.
* Only the ‘declarations’ string is used and the other strings are
* ignored.
* </para>
* </glossdef>
* </glossentry>
* <glossentry>
* <glossterm>%COGL_SNIPPET_HOOK_FRAGMENT_GLOBALS</glossterm>
* <glossdef>
* <para>
* Adds a shader snippet at the beginning of the global section of the
* shader for the fragment processing. Any declarations here can be
* shared with all other snippets that are attached to a fragment
* hook. Only the ‘declarations’ string is used and the other strings
* are ignored.
* </para>
* </glossdef>
* </glossentry>
* <glossentry>
* <glossterm>%COGL_SNIPPET_HOOK_VERTEX</glossterm>
* <glossdef>
* <para>
* Adds a shader snippet that will hook on to the vertex processing
* stage of the pipeline. This gives a chance for the application to
* modify the vertex attributes generated by the shader. Typically the
* snippet will modify cogl_color_out or cogl_position_out builtins.
* </para>
* <para>
* The ‘declarations’ string in `snippet` will be inserted in the
* global scope of the shader. Use this to declare any uniforms,
* attributes or functions that the snippet requires.
* </para>
* <para>
* The ‘pre’ string in `snippet` will be inserted at the top of the
* main() function before any vertex processing is done.
* </para>
* <para>
* The ‘replace’ string in `snippet` will be used instead of the
* generated vertex processing if it is present. This can be used if
* the application wants to provide a complete vertex shader and
* doesn't need the generated output from Cogl.
* </para>
* <para>
* The ‘post’ string in `snippet` will be inserted after all of the
* standard vertex processing is done. This can be used to modify the
* outputs.
* </para>
* </glossdef>
* </glossentry>
* <glossentry>
* <glossterm>%COGL_SNIPPET_HOOK_VERTEX_TRANSFORM</glossterm>
* <glossdef>
* <para>
* Adds a shader snippet that will hook on to the vertex transform stage.
* Typically the snippet will use the cogl_modelview_matrix,
* cogl_projection_matrix and cogl_modelview_projection_matrix matrices and the
* cogl_position_in attribute. The hook must write to cogl_position_out.
* The default processing for this hook will multiply cogl_position_in by
* the combined modelview-projection matrix and store it on cogl_position_out.
* </para>
* <para>
* The ‘declarations’ string in `snippet` will be inserted in the
* global scope of the shader. Use this to declare any uniforms,
* attributes or functions that the snippet requires.
* </para>
* <para>
* The ‘pre’ string in `snippet` will be inserted at the top of the
* main() function before the vertex transform is done.
* </para>
* <para>
* The ‘replace’ string in `snippet` will be used instead of the
* generated vertex transform if it is present.
* </para>
* <para>
* The ‘post’ string in `snippet` will be inserted after all of the
* standard vertex transformation is done. This can be used to modify the
* cogl_position_out in addition to the default processing.
* </para>
* </glossdef>
* </glossentry>
* <glossentry>
* <glossterm>%COGL_SNIPPET_HOOK_POINT_SIZE</glossterm>
* <glossdef>
* <para>
* Adds a shader snippet that will hook on to the point size
* calculation step within the vertex shader stage. The snippet should
* write to the builtin cogl_point_size_out with the new point size.
* The snippet can either read cogl_point_size_in directly and write a
* new value or first read an existing value in cogl_point_size_out
* that would be set by a previous snippet. Note that this hook is
* only used if cogl_pipeline_set_per_vertex_point_size() is enabled
* on the pipeline.
* </para>
* <para>
* The ‘declarations’ string in `snippet` will be inserted in the
* global scope of the shader. Use this to declare any uniforms,
* attributes or functions that the snippet requires.
* </para>
* <para>
* The ‘pre’ string in `snippet` will be inserted just before
* calculating the point size.
* </para>
* <para>
* The ‘replace’ string in `snippet` will be used instead of the
* generated point size calculation if it is present.
* </para>
* <para>
* The ‘post’ string in `snippet` will be inserted after the
* standard point size calculation is done. This can be used to modify
* cogl_point_size_out in addition to the default processing.
* </para>
* </glossdef>
* </glossentry>
* <glossentry>
* <glossterm>%COGL_SNIPPET_HOOK_FRAGMENT</glossterm>
* <glossdef>
* <para>
* Adds a shader snippet that will hook on to the fragment processing
* stage of the pipeline. This gives a chance for the application to
* modify the fragment color generated by the shader. Typically the
* snippet will modify cogl_color_out.
* </para>
* <para>
* The ‘declarations’ string in `snippet` will be inserted in the
* global scope of the shader. Use this to declare any uniforms,
* attributes or functions that the snippet requires.
* </para>
* <para>
* The ‘pre’ string in `snippet` will be inserted at the top of the
* main() function before any fragment processing is done.
* </para>
* <para>
* The ‘replace’ string in `snippet` will be used instead of the
* generated fragment processing if it is present. This can be used if
* the application wants to provide a complete fragment shader and
* doesn't need the generated output from Cogl.
* </para>
* <para>
* The ‘post’ string in `snippet` will be inserted after all of the
* standard fragment processing is done. At this point the generated
* value for the rest of the pipeline state will already be in
* cogl_color_out so the application can modify the result by altering
* this variable.
* </para>
* </glossdef>
* </glossentry>
* <glossentry>
* <glossterm>%COGL_SNIPPET_HOOK_TEXTURE_COORD_TRANSFORM</glossterm>
* <glossdef>
* <para>
* Adds a shader snippet that will hook on to the texture coordinate
* transformation of a particular layer. This can be used to replace
* the processing for a layer or to modify the results.
* </para>
* <para>
* Within the snippet code for this hook there are two extra
* variables. The first is a mat4 called cogl_matrix which represents
* the user matrix for this layer. The second is called cogl_tex_coord
* and represents the incoming and outgoing texture coordinate. On
* entry to the hook, cogl_tex_coord contains the value of the
* corresponding texture coordinate attribute for this layer. The hook
* is expected to modify this variable. The output will be passed as a
* varying to the fragment processing stage. The default code will
* just multiply cogl_matrix by cogl_tex_coord and store the result in
* cogl_tex_coord.
* </para>