@@ -1732,6 +1732,7 @@ declare module Kiwi {
1732
1732
* @public
1733
1733
*/
1734
1734
public renderOption : number;
1735
+ public bootCallbackOption: Function;
1735
1736
/**
1736
1737
* The type of device that you are targeting. This is either set to COCOON or BROWSER
1737
1738
* @property _deviceTargetOption
@@ -9789,14 +9790,6 @@ declare module Kiwi.Geom {
9789
9790
public toString(): string;
9790
9791
}
9791
9792
}
9792
- declare module Kiwi.Geom {
9793
- class Random {
9794
- static randomPointCirclePerimeter(): Geom.Point;
9795
- static randomPointCircle(): Geom.Point;
9796
- static randomPointSquare(): Geom.Point;
9797
- static randomPointSquarePerimeter(): Geom.Point;
9798
- }
9799
- }
9800
9793
/**
9801
9794
*
9802
9795
* @module Kiwi
@@ -14856,13 +14849,6 @@ declare module Kiwi.Renderers {
14856
14849
*/
14857
14850
private _currentRenderer;
14858
14851
/**
14859
- * Camera offset in pixels from top left.
14860
- * @property _cameraOffset
14861
- * @type Float32Array
14862
- * @private
14863
- */
14864
- private _cameraOffset;
14865
- /**
14866
14852
* Tally of number of entities rendered per frame
14867
14853
* @property _entityCount
14868
14854
* @type number
@@ -14887,13 +14873,7 @@ declare module Kiwi.Renderers {
14887
14873
* @private
14888
14874
*/
14889
14875
private _maxItems;
14890
- /**
14891
- * GL-Matrix.js provided 4x4 matrix used for matrix uniform
14892
- * @property mvMatrix
14893
- * @type Float32Array
14894
- * @public
14895
- */
14896
- public mvMatrix: Float32Array;
14876
+ public camMatrix: Float32Array;
14897
14877
/**
14898
14878
* The most recently bound texture atlas.
14899
14879
* @property _currentTextureAtlas
@@ -14947,14 +14927,6 @@ declare module Kiwi.Renderers {
14947
14927
* @public
14948
14928
*/
14949
14929
public requestRendererInstance(rendererID: string, params?: any): Renderers.Renderer;
14950
- /**
14951
- * Performs initialisation required for single game instance - happens once, at bootup
14952
- * Sets global GL state.
14953
- * Initialises managers for shaders and textures.
14954
- * Instantiates the default shared renderer (TextureAtlasRenderer)
14955
- * @method _init
14956
- * @private
14957
- */
14958
14930
private _init();
14959
14931
/**
14960
14932
* Performs initialisation required when switching to a different state. Called when a state has been switched to.
@@ -14980,34 +14952,15 @@ declare module Kiwi.Renderers {
14980
14952
* @public
14981
14953
*/
14982
14954
public render(camera: Kiwi.Camera): void;
14983
- /**
14984
- * Recursively renders scene graph tree
14985
- * @method _recurse
14986
- * @param gl {WebGLRenderingContext}
14987
- * @param child {IChild}
14988
- * @param camera {Camera}
14989
- * @private
14990
- */
14991
- private _recurse(gl, child, camera);
14992
- /**
14993
- * Processes a single entity for rendering. Ensures that GL state is set up for the entity rendering requirements
14994
- * @method _processEntity
14995
- * is the entity's required renderer active and using the correct shader? If not then flush and re-enable renderer
14996
- * this is to allow the same renderer to use different shaders on different objects - renderer can be configured on a per object basis
14997
- * this needs thorough testing - also the text property lookups may need refactoring
14998
- * @param gl {WebGLRenderingContext}
14999
- * @param entity {Entity}
15000
- * @param camera {Camera}
15001
- * @private
15002
- */
15003
- private _processEntity(gl, entity, camera);
15004
- /**
15005
- * Draws the current batch and clears the renderer ready for another batch.
15006
- * @method _flushBatch
15007
- * @param gl {WebGLRenderingContext}
15008
- * @private
15009
- */
15010
- private _flushBatch(gl);
14955
+ private _sequence;
14956
+ private _batches;
14957
+ public collateRenderSequence(): void;
14958
+ public collateChild(child: Kiwi.IChild): void;
14959
+ public collateBatches(): void;
14960
+ public renderBatches(gl: WebGLRenderingContext, camera: any): void;
14961
+ public renderBatch(gl: WebGLRenderingContext, batch: any, camera: any): void;
14962
+ public renderEntity(gl: WebGLRenderingContext, entity: any, camera: any): void;
14963
+ public setupGLState(gl: WebGLRenderingContext, entity: any): void;
15011
14964
/**
15012
14965
* Switch renderer to the one needed by the entity that needs rendering
15013
14966
* @method _switchRenderer
@@ -15094,7 +15047,7 @@ declare module Kiwi.Shaders {
15094
15047
* @return {ShaderPair} a ShaderPair instance - null on fail
15095
15048
* @public
15096
15049
*/
15097
- public requestShader(gl: WebGLRenderingContext, shaderID: string): Shaders.ShaderPair;
15050
+ public requestShader(gl: WebGLRenderingContext, shaderID: string, use?: boolean ): Shaders.ShaderPair;
15098
15051
/**
15099
15052
* Tests to see if a ShaderPair property named ShaderID exists on Kiwi.Shaders. Can be used to test for the availability of specific shaders (for fallback)
15100
15053
* @method shaderExists
@@ -15481,15 +15434,9 @@ declare module Kiwi.Renderers {
15481
15434
}
15482
15435
declare module Kiwi.Renderers {
15483
15436
class Renderer {
15484
- constructor(gl: WebGLRenderingContext, shaderManager: Kiwi.Shaders.ShaderManager);
15437
+ constructor(gl: WebGLRenderingContext, shaderManager: Kiwi.Shaders.ShaderManager, isBatchRenderer?: boolean );
15485
15438
static RENDERER_ID: string;
15486
- /**
15487
- * GL-Matrix.js provided 4x4 matrix used for matrix uniform
15488
- * @property mvMatrix
15489
- * @type Float32Array
15490
- * @public
15491
- */
15492
- public mvMatrix: Float32Array;
15439
+ public camMatrix: Float32Array;
15493
15440
public loaded: boolean;
15494
15441
public shaderManager: Kiwi.Shaders.ShaderManager;
15495
15442
public enable(gl: WebGLRenderingContext, params?: any): void;
@@ -15498,6 +15445,9 @@ declare module Kiwi.Renderers {
15498
15445
public draw(gl: WebGLRenderingContext): void;
15499
15446
public updateStageResolution(gl: WebGLRenderingContext, res: Float32Array): void;
15500
15447
public updateTextureSize(gl: WebGLRenderingContext, size: Float32Array): void;
15448
+ public shaderPair: Kiwi.Shaders.ShaderPair;
15449
+ private _isBatchRenderer;
15450
+ public isBatchRenderer : boolean;
15501
15451
}
15502
15452
}
15503
15453
/**
@@ -15510,41 +15460,15 @@ declare module Kiwi.Renderers {
15510
15460
class TextureAtlasRenderer extends Renderers.Renderer {
15511
15461
constructor(gl: WebGLRenderingContext, shaderManager: Kiwi.Shaders.ShaderManager, params?: any);
15512
15462
static RENDERER_ID: string;
15463
+ public shaderPair: Kiwi.Shaders.TextureAtlasShader;
15464
+ private _maxItems;
15465
+ private _vertexBuffer;
15466
+ private _indexBuffer;
15513
15467
public enable(gl: WebGLRenderingContext, params?: any): void;
15514
15468
public disable(gl: WebGLRenderingContext): void;
15515
- public shaderPair: Kiwi.Shaders.TextureAtlasShader;
15516
15469
public clear(gl: WebGLRenderingContext, params: any): void;
15517
15470
public draw(gl: WebGLRenderingContext): void;
15518
15471
/**
15519
- * Maximum allowable sprites to render per frame
15520
- * @property _maxItems
15521
- * @type number
15522
- * @default 1000
15523
- * @private
15524
- */
15525
- private _maxItems;
15526
- /**
15527
- * Storage for the xy (position) and uv(texture) coordinates that are generated each frame
15528
- * @property _xyuvBuffer
15529
- * @type GLArrayBuffer
15530
- * @private
15531
- */
15532
- public xyuvBuffer: Renderers.GLArrayBuffer;
15533
- /**
15534
- * Storage for the polygon indices, pre generated to a length based on max items
15535
- * @property _indexBuffer
15536
- * @type GLElementArrayBuffer
15537
- * @private
15538
- */
15539
- public indexBuffer: Renderers.GLElementArrayBuffer;
15540
- /**
15541
- * Storage for alpha values for each vertex on a sprite
15542
- * @property _alphaBuffer
15543
- * @type GLArrayBuffer
15544
- * @private
15545
- */
15546
- public alphaBuffer: Renderers.GLArrayBuffer;
15547
- /**
15548
15472
* Create prebaked indices for drawing quads
15549
15473
* @method _generateIndices
15550
15474
* @param numQuads {number}
@@ -15563,7 +15487,7 @@ declare module Kiwi.Renderers {
15563
15487
* @public
15564
15488
*/
15565
15489
public addToBatch(gl: WebGLRenderingContext, entity: Kiwi.Entity, camera: Kiwi.Camera): void;
15566
- public concatBatch(xyuvItems: number[], alphaItems : number[]): void;
15490
+ public concatBatch(vertexItems : number[]): void;
15567
15491
}
15568
15492
}
15569
15493
/**
@@ -15626,6 +15550,8 @@ declare module Kiwi.Shaders {
15626
15550
* @public
15627
15551
*/
15628
15552
public compile(gl: WebGLRenderingContext, src: string, shaderType: number): WebGLShader;
15553
+ public uniforms: any;
15554
+ public attributes: any;
15629
15555
/**
15630
15556
*
15631
15557
* @property texture2DFrag
@@ -15640,6 +15566,10 @@ declare module Kiwi.Shaders {
15640
15566
* @public
15641
15567
*/
15642
15568
public vertSource: any[];
15569
+ public setParam(uniformName: string, value: any): void;
15570
+ public applyUniforms(gl: WebGLRenderingContext): void;
15571
+ public applyUniform(gl: WebGLRenderingContext, name: string): void;
15572
+ public initUniforms(gl: WebGLRenderingContext): void;
15643
15573
}
15644
15574
}
15645
15575
/**
0 commit comments