rapid-render 1.0.16 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,17 +85,19 @@ export declare class CustomGlShader {
85
85
  uniformDirty: Set<string>;
86
86
  /** Map of textures to be bound to this shader */
87
87
  uniformTextures: Record<string, WebGLTexture>;
88
+ uniformArrayTexture: Record<string, WebGLTexture[]>;
88
89
  /** Number of texture units reserved by this custom shader */
89
90
  usedTextureUnitNum: number;
90
91
  /** Padding in pixels this shader needs beyond the sprite bounds (for outline/glow effects) */
91
92
  padding: number;
92
93
  rapid: Rapid;
93
- constructor(rapid: Rapid, vs: string, fs: string, usedTextureUnitNum?: number, uniforms?: Record<string, UniformValue>);
94
+ prefix: string[];
95
+ constructor(rapid: Rapid, vs?: string, fs?: string, usedTextureUnitNum?: number, uniforms?: Record<string, UniformValue>);
94
96
  /**
95
97
  * Updates uniform values or textures for the custom shader.
96
98
  * @param uniforms Map of uniform values or WebGL textures to apply.
97
99
  */
98
- setUniforms(uniforms: Record<string, UniformValue | WebGLTexture>): void;
100
+ setUniforms(uniforms: Record<string, UniformValue | WebGLTexture | WebGLTexture[]>): void;
99
101
  /**
100
102
  * Sets the padding (in pixels) for this shader and propagates to all compiled GLShaders.
101
103
  * Must be called before the first draw call if set after construction.
@@ -107,7 +109,7 @@ export declare class CustomGlShader {
107
109
  * @param key The region key.
108
110
  * @param textureUniforms Map of texture uniform names to assigned texture unit indices.
109
111
  */
110
- applyUniform(key: string, textureUniforms: Record<string, number>): void;
112
+ applyUniform(key: string, textureUniforms: Record<string, number | number[]>): void;
111
113
  /**
112
114
  * Retrieves or compiles a customized GLShader for a specific region.
113
115
  * @param region The Region requesting the shader.
@@ -1,5 +1,6 @@
1
- import { Rapid, TextureFilterMode } from '../render';
2
- import { ITextOptions, TextureWrapMode } from '../texture';
1
+ import { TextureFilterMode } from '../texture-filter-mode';
2
+ import { TextureWrapMode, ITextOptions } from '../texture';
3
+ import { Rapid } from '../render';
3
4
  export type WebGLContext = WebGL2RenderingContext;
4
5
  export declare const supportsWebGL: (canvas: HTMLCanvasElement) => boolean;
5
6
  /**
@@ -40,7 +41,7 @@ export declare function createTexture(render: Rapid, source: TexImageSource | {
40
41
  width: number;
41
42
  height: number;
42
43
  }, options: ICreateTextureOptions): WebGLTexture;
43
- export declare function generateShader(fs: string, max: number): string;
44
+ export declare function generateShader(fs: string, max: number, id?: string, uv?: string, set?: string): string;
44
45
  export declare const FLOAT = 5126;
45
46
  export declare const UNSIGNED_BYTE = 5121;
46
47
  export declare function vertexAttribDivisor(gl: WebGLContext, index: number, divisor: number): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rapid-render",
3
3
  "private": false,
4
- "version": "1.0.16",
4
+ "version": "1.0.17",
5
5
  "type": "module",
6
6
  "description": "A high-performance lightweight WebGL 2D renderer for browser games.",
7
7
  "repository": "https://github.com/Nightre/Rapid.js",
@@ -37,7 +37,7 @@
37
37
  "dev": "vite",
38
38
  "build": "tsc && vite build",
39
39
  "build:test-internal": "vite build --config vite.test.config.ts",
40
- "test": "npm run build && node --test",
40
+ "test": "vitest run",
41
41
  "build:docs": "vite build --config vite.docs.config.ts",
42
42
  "docs": "typedoc",
43
43
  "example:dev": "vite --config example/vite.config.ts",
@@ -50,7 +50,8 @@
50
50
  "@types/stats.js": "^0.17.4",
51
51
  "highlight.js": "^11.11.1",
52
52
  "stats.js": "^0.17.0",
53
- "vite-plugin-dts": "^4.5.4"
53
+ "vite-plugin-dts": "^4.5.4",
54
+ "vitest": "^4.0.18"
54
55
  },
55
56
  "dependencies": {}
56
57
  }