mirror of
https://github.com/pissang/claygl.git
synced 2026-01-25 16:46:30 +00:00
43 lines
1.0 KiB
TypeScript
43 lines
1.0 KiB
TypeScript
import { Texture, ITextureOption } from './Texture';
|
|
import { Renderer } from './Renderer';
|
|
|
|
export interface ITexture2DOption extends ITextureOption {
|
|
image?: HTMLElement;
|
|
pixels?: ArrayBufferView;
|
|
mipmaps?: ArrayBufferView[];
|
|
convertToPOT?: boolean;
|
|
}
|
|
|
|
export class Texture2D extends Texture {
|
|
|
|
constructor(option?: ITexture2DOption);
|
|
|
|
convertToPOT: boolean;
|
|
|
|
image: HTMLElement;
|
|
|
|
pixels: ArrayBufferView;
|
|
|
|
mipmaps: ArrayBufferView[];
|
|
|
|
generateMipmap(renderer: Renderer): void;
|
|
|
|
isPowerOfTwo(): boolean;
|
|
|
|
isRenderable(): boolean;
|
|
|
|
bind(gl: WebGLRenderingContext): boolean;
|
|
|
|
unbind(gl: WebGLRenderingContext): boolean;
|
|
|
|
load(src: string): void;
|
|
|
|
once(name: "success", handler: (texture?: Texture2D) => any, context?: any): void;
|
|
success(handler: (texture?: Texture2D) => any, context?: any): void;
|
|
|
|
once(name: "error", handler: Function, context?: any): void;
|
|
error(handler: Function, context?: any): void;
|
|
|
|
once(name: string, handler: Function, context?: any): void;
|
|
}
|