- 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
import type { ISystem } from '../ISystem';
import type { Renderer } from '../Renderer';
/**
* Base for a common object renderer that can be used as a
* system renderer plugin.
* @memberof PIXI
*/
export class ObjectRenderer implements ISystem
{
/** The renderer this manager works for. */
protected renderer: Renderer;
/**
* @param renderer - The renderer this manager works for.
*/
constructor(renderer: Renderer)
{
this.renderer = renderer;
}
/** Stub method that should be used to empty the current batch by rendering objects now. */
flush(): void
{
// flush!
}
/** Generic destruction method that frees all resources. This should be called by subclasses. */
destroy(): void
{
this.renderer = null;
}
/**
* Stub method that initializes any state required before
* rendering starts. It is different from the `prerender`
* signal, which occurs every frame, in that it is called
* whenever an object requests _this_ renderer specifically.
*/
start(): void
{
// set the shader..
}
/** Stops the renderer. It should free up any state and become dormant. */
stop(): void
{
this.flush();
}
/**
* Keeps the object to render. It doesn't have to be
* rendered immediately.
* @param {PIXI.DisplayObject} _object - The object to render.
*/
render(_object: any): void // eslint-disable-line @typescript-eslint/explicit-module-boundary-types
{
// render the object
}
}