UNPKG

chart-0714

Version:

Professional trading chart library with advanced customization for trading journal apps

71 lines (70 loc) 2.36 kB
import { BufferPool } from './BufferPool'; interface ShaderProgram { program: WebGLProgram; attributes: Record<string, number>; uniforms: Record<string, WebGLUniformLocation | null>; } export declare class WebGLRenderer { private canvas; private gl; private programs; private width; private height; private pixelRatio; private bufferPool; constructor(canvas: HTMLCanvasElement); private setupContextLossHandling; init(): void; /** * 셰이더 프로그램 로드 */ loadShaderProgram(name: string, vertexSource: string, fragmentSource: string, attributes: string[], uniforms: string[]): Promise<void>; /** * 화면 크기 조정 */ resize(): void; /** * 화면 지우기 */ clear(color?: string): void; /** * 직교 투영 행렬 생성 */ createProjectionMatrix(left: number, right: number, bottom: number, top: number): Float32Array; /** * 프로그램 사용 */ useProgram(name: string): ShaderProgram | null; /** * 버퍼 생성 헬퍼 (BufferPool 사용) */ createBuffer(data: Float32Array | Uint16Array, target?: number): WebGLBuffer | null; /** * 속성 설정 */ setupAttribute(location: number, buffer: WebGLBuffer, size: number, type?: number, normalized?: boolean, stride?: number, offset?: number): void; /** * 유니폼 설정 헬퍼 함수들 */ setUniform1f(location: WebGLUniformLocation | null, value: number): void; setUniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; setUniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; setUniformMatrix4fv(location: WebGLUniformLocation | null, matrix: Float32Array): void; getUniformLocation(programName: string, uniformName: string): WebGLUniformLocation | null; /** * 그리기 함수들 */ drawArrays(mode: number, first: number, count: number): void; drawElements(mode: number, count: number, type: number, offset: number): void; /** * 리소스 정리 */ dispose(): void; getGL(): WebGLRenderingContext; getBufferPool(): BufferPool; getCanvas(): HTMLCanvasElement; getWidth(): number; getHeight(): number; getPixelRatio(): number; } export {};