pixi-batch-renderer
Advanced tools
Comparing version 2.4.2 to 2.5.0
@@ -5,2 +5,14 @@ { | ||
{ | ||
"version": "2.5.0", | ||
"tag": "pixi-batch-renderer_v2.5.0", | ||
"date": "Sun, 28 Mar 2021 19:20:49 GMT", | ||
"comments": { | ||
"minor": [ | ||
{ | ||
"comment": "Upgrade to PixiJS 6" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "2.4.2", | ||
@@ -7,0 +19,0 @@ "tag": "pixi-batch-renderer_v2.4.2", |
# Change Log - pixi-batch-renderer | ||
This log was last generated on Mon, 19 Oct 2020 00:38:23 GMT and should not be manually modified. | ||
This log was last generated on Sun, 28 Mar 2021 19:20:49 GMT and should not be manually modified. | ||
## 2.5.0 | ||
Sun, 28 Mar 2021 19:20:49 GMT | ||
### Minor changes | ||
- Upgrade to PixiJS 6 | ||
## 2.4.2 | ||
@@ -6,0 +13,0 @@ Mon, 19 Oct 2020 00:38:23 GMT |
122
index.d.ts
@@ -0,4 +1,12 @@ | ||
import type { BaseTexture } from '@pixi/core'; | ||
import { Buffer as Buffer_2 } from '@pixi/core'; | ||
import type { DisplayObject } from '@pixi/display'; | ||
import * as PIXI_2 from 'pixi.js'; | ||
import { UniformGroup } from 'pixi.js'; | ||
import { Geometry } from '@pixi/core'; | ||
import { ObjectRenderer } from '@pixi/core'; | ||
import type { Renderer } from '@pixi/core'; | ||
import { Shader } from '@pixi/core'; | ||
import type { State } from '@pixi/core'; | ||
import type { TYPES } from '@pixi/constants'; | ||
import type { UniformGroup } from '@pixi/core'; | ||
import { ViewableBuffer } from '@pixi/core'; | ||
@@ -13,3 +21,3 @@ export declare class AggregateUniformsBatch extends Batch { | ||
constructor(renderer: BatchRenderer, geometryOffset?: number); | ||
upload(renderer: PIXI.Renderer): void; | ||
upload(renderer: Renderer): void; | ||
reset(): void; | ||
@@ -21,3 +29,3 @@ } | ||
protected uniformBuffer: { | ||
[id: string]: Array<PIXI_2.UniformGroup>; | ||
[id: string]: Array<UniformGroup>; | ||
}; | ||
@@ -28,3 +36,3 @@ protected uniformMap: Array<number>; | ||
_newBatch(): AggregateUniformsBatch; | ||
protected _put(displayObject: PIXI_2.DisplayObject): boolean; | ||
protected _put(displayObject: DisplayObject): boolean; | ||
_buildBatch(batch: any): void; | ||
@@ -40,3 +48,3 @@ private _createUniformBuffer; | ||
size: number | '%notarray%'; | ||
glType: PIXI_2.TYPES; | ||
glType: TYPES; | ||
glSize: number; | ||
@@ -52,7 +60,7 @@ normalize: boolean; | ||
uidMap: any; | ||
state: PIXI_2.State; | ||
batchBuffer: Array<PIXI_2.DisplayObject>; | ||
textureBuffer: Array<PIXI_2.BaseTexture>; | ||
state: State; | ||
batchBuffer: Array<DisplayObject>; | ||
textureBuffer: Array<BaseTexture>; | ||
constructor(geometryOffset?: number); | ||
upload(renderer: PIXI_2.Renderer): void; | ||
upload(renderer: Renderer): void; | ||
reset(): void; | ||
@@ -72,7 +80,7 @@ } | ||
protected _textureProperty: string; | ||
_batchBuffer: Array<PIXI.DisplayObject>; | ||
protected _state: PIXI.State; | ||
_batchBuffer: Array<DisplayObject>; | ||
protected _state: State; | ||
protected _textureBuffer: any; | ||
protected _textureBufferLength: number; | ||
protected _textureIndexedBuffer: Array<PIXI.BaseTexture>; | ||
protected _textureIndexedBuffer: Array<BaseTexture>; | ||
protected _textureIndexMap: any; | ||
@@ -83,3 +91,3 @@ protected _batchPool: any[]; | ||
constructor(renderer: BatchRenderer); | ||
put(targetObject: PIXI.DisplayObject, state: PIXI.State): boolean; | ||
put(targetObject: DisplayObject, state: State): boolean; | ||
build(geometryOffset: number): void; | ||
@@ -90,3 +98,3 @@ ready(): boolean; | ||
size(): number; | ||
protected _put(displayObject: PIXI.DisplayObject): boolean; | ||
protected _put(displayObject: DisplayObject): boolean; | ||
protected _newBatch(): any; | ||
@@ -99,10 +107,10 @@ protected _nextBatch(geometryOffset?: number): any; | ||
export declare class BatchGeometry extends PIXI_2.Geometry { | ||
attribBuffer: PIXI_2.Buffer; | ||
indexBuffer: PIXI_2.Buffer; | ||
constructor(attributeRedirects: AttributeRedirect[], hasIndex: boolean, texIDAttrib: string, texturesPerObject: number, inBatchIDAttrib: string, uniformIDAttrib: string, masterIDAttrib: string, attributeBuffer?: PIXI_2.Buffer, indexBuffer?: PIXI_2.Buffer); | ||
export declare class BatchGeometry extends Geometry { | ||
attribBuffer: Buffer_2; | ||
indexBuffer: Buffer_2; | ||
constructor(attributeRedirects: AttributeRedirect[], hasIndex: boolean, texIDAttrib: string, texturesPerObject: number, inBatchIDAttrib: string, uniformIDAttrib: string, masterIDAttrib: string, attributeBuffer?: Buffer_2, indexBuffer?: Buffer_2); | ||
} | ||
export declare class BatchGeometryFactory extends IBatchGeometryFactory { | ||
_targetCompositeAttributeBuffer: PIXI_2.ViewableBuffer; | ||
_targetCompositeAttributeBuffer: ViewableBuffer; | ||
_targetCompositeIndexBuffer: Uint16Array; | ||
@@ -113,3 +121,3 @@ _aIndex: number; | ||
_indexProperty: string; | ||
_vertexCountProperty: string | number; | ||
_vertexCountProperty: string | number | ((object: DisplayObject) => number); | ||
_vertexSize: number; | ||
@@ -125,20 +133,23 @@ _texturesPerObject: number; | ||
protected _texID: number | number[]; | ||
protected _aBuffers: PIXI_2.ViewableBuffer[]; | ||
protected _aBuffers: ViewableBuffer[]; | ||
protected _iBuffers: Uint16Array[]; | ||
protected _geometryPool: Array<PIXI_2.Geometry>; | ||
_geometryMerger: (displayObject: PIXI_2.DisplayObject, factory: BatchGeometryFactory) => void; | ||
protected _geometryPool: Array<Geometry>; | ||
_geometryMerger: (displayObject: DisplayObject, factory: BatchGeometryFactory) => void; | ||
constructor(renderer: BatchRenderer); | ||
init(verticesBatched: number, indiciesBatched?: number): void; | ||
append(targetObject: PIXI_2.DisplayObject, batch_: any): void; | ||
build(): PIXI_2.Geometry; | ||
release(geom: PIXI_2.Geometry): void; | ||
protected get geometryMerger(): (displayObject: PIXI_2.DisplayObject, factory: BatchGeometryFactory) => void; | ||
protected set geometryMerger(func: (displayObject: PIXI_2.DisplayObject, factory: BatchGeometryFactory) => void); | ||
protected getAttributeBuffer(size: number): PIXI_2.ViewableBuffer; | ||
append(targetObject: DisplayObject, batch_: any): void; | ||
build(): Geometry; | ||
release(geom: Geometry): void; | ||
protected get geometryMerger(): (displayObject: DisplayObject, factory: BatchGeometryFactory) => void; | ||
protected set geometryMerger(func: (displayObject: DisplayObject, factory: BatchGeometryFactory) => void); | ||
get _indexCountProperty(): Resolvable<number>; | ||
protected getAttributeBuffer(size: number): ViewableBuffer; | ||
protected getIndexBuffer(size: number): Uint16Array; | ||
} | ||
export declare class BatchRenderer extends PIXI_2.ObjectRenderer { | ||
export declare class BatchRenderer extends ObjectRenderer { | ||
renderer: Renderer; | ||
readonly _attribRedirects: AttributeRedirect[]; | ||
readonly _indexProperty: string; | ||
readonly _indexCountProperty: string | number | ((object: DisplayObject) => number); | ||
readonly _vertexCountProperty: string | number | ((object: DisplayObject) => number); | ||
@@ -157,6 +168,6 @@ readonly _textureProperty: string; | ||
_drawer: BatchDrawer; | ||
_objectBuffer: PIXI_2.DisplayObject[]; | ||
_objectBuffer: DisplayObject[]; | ||
_bufferedVertices: number; | ||
_bufferedIndices: number; | ||
_shader: PIXI_2.Shader; | ||
_shader: Shader; | ||
MAX_TEXTURES: number; | ||
@@ -167,9 +178,10 @@ protected readonly _BatchFactoryClass: typeof BatchGenerator; | ||
protected readonly options: any; | ||
constructor(renderer: PIXI_2.Renderer, options: IBatchRendererOptions); | ||
constructor(renderer: Renderer, options: IBatchRendererOptions); | ||
contextChange(): void; | ||
start(): void; | ||
render(displayObject: PIXI_2.DisplayObject): void; | ||
render(displayObject: DisplayObject): void; | ||
flush(): void; | ||
stop(): void; | ||
protected calculateVertexCount(object: PIXI_2.DisplayObject): number; | ||
protected calculateVertexCount(object: DisplayObject): number; | ||
protected calculateIndexCount(object: DisplayObject): number; | ||
} | ||
@@ -190,5 +202,5 @@ | ||
constructor(vertexShaderTemplate: string, fragmentShaderTemplate: string, uniforms?: {}, templateInjectors?: any, disableVertexShaderTemplate?: boolean); | ||
derive(): (brend: BatchRenderer) => PIXI_2.Shader; | ||
derive(): (brend: BatchRenderer) => Shader; | ||
protected _generateInjectorBasedState(batchRenderer: BatchRenderer): string; | ||
protected _generateShader(stringState: string, renderer: BatchRenderer): PIXI_2.Shader; | ||
protected _generateShader(stringState: string, renderer: BatchRenderer): Shader; | ||
} | ||
@@ -206,4 +218,4 @@ | ||
declare interface IAttributeRedirectOptions { | ||
source: string | ((db: PIXI_2.DisplayObject, renderer: BatchRenderer) => any); | ||
export declare interface IAttributeRedirectOptions { | ||
source: string | ((db: DisplayObject) => any); | ||
attrib: string; | ||
@@ -217,14 +229,15 @@ type: string; | ||
declare abstract class IBatchGeometryFactory { | ||
export declare abstract class IBatchGeometryFactory { | ||
protected _renderer: BatchRenderer; | ||
constructor(renderer: BatchRenderer); | ||
abstract init(verticesBatched: number, indiciesBatched: number): void; | ||
abstract append(displayObject: PIXI_2.DisplayObject, batch: any): void; | ||
abstract build(): PIXI_2.Geometry; | ||
abstract release(geom: PIXI_2.Geometry): void; | ||
abstract append(displayObject: DisplayObject, batch: any): void; | ||
abstract build(): Geometry; | ||
abstract release(geom: Geometry): void; | ||
} | ||
declare interface IBatchRendererOptions { | ||
export declare interface IBatchRendererOptions { | ||
attribSet: AttributeRedirect[]; | ||
indexProperty: string; | ||
indexCountProperty?: string | number | ((object: DisplayObject) => number); | ||
vertexCountProperty?: string | number | ((object: DisplayObject) => number); | ||
@@ -236,4 +249,4 @@ textureProperty: string; | ||
masterIDAttrib?: string; | ||
stateFunction?: (renderer: PIXI_2.DisplayObject) => PIXI_2.State; | ||
shaderFunction: (renderer: BatchRenderer) => PIXI_2.Shader; | ||
stateFunction?: (renderer: DisplayObject) => State; | ||
shaderFunction: (renderer: BatchRenderer) => Shader; | ||
BatchFactoryClass?: typeof BatchGenerator; | ||
@@ -246,5 +259,6 @@ BatchGeometryFactoryClass?: typeof BatchGeometryFactory; | ||
declare interface IBatchRendererStdOptions { | ||
export declare interface IBatchRendererStdOptions { | ||
attribSet: AttributeRedirect[]; | ||
vertexCountProperty?: string | number | ((object: DisplayObject) => number); | ||
indexCountProperty?: string | number | ((object: DisplayObject) => number); | ||
indexProperty: string; | ||
@@ -256,3 +270,3 @@ textureProperty: string; | ||
styleIDAttrib?: string; | ||
stateFunction?: (brend: PIXI_2.DisplayObject) => any; | ||
stateFunction?: (brend: DisplayObject) => any; | ||
shaderFunction: (brend: BatchRenderer) => any; | ||
@@ -267,4 +281,4 @@ BatchFactoryClass?: typeof BatchGenerator; | ||
declare interface IUniformRedirectOptions { | ||
source: string | ((displayObject: PIXI_2.DisplayObject, renderer: BatchRenderer) => any); | ||
export declare interface IUniformRedirectOptions { | ||
source: string | ((displayObject: DisplayObject) => any); | ||
uniform: string; | ||
@@ -274,7 +288,9 @@ } | ||
export declare abstract class Redirect { | ||
source: string | ((displayObject: PIXI_2.DisplayObject, source: BatchRenderer) => any); | ||
source: string | ((displayObject: DisplayObject, renderer: BatchRenderer) => any); | ||
glslIdentifer: string; | ||
constructor(source: string | ((displayObject: PIXI_2.DisplayObject, source: BatchRenderer) => any), glslIdentifer: string); | ||
constructor(source: string | ((displayObject: DisplayObject) => any), glslIdentifer: string); | ||
} | ||
export declare type Resolvable<T> = string | T | ((object: DisplayObject, renderer: BatchRenderer) => T); | ||
export declare class UniformRedirect extends Redirect { | ||
@@ -281,0 +297,0 @@ constructor(options: IUniformRedirectOptions); |
{ | ||
"name": "pixi-batch-renderer", | ||
"version": "2.4.2", | ||
"version": "2.5.0", | ||
"description": "Batch rendering library for WebGL/PixiJS applications", | ||
@@ -9,8 +9,6 @@ "main": "lib/pixi-batch-renderer.js", | ||
"namespace": "PIXI.brend", | ||
"types": "index.d.ts", | ||
"scripts": { | ||
"build": "npm run compile; npm run docs", | ||
"docs": "jsdoc -c ./.jsdoc.conf.json --verbose -r README.md", | ||
"predeploy": "npm run docs", | ||
"deploy": "gh-pages -d docs", | ||
"compile": "rollup -c --silent", | ||
"build": "npm run compile && pnpm compile:types", | ||
"compile": "rollup -c node_modules/@pixi-build-tools/rollup-configurator/index.js --silent", | ||
"compile:types": "rm -rf compile && tsc; api-extractor run; echo Done", | ||
@@ -21,2 +19,7 @@ "prepublishOnly": "npm run build" | ||
"license": "MIT", | ||
"files": [ | ||
"lib", | ||
"dist", | ||
"index.d.ts" | ||
], | ||
"keywords": [ | ||
@@ -35,3 +38,8 @@ "pixi", | ||
"peerDependencies": { | ||
"pixi.js": "^5.1.1" | ||
"@pixi/constants": "^6.0.0", | ||
"@pixi/core": "^6.0.0", | ||
"@pixi/display": "^6.0.0", | ||
"@pixi/math": "^6.0.0", | ||
"@pixi/settings": "^6.0.0", | ||
"@pixi/utils": "^6.0.0" | ||
}, | ||
@@ -41,17 +49,15 @@ "devDependencies": { | ||
"@pixi/eslint-config": "^1.0.1", | ||
"@pixi/jsdoc-template": "^2.6.0", | ||
"@rollup/plugin-node-resolve": "^8.4.0", | ||
"@pixi/constants": "^6.0.0", | ||
"@pixi/core": "^6.0.0", | ||
"@pixi/display": "^6.0.0", | ||
"@pixi/math": "^6.0.0", | ||
"@pixi/utils": "^6.0.0", | ||
"@pixi-build-tools/rollup-configurator": "~1.0.11", | ||
"eslint": "^6.8.0", | ||
"eslint-plugin-jsdoc": "^15.12.2", | ||
"floss": "^3.0.0", | ||
"electron": "10.1.3", | ||
"floss": "^5.0.0", | ||
"electron": "^12.0.0", | ||
"nyc": "15.1.0", | ||
"gh-pages": "^2.2.0", | ||
"jsdoc": "^3.6.4", | ||
"pixi.js": "^5.2.1", | ||
"rollup": "^2.3.3", | ||
"@rollup/plugin-commonjs": "^14.0.0", | ||
"rollup-plugin-sourcemaps": "^0.5.0", | ||
"rollup-plugin-terser": "^5.3.0", | ||
"rollup-plugin-typescript": "^1.0.1", | ||
"tslib": "^2.0.0", | ||
@@ -58,0 +64,0 @@ "typescript": "^3.8.3", |
@@ -12,2 +12,14 @@ # pixi-batch-renderer | ||
## Usage | ||
In browser: | ||
```js | ||
PIXI.brend.BatchRenderer | ||
``` | ||
Using ES: | ||
```js | ||
import { BatchRenderer } from 'pixi-batch-renderer'; | ||
``` | ||
## Concepts | ||
@@ -14,0 +26,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
727854
18
7337
380
6
13
3