mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-19 14:52:40 +08:00
32598c25cb
* switch to eslint * eslint: extends airbnb
93 lines
2.7 KiB
TypeScript
93 lines
2.7 KiB
TypeScript
/**
|
|
* Define gfx global classes here.
|
|
*/
|
|
|
|
export class Rect {
|
|
declare private _token: never; // to make sure all usages must be an instance of this exact class, not assembled from plain object
|
|
|
|
constructor (
|
|
public x: number = 0,
|
|
public y: number = 0,
|
|
public width: number = 1,
|
|
public height: number = 1,
|
|
) {}
|
|
}
|
|
|
|
export class Viewport {
|
|
declare private _token: never; // to make sure all usages must be an instance of this exact class, not assembled from plain object
|
|
|
|
constructor (
|
|
public left: number = 0,
|
|
public top: number = 0,
|
|
public width: number = 0,
|
|
public height: number = 0,
|
|
public minDepth: number = 0,
|
|
public maxDepth: number = 1,
|
|
) {}
|
|
}
|
|
|
|
export class Color {
|
|
declare private _token: never; // to make sure all usages must be an instance of this exact class, not assembled from plain object
|
|
|
|
constructor (
|
|
public x: number = 0,
|
|
public y: number = 0,
|
|
public z: number = 0,
|
|
public w: number = 0,
|
|
) {}
|
|
}
|
|
|
|
export class Offset {
|
|
declare private _token: never; // to make sure all usages must be an instance of this exact class, not assembled from plain object
|
|
|
|
constructor (
|
|
public x: number = 0,
|
|
public y: number = 0,
|
|
public z: number = 0,
|
|
) {}
|
|
}
|
|
|
|
export class Extent {
|
|
declare private _token: never; // to make sure all usages must be an instance of this exact class, not assembled from plain object
|
|
|
|
constructor (
|
|
public width: number = 0,
|
|
public height: number = 0,
|
|
public depth: number = 1,
|
|
) {}
|
|
}
|
|
|
|
export class TextureSubres {
|
|
declare private _token: never; // to make sure all usages must be an instance of this exact class, not assembled from plain object
|
|
|
|
constructor (
|
|
public mipLevel: number = 0,
|
|
public baseArrayLayer: number = 0,
|
|
public layerCount: number = 1,
|
|
) {}
|
|
}
|
|
|
|
export class TextureCopy {
|
|
declare private _token: never; // to make sure all usages must be an instance of this exact class, not assembled from plain object
|
|
|
|
constructor (
|
|
public srcSubres = new TextureSubres(),
|
|
public srcOffset = new Offset(),
|
|
public dstSubres = new TextureSubres(),
|
|
public dstOffset = new Offset(),
|
|
public extent = new Extent(),
|
|
) {}
|
|
}
|
|
|
|
export class BufferTextureCopy {
|
|
declare private _token: never; // to make sure all usages must be an instance of this exact class, not assembled from plain object
|
|
|
|
constructor (
|
|
public buffStride: number = 0,
|
|
public buffTexHeight: number = 0,
|
|
public texOffset = new Offset(),
|
|
public texExtent = new Extent(),
|
|
public texSubres = new TextureSubres(),
|
|
) {}
|
|
}
|