@defold-typescript/types 0.8.4 → 0.9.0
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 +1 -1
- package/api-targets.json +18 -0
- package/generated/b2d_body.d.ts +348 -0
- package/generated/buffer.d.ts +3 -0
- package/generated/camera.d.ts +236 -1
- package/generated/collectionfactory.d.ts +4 -0
- package/generated/factory.d.ts +4 -0
- package/generated/font.d.ts +81 -0
- package/generated/go.d.ts +53 -0
- package/generated/gui.d.ts +264 -49
- package/generated/html5.d.ts +17 -13
- package/generated/http.d.ts +16 -0
- package/generated/image.d.ts +24 -0
- package/generated/json.d.ts +2 -0
- package/generated/kinds/gui-script.d.ts +2 -0
- package/generated/kinds/render-script.d.ts +2 -0
- package/generated/kinds/script.d.ts +2 -0
- package/generated/model.d.ts +14 -0
- package/generated/msg.d.ts +17 -11
- package/generated/particlefx.d.ts +6 -0
- package/generated/physics.d.ts +32 -0
- package/generated/profiler.d.ts +14 -0
- package/generated/render.d.ts +109 -0
- package/generated/resource.d.ts +223 -0
- package/generated/socket.d.ts +4 -0
- package/generated/sound.d.ts +6 -0
- package/generated/sprite.d.ts +5 -0
- package/generated/sys.d.ts +136 -0
- package/generated/tilemap.d.ts +2 -0
- package/generated/timer.d.ts +3 -0
- package/generated/vmath.d.ts +109 -93
- package/generated/window.d.ts +23 -0
- package/index.d.ts +7 -0
- package/package.json +1 -1
- package/scripts/fidelity-baseline.json +18 -2
- package/scripts/regen.ts +4 -0
- package/scripts/signature-store-io.ts +18 -0
- package/scripts/sync-api-docs.ts +208 -12
- package/src/core-types.ts +4 -2
- package/src/doc-comment.ts +42 -5
- package/src/engine-globals.d.ts +2 -0
- package/src/example-store.ts +11 -7
- package/src/index.ts +18 -1
- package/src/msg-overloads.d.ts +3 -0
- package/src/signature-store.ts +20 -0
package/generated/render.d.ts
CHANGED
|
@@ -5,9 +5,11 @@ declare global {
|
|
|
5
5
|
/**
|
|
6
6
|
* Rendering functions, messages and constants. The "render" namespace is
|
|
7
7
|
* accessible only from render scripts.
|
|
8
|
+
*
|
|
8
9
|
* The rendering API was originally built on top of OpenGL ES 2.0, and it uses a subset of the
|
|
9
10
|
* OpenGL computer graphics rendering API for rendering 2D and 3D computer
|
|
10
11
|
* graphics. Our current target is OpenGLES 3.0 with fallbacks to 2.0 on some platforms.
|
|
12
|
+
*
|
|
11
13
|
* [icon:attention] It is possible to create materials and write shaders that
|
|
12
14
|
* require features not in OpenGL ES 2.0, but those will not work cross platform.
|
|
13
15
|
*/
|
|
@@ -35,8 +37,11 @@ declare global {
|
|
|
35
37
|
* color attachments, all buffers will be cleared with the same value.
|
|
36
38
|
*
|
|
37
39
|
* @param buffers - table with keys specifying which buffers to clear and values set to clear values. Available keys are:
|
|
40
|
+
*
|
|
38
41
|
* - `graphics.BUFFER_TYPE_COLOR0_BIT`
|
|
42
|
+
*
|
|
39
43
|
* - `graphics.BUFFER_TYPE_DEPTH_BIT`
|
|
44
|
+
*
|
|
40
45
|
* - `graphics.BUFFER_TYPE_STENCIL_BIT`
|
|
41
46
|
* @example
|
|
42
47
|
* ```ts
|
|
@@ -112,11 +117,17 @@ declare global {
|
|
|
112
117
|
* Disables a render state.
|
|
113
118
|
*
|
|
114
119
|
* @param state - state to disable
|
|
120
|
+
*
|
|
115
121
|
* - `graphics.STATE_DEPTH_TEST`
|
|
122
|
+
*
|
|
116
123
|
* - `graphics.STATE_STENCIL_TEST`
|
|
124
|
+
*
|
|
117
125
|
* - `graphics.STATE_BLEND`
|
|
126
|
+
*
|
|
118
127
|
* - `graphics.STATE_ALPHA_TEST` ( not available on iOS and Android)
|
|
128
|
+
*
|
|
119
129
|
* - `graphics.STATE_CULL_FACE`
|
|
130
|
+
*
|
|
120
131
|
* - `graphics.STATE_POLYGON_OFFSET_FILL`
|
|
121
132
|
* @example
|
|
122
133
|
* ```ts
|
|
@@ -156,6 +167,7 @@ declare global {
|
|
|
156
167
|
* @param y - global work group size Y
|
|
157
168
|
* @param z - global work group size Z
|
|
158
169
|
* @param options - optional table with properties:
|
|
170
|
+
*
|
|
159
171
|
* `constants`
|
|
160
172
|
* constant_buffer optional constants to use while rendering
|
|
161
173
|
* @example
|
|
@@ -196,12 +208,16 @@ declare global {
|
|
|
196
208
|
*
|
|
197
209
|
* @param predicate - predicate to draw for
|
|
198
210
|
* @param options - optional table with properties:
|
|
211
|
+
*
|
|
199
212
|
* `frustum`
|
|
200
213
|
* matrix4 A frustum matrix used to cull renderable items. (E.g. `local frustum = proj * view`). default=nil
|
|
201
214
|
* `frustum_planes`
|
|
202
215
|
* int Determines which sides of the frustum will be used. Default is render.FRUSTUM_PLANES_SIDES.
|
|
216
|
+
*
|
|
203
217
|
* - render.FRUSTUM_PLANES_SIDES : The left, right, top and bottom sides of the frustum.
|
|
218
|
+
*
|
|
204
219
|
* - render.FRUSTUM_PLANES_ALL : All 6 sides of the frustum.
|
|
220
|
+
*
|
|
205
221
|
* `constants`
|
|
206
222
|
* constant_buffer optional constants to use while rendering
|
|
207
223
|
* `sort_order`
|
|
@@ -239,11 +255,14 @@ declare global {
|
|
|
239
255
|
* Draws all 3d debug graphics such as lines drawn with "draw_line" messages and physics visualization.
|
|
240
256
|
*
|
|
241
257
|
* @param options - optional table with properties:
|
|
258
|
+
*
|
|
242
259
|
* `frustum`
|
|
243
260
|
* matrix4 A frustum matrix used to cull renderable items. (E.g. `local frustum = proj * view`). May be nil.
|
|
244
261
|
* `frustum_planes`
|
|
245
262
|
* int Determines which sides of the frustum will be used. Default is render.FRUSTUM_PLANES_SIDES.
|
|
263
|
+
*
|
|
246
264
|
* - render.FRUSTUM_PLANES_SIDES : The left, right, top and bottom sides of the frustum.
|
|
265
|
+
*
|
|
247
266
|
* - render.FRUSTUM_PLANES_ALL : All sides of the frustum.
|
|
248
267
|
* @example
|
|
249
268
|
* ```ts
|
|
@@ -276,11 +295,17 @@ declare global {
|
|
|
276
295
|
* Enables a particular render state. The state will be enabled until disabled.
|
|
277
296
|
*
|
|
278
297
|
* @param state - state to enable
|
|
298
|
+
*
|
|
279
299
|
* - `graphics.STATE_DEPTH_TEST`
|
|
300
|
+
*
|
|
280
301
|
* - `graphics.STATE_STENCIL_TEST`
|
|
302
|
+
*
|
|
281
303
|
* - `graphics.STATE_BLEND`
|
|
304
|
+
*
|
|
282
305
|
* - `graphics.STATE_ALPHA_TEST` ( not available on iOS and Android)
|
|
306
|
+
*
|
|
283
307
|
* - `graphics.STATE_CULL_FACE`
|
|
308
|
+
*
|
|
284
309
|
* - `graphics.STATE_POLYGON_OFFSET_FILL`
|
|
285
310
|
* @example
|
|
286
311
|
* ```ts
|
|
@@ -307,15 +332,24 @@ declare global {
|
|
|
307
332
|
* @param binding - texture binding, either by texture unit, string or hash for the sampler name that the texture should be bound to
|
|
308
333
|
* @param handle_or_name - render target or texture handle that should be bound, or a named resource in the "Render Resource" table in the currently assigned .render file
|
|
309
334
|
* @param buffer_type - optional buffer type from which to enable the texture. Note that this argument only applies to render targets. Defaults to `graphics.BUFFER_TYPE_COLOR0_BIT`. These values are supported:
|
|
335
|
+
*
|
|
310
336
|
* - `graphics.BUFFER_TYPE_COLOR0_BIT`
|
|
337
|
+
*
|
|
311
338
|
* If The render target has been created as depth and/or stencil textures, these buffer types can be used:
|
|
339
|
+
*
|
|
312
340
|
* - `graphics.BUFFER_TYPE_DEPTH_BIT`
|
|
341
|
+
*
|
|
313
342
|
* - `graphics.BUFFER_TYPE_STENCIL_BIT`
|
|
343
|
+
*
|
|
314
344
|
* If the render target has been created with multiple color attachments, these buffer types can be used
|
|
315
345
|
* to enable those textures as well. Currently 4 color attachments are supported:
|
|
346
|
+
*
|
|
316
347
|
* - `graphics.BUFFER_TYPE_COLOR0_BIT`
|
|
348
|
+
*
|
|
317
349
|
* - `graphics.BUFFER_TYPE_COLOR1_BIT`
|
|
350
|
+
*
|
|
318
351
|
* - `graphics.BUFFER_TYPE_COLOR2_BIT`
|
|
352
|
+
*
|
|
319
353
|
* - `graphics.BUFFER_TYPE_COLOR3_BIT`
|
|
320
354
|
* @example
|
|
321
355
|
* ```ts
|
|
@@ -381,8 +415,11 @@ declare global {
|
|
|
381
415
|
*
|
|
382
416
|
* @param render_target - render target from which to retrieve the buffer height
|
|
383
417
|
* @param buffer_type - which type of buffer to retrieve the height from
|
|
418
|
+
*
|
|
384
419
|
* - `graphics.BUFFER_TYPE_COLOR0_BIT`
|
|
420
|
+
*
|
|
385
421
|
* - `graphics.BUFFER_TYPE_DEPTH_BIT`
|
|
422
|
+
*
|
|
386
423
|
* - `graphics.BUFFER_TYPE_STENCIL_BIT`
|
|
387
424
|
* @returns the height of the render target buffer texture
|
|
388
425
|
* @example
|
|
@@ -399,9 +436,13 @@ declare global {
|
|
|
399
436
|
*
|
|
400
437
|
* @param render_target - render target from which to retrieve the buffer width
|
|
401
438
|
* @param buffer_type - which type of buffer to retrieve the width from
|
|
439
|
+
*
|
|
402
440
|
* - `graphics.BUFFER_TYPE_COLOR0_BIT`
|
|
441
|
+
*
|
|
403
442
|
* - `graphics.BUFFER_TYPE_COLOR[x]_BIT` (x: [0..3], if supported!)
|
|
443
|
+
*
|
|
404
444
|
* - `graphics.BUFFER_TYPE_DEPTH_BIT`
|
|
445
|
+
*
|
|
405
446
|
* - `graphics.BUFFER_TYPE_STENCIL_BIT`
|
|
406
447
|
* @returns the width of the render target buffer texture
|
|
407
448
|
* @example
|
|
@@ -475,8 +516,10 @@ declare global {
|
|
|
475
516
|
* The table should contain keys specifying which buffers should be created
|
|
476
517
|
* with what parameters. Each buffer key should have a table value consisting
|
|
477
518
|
* of parameters. The following parameter keys are available:
|
|
519
|
+
*
|
|
478
520
|
* Key
|
|
479
521
|
* Values
|
|
522
|
+
*
|
|
480
523
|
* `format`
|
|
481
524
|
* `graphics.TEXTURE_FORMAT_LUMINANCE`
|
|
482
525
|
* `graphics.TEXTURE_FORMAT_RGB`
|
|
@@ -485,33 +528,42 @@ declare global {
|
|
|
485
528
|
* `graphics.TEXTURE_FORMAT_STENCIL`
|
|
486
529
|
* `graphics.TEXTURE_FORMAT_RGBA32F`
|
|
487
530
|
* `graphics.TEXTURE_FORMAT_RGBA16F`
|
|
531
|
+
*
|
|
488
532
|
* `width`
|
|
489
533
|
* number
|
|
534
|
+
*
|
|
490
535
|
* `height`
|
|
491
536
|
* number
|
|
537
|
+
*
|
|
492
538
|
* `min_filter` (optional)
|
|
493
539
|
* `graphics.TEXTURE_FILTER_LINEAR`
|
|
494
540
|
* `graphics.TEXTURE_FILTER_NEAREST`
|
|
541
|
+
*
|
|
495
542
|
* `mag_filter` (optional)
|
|
496
543
|
* `graphics.TEXTURE_FILTER_LINEAR`
|
|
497
544
|
* `graphics.TEXTURE_FILTER_NEAREST`
|
|
545
|
+
*
|
|
498
546
|
* `u_wrap` (optional)
|
|
499
547
|
* `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
500
548
|
* `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
501
549
|
* `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
502
550
|
* `graphics.TEXTURE_WRAP_REPEAT`
|
|
551
|
+
*
|
|
503
552
|
* `v_wrap` (optional)
|
|
504
553
|
* `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
505
554
|
* `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
506
555
|
* `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
507
556
|
* `graphics.TEXTURE_WRAP_REPEAT`
|
|
557
|
+
*
|
|
508
558
|
* `flags` (optional)
|
|
509
559
|
* `render.TEXTURE_BIT` (only applicable to depth and stencil buffers)
|
|
560
|
+
*
|
|
510
561
|
* The render target can be created to support multiple color attachments. Each attachment can have different format settings and texture filters,
|
|
511
562
|
* but attachments must be added in sequence, meaning you cannot create a render target at slot 0 and 3.
|
|
512
563
|
* Instead it has to be created with all four buffer types ranging from [0..3] (as denoted by graphics.BUFFER_TYPE_COLORX_BIT where 'X' is the attachment you want to create).
|
|
513
564
|
* It is not guaranteed that the device running the script can support creating render targets with multiple color attachments. To check if the device can support multiple attachments,
|
|
514
565
|
* you can check if the `render` table contains any of the `BUFFER_TYPE_COLOR1_BIT`, `BUFFER_TYPE_COLOR2_BIT` or `BUFFER_TYPE_COLOR3_BIT` constants:
|
|
566
|
+
*
|
|
515
567
|
* `function init(self)
|
|
516
568
|
* if graphics.BUFFER_TYPE_COLOR1_BIT == nil then
|
|
517
569
|
* -- this devices does not support multiple color attachments
|
|
@@ -621,43 +673,65 @@ declare global {
|
|
|
621
673
|
* The destination scale factor is referred to as (dR,dG,dB,dA).
|
|
622
674
|
* The color values have integer values between 0 and (kR,kG,kB,kA), where kc = 2mc - 1 and mc is the number of bitplanes for that color. I.e for 8 bit color depth, color values are between `0` and `255`.
|
|
623
675
|
* Available factor constants and corresponding scale factors:
|
|
676
|
+
*
|
|
624
677
|
* Factor constant
|
|
625
678
|
* Scale factor (fR,fG,fB,fA)
|
|
679
|
+
*
|
|
626
680
|
* `graphics.BLEND_FACTOR_ZERO`
|
|
627
681
|
* (0,0,0,0)
|
|
682
|
+
*
|
|
628
683
|
* `graphics.BLEND_FACTOR_ONE`
|
|
629
684
|
* (1,1,1,1)
|
|
685
|
+
*
|
|
630
686
|
* `graphics.BLEND_FACTOR_SRC_COLOR`
|
|
631
687
|
* (Rs/kR,Gs/kG,Bs/kB,As/kA)
|
|
688
|
+
*
|
|
632
689
|
* `graphics.BLEND_FACTOR_ONE_MINUS_SRC_COLOR`
|
|
633
690
|
* (1,1,1,1) - (Rs/kR,Gs/kG,Bs/kB,As/kA)
|
|
691
|
+
*
|
|
634
692
|
* `graphics.BLEND_FACTOR_DST_COLOR`
|
|
635
693
|
* (Rd/kR,Gd/kG,Bd/kB,Ad/kA)
|
|
694
|
+
*
|
|
636
695
|
* `graphics.BLEND_FACTOR_ONE_MINUS_DST_COLOR`
|
|
637
696
|
* (1,1,1,1) - (Rd/kR,Gd/kG,Bd/kB,Ad/kA)
|
|
697
|
+
*
|
|
638
698
|
* `graphics.BLEND_FACTOR_SRC_ALPHA`
|
|
639
699
|
* (As/kA,As/kA,As/kA,As/kA)
|
|
700
|
+
*
|
|
640
701
|
* `graphics.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA`
|
|
641
702
|
* (1,1,1,1) - (As/kA,As/kA,As/kA,As/kA)
|
|
703
|
+
*
|
|
642
704
|
* `graphics.BLEND_FACTOR_DST_ALPHA`
|
|
643
705
|
* (Ad/kA,Ad/kA,Ad/kA,Ad/kA)
|
|
706
|
+
*
|
|
644
707
|
* `graphics.BLEND_FACTOR_ONE_MINUS_DST_ALPHA`
|
|
645
708
|
* (1,1,1,1) - (Ad/kA,Ad/kA,Ad/kA,Ad/kA)
|
|
709
|
+
*
|
|
646
710
|
* `graphics.BLEND_FACTOR_CONSTANT_COLOR`
|
|
647
711
|
* (Rc,Gc,Bc,Ac)
|
|
712
|
+
*
|
|
648
713
|
* `graphics.BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR`
|
|
649
714
|
* (1,1,1,1) - (Rc,Gc,Bc,Ac)
|
|
715
|
+
*
|
|
650
716
|
* `graphics.BLEND_FACTOR_CONSTANT_ALPHA`
|
|
651
717
|
* (Ac,Ac,Ac,Ac)
|
|
718
|
+
*
|
|
652
719
|
* `graphics.BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA`
|
|
653
720
|
* (1,1,1,1) - (Ac,Ac,Ac,Ac)
|
|
721
|
+
*
|
|
654
722
|
* `graphics.BLEND_FACTOR_SRC_ALPHA_SATURATE`
|
|
655
723
|
* (i,i,i,1) where i = min(As, kA - Ad) /kA
|
|
724
|
+
*
|
|
656
725
|
* The blended RGBA values of a pixel comes from the following equations:
|
|
726
|
+
*
|
|
657
727
|
* - Rd = min(kR, Rs * sR + Rd * dR)
|
|
728
|
+
*
|
|
658
729
|
* - Gd = min(kG, Gs * sG + Gd * dG)
|
|
730
|
+
*
|
|
659
731
|
* - Bd = min(kB, Bs * sB + Bd * dB)
|
|
732
|
+
*
|
|
660
733
|
* - Ad = min(kA, As * sA + Ad * dA)
|
|
734
|
+
*
|
|
661
735
|
* Blend function `(graphics.BLEND_FACTOR_SRC_ALPHA, graphics.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA)` is useful for
|
|
662
736
|
* drawing with transparency when the drawn objects are sorted from farthest to nearest.
|
|
663
737
|
* It is also useful for drawing antialiased points and lines in arbitrary order.
|
|
@@ -682,6 +756,7 @@ declare global {
|
|
|
682
756
|
*
|
|
683
757
|
* @param camera - camera id to use, or nil to reset
|
|
684
758
|
* @param options - optional table with properties:
|
|
759
|
+
*
|
|
685
760
|
* `use_frustum`
|
|
686
761
|
* boolean If true, the renderer will use the cameras view-projection matrix for frustum culling (default: false)
|
|
687
762
|
* @example
|
|
@@ -739,8 +814,11 @@ declare global {
|
|
|
739
814
|
* `face_type` is `graphics.FACE_TYPE_BACK`.
|
|
740
815
|
*
|
|
741
816
|
* @param face_type - face type
|
|
817
|
+
*
|
|
742
818
|
* - `graphics.FACE_TYPE_FRONT`
|
|
819
|
+
*
|
|
743
820
|
* - `graphics.FACE_TYPE_BACK`
|
|
821
|
+
*
|
|
744
822
|
* - `graphics.FACE_TYPE_FRONT_AND_BACK`
|
|
745
823
|
* @example
|
|
746
824
|
* ```ts
|
|
@@ -756,14 +834,23 @@ declare global {
|
|
|
756
834
|
* The comparison is performed only if depth testing is enabled and specifies
|
|
757
835
|
* the conditions under which a pixel will be drawn.
|
|
758
836
|
* Function constants:
|
|
837
|
+
*
|
|
759
838
|
* - `graphics.COMPARE_FUNC_NEVER` (never passes)
|
|
839
|
+
*
|
|
760
840
|
* - `graphics.COMPARE_FUNC_LESS` (passes if the incoming depth value is less than the stored value)
|
|
841
|
+
*
|
|
761
842
|
* - `graphics.COMPARE_FUNC_LEQUAL` (passes if the incoming depth value is less than or equal to the stored value)
|
|
843
|
+
*
|
|
762
844
|
* - `graphics.COMPARE_FUNC_GREATER` (passes if the incoming depth value is greater than the stored value)
|
|
845
|
+
*
|
|
763
846
|
* - `graphics.COMPARE_FUNC_GEQUAL` (passes if the incoming depth value is greater than or equal to the stored value)
|
|
847
|
+
*
|
|
764
848
|
* - `graphics.COMPARE_FUNC_EQUAL` (passes if the incoming depth value is equal to the stored value)
|
|
849
|
+
*
|
|
765
850
|
* - `graphics.COMPARE_FUNC_NOTEQUAL` (passes if the incoming depth value is not equal to the stored value)
|
|
851
|
+
*
|
|
766
852
|
* - `graphics.COMPARE_FUNC_ALWAYS` (always passes)
|
|
853
|
+
*
|
|
767
854
|
* The depth function is initially set to `graphics.COMPARE_FUNC_LESS`.
|
|
768
855
|
*
|
|
769
856
|
* @param func - depth test function, see the description for available values
|
|
@@ -796,6 +883,7 @@ declare global {
|
|
|
796
883
|
*
|
|
797
884
|
* @param callback - A callback that receives all render related events.
|
|
798
885
|
* Pass `nil` if want to remove listener.
|
|
886
|
+
*
|
|
799
887
|
* `self`
|
|
800
888
|
* object The render script
|
|
801
889
|
* `event_type`
|
|
@@ -865,12 +953,16 @@ declare global {
|
|
|
865
953
|
*
|
|
866
954
|
* @param render_target - render target to set. render.RENDER_TARGET_DEFAULT to set the default render target
|
|
867
955
|
* @param options - optional table with behaviour parameters
|
|
956
|
+
*
|
|
868
957
|
* `transient`
|
|
869
958
|
* table Transient frame buffer types are only valid while the render target is active, i.e becomes undefined when a new target is set by a subsequent call to set_render_target.
|
|
870
959
|
* Default is all non-transient. Be aware that some hardware uses a combined depth stencil buffer and when this is the case both are considered non-transient if exclusively selected!
|
|
871
960
|
* A buffer type defined that doesn't exist in the render target is silently ignored.
|
|
961
|
+
*
|
|
872
962
|
* - `graphics.BUFFER_TYPE_COLOR0_BIT`
|
|
963
|
+
*
|
|
873
964
|
* - `graphics.BUFFER_TYPE_DEPTH_BIT`
|
|
965
|
+
*
|
|
874
966
|
* - `graphics.BUFFER_TYPE_STENCIL_BIT`
|
|
875
967
|
* @example
|
|
876
968
|
* ```ts
|
|
@@ -937,13 +1029,21 @@ declare global {
|
|
|
937
1029
|
* `mask` is ANDed with both the reference value and the stored stencil value when the test
|
|
938
1030
|
* is done. The initial value is all `1`'s.
|
|
939
1031
|
* Function constant:
|
|
1032
|
+
*
|
|
940
1033
|
* - `graphics.COMPARE_FUNC_NEVER` (never passes)
|
|
1034
|
+
*
|
|
941
1035
|
* - `graphics.COMPARE_FUNC_LESS` (passes if (ref & mask) < (stencil & mask))
|
|
1036
|
+
*
|
|
942
1037
|
* - `graphics.COMPARE_FUNC_LEQUAL` (passes if (ref & mask) <= (stencil & mask))
|
|
1038
|
+
*
|
|
943
1039
|
* - `graphics.COMPARE_FUNC_GREATER` (passes if (ref & mask) > (stencil & mask))
|
|
1040
|
+
*
|
|
944
1041
|
* - `graphics.COMPARE_FUNC_GEQUAL` (passes if (ref & mask) >= (stencil & mask))
|
|
1042
|
+
*
|
|
945
1043
|
* - `graphics.COMPARE_FUNC_EQUAL` (passes if (ref & mask) = (stencil & mask))
|
|
1044
|
+
*
|
|
946
1045
|
* - `graphics.COMPARE_FUNC_NOTEQUAL` (passes if (ref & mask) != (stencil & mask))
|
|
1046
|
+
*
|
|
947
1047
|
* - `graphics.COMPARE_FUNC_ALWAYS` (always passes)
|
|
948
1048
|
*
|
|
949
1049
|
* @param func - stencil test function, see the description for available values
|
|
@@ -982,14 +1082,23 @@ declare global {
|
|
|
982
1082
|
* pixel's color or depth buffers, and `sfail` specifies what happens to the stencil buffer
|
|
983
1083
|
* contents.
|
|
984
1084
|
* Operator constants:
|
|
1085
|
+
*
|
|
985
1086
|
* - `graphics.STENCIL_OP_KEEP` (keeps the current value)
|
|
1087
|
+
*
|
|
986
1088
|
* - `graphics.STENCIL_OP_ZERO` (sets the stencil buffer value to 0)
|
|
1089
|
+
*
|
|
987
1090
|
* - `graphics.STENCIL_OP_REPLACE` (sets the stencil buffer value to `ref`, as specified by render.set_stencil_func)
|
|
1091
|
+
*
|
|
988
1092
|
* - `graphics.STENCIL_OP_INCR` (increments the stencil buffer value and clamp to the maximum representable unsigned value)
|
|
1093
|
+
*
|
|
989
1094
|
* - `graphics.STENCIL_OP_INCR_WRAP` (increments the stencil buffer value and wrap to zero when incrementing the maximum representable unsigned value)
|
|
1095
|
+
*
|
|
990
1096
|
* - `graphics.STENCIL_OP_DECR` (decrements the current stencil buffer value and clamp to 0)
|
|
1097
|
+
*
|
|
991
1098
|
* - `graphics.STENCIL_OP_DECR_WRAP` (decrements the current stencil buffer value and wrap to the maximum representable unsigned value when decrementing zero)
|
|
1099
|
+
*
|
|
992
1100
|
* - `graphics.STENCIL_OP_INVERT` (bitwise inverts the current stencil buffer value)
|
|
1101
|
+
*
|
|
993
1102
|
* `dppass` and `dpfail` specify the stencil buffer actions depending on whether subsequent
|
|
994
1103
|
* depth buffer tests succeed (dppass) or fail (dpfail).
|
|
995
1104
|
* The initial value for all operators is `graphics.STENCIL_OP_KEEP`.
|