deps: bump glcat-ts to 0.14.2 + remove unnecessary generics

This commit is contained in:
FMS-Cat
2021-03-17 11:16:20 +09:00
parent a6d20f6571
commit c27c7aa5e0
11 changed files with 37 additions and 37 deletions

View File

@@ -12,7 +12,7 @@
"@fms-cat/automaton-fxs": "^4.1.0",
"@fms-cat/automaton-with-gui": "^4.1.1",
"@fms-cat/experimental": "^0.5.0",
"@fms-cat/glcat-ts": "^0.14.0",
"@fms-cat/glcat-ts": "^0.14.2",
"@types/webpack-env": "^1.16.0",
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",

View File

@@ -13,20 +13,20 @@ export class Music {
public time: number;
public deltaTime: number;
public audio: AudioContext;
public samples?: GLCatTexture<WebGL2RenderingContext>;
public samples?: GLCatTexture;
private __program: GLCatProgram<WebGL2RenderingContext>;
private __bufferOff: GLCatBuffer<WebGL2RenderingContext>;
private __program: GLCatProgram;
private __bufferOff: GLCatBuffer;
private __bufferTransformFeedbacks: [
GLCatBuffer<WebGL2RenderingContext>,
GLCatBuffer<WebGL2RenderingContext>
GLCatBuffer,
GLCatBuffer
];
private __transformFeedback: GLCatTransformFeedback<WebGL2RenderingContext>;
private __transformFeedback: GLCatTransformFeedback;
private __prevAudioTime: number;
private __bufferPool: Pool<AudioBuffer>;
private __prevBufferSource: AudioBufferSourceNode | null = null;
constructor( glCat: GLCat<WebGL2RenderingContext>, audio: AudioContext ) {
constructor( glCat: GLCat, audio: AudioContext ) {
this.audio = audio;
// == yoinked from wavenerd-deck ===============================================================

View File

@@ -18,8 +18,8 @@ export interface CameraEntityOptions {
root: Entity;
target: RenderTarget;
lights: LightEntity[];
textureIBLLUT: GLCatTexture<WebGL2RenderingContext>;
textureEnv: GLCatTexture<WebGL2RenderingContext>;
textureIBLLUT: GLCatTexture;
textureEnv: GLCatTexture;
}
export class CameraEntity {

View File

@@ -16,7 +16,7 @@ export class EnvironmentMap {
public swap: Swap<BufferRenderTarget>;
public get texture(): GLCatTexture<WebGL2RenderingContext> {
public get texture(): GLCatTexture {
return this.swap.o.texture;
}

View File

@@ -16,7 +16,7 @@ export class IBLLUT {
public swap: Swap<BufferRenderTarget>;
public get texture(): GLCatTexture<WebGL2RenderingContext> {
public get texture(): GLCatTexture {
return this.swap.o.texture;
}

View File

@@ -13,9 +13,9 @@ export interface BufferRenderTargetOptions {
export class BufferRenderTarget extends RenderTarget {
public static nameMap = new Map<string, BufferRenderTarget>();
private readonly __framebuffer: GLCatFramebuffer<WebGL2RenderingContext>;
private readonly __framebuffer: GLCatFramebuffer;
public get framebuffer(): GLCatFramebuffer<WebGL2RenderingContext> {
public get framebuffer(): GLCatFramebuffer {
return this.__framebuffer;
}
@@ -85,11 +85,11 @@ export class BufferRenderTarget extends RenderTarget {
}
}
public get texture(): GLCatTexture<WebGL2RenderingContext> {
public get texture(): GLCatTexture {
return this.__framebuffer.texture!;
}
public getTexture( attachment: number ): GLCatTexture<WebGL2RenderingContext> | null {
public getTexture( attachment: number ): GLCatTexture | null {
return this.__framebuffer.getTexture( attachment );
}

View File

@@ -3,7 +3,7 @@ import { gl, glCat } from '../globals/canvas';
import { Material } from './Material';
export interface GeometryAttribute {
buffer: GLCatBuffer<WebGL2RenderingContext>;
buffer: GLCatBuffer;
size: number;
divisor?: number;
type: GLenum;
@@ -12,7 +12,7 @@ export interface GeometryAttribute {
}
export interface GeometryIndex {
buffer: GLCatBuffer<WebGL2RenderingContext>;
buffer: GLCatBuffer;
type: GLenum;
}
@@ -28,7 +28,7 @@ export class Geometry {
[ gl.FLOAT ]: 4,
};
public transformFeedback?: GLCatTransformFeedback<WebGL2RenderingContext> | null;
public transformFeedback?: GLCatTransformFeedback | null;
protected __attributes: {
[ name: string ]: GeometryAttribute;

View File

@@ -25,7 +25,7 @@ export class Material {
protected __uniformTextures: {
[ name: string ]: {
texture: GLCatTexture<WebGL2RenderingContext> | null;
texture: GLCatTexture | null;
};
} = {};
@@ -49,7 +49,7 @@ export class Material {
return this.__withDefines( this.frag );
}
public get program(): GLCatProgram<WebGL2RenderingContext> {
public get program(): GLCatProgram {
return SHADERPOOL.getProgram(
this,
this.vertWithDefines,
@@ -85,7 +85,7 @@ export class Material {
this.__uniformVectors[ name ] = { type, value };
}
public addUniformTexture( name: string, texture: GLCatTexture<WebGL2RenderingContext> | null ): void {
public addUniformTexture( name: string, texture: GLCatTexture | null ): void {
this.__uniformTextures[ name ] = { texture };
}

View File

@@ -3,18 +3,18 @@ import { glCat } from '../globals/canvas';
import { Material } from './Material';
export class ShaderPool<TUser> {
private __programMap: Map<string, GLCatProgram<WebGL2RenderingContext>> = new Map();
private __programMap: Map<string, GLCatProgram> = new Map();
private __ongoingPromises: Map<string, Promise<GLCatProgram<WebGL2RenderingContext>>> = new Map();
private __ongoingPromises: Map<string, Promise<GLCatProgram>> = new Map();
private __programUsersMap: Map<GLCatProgram<WebGL2RenderingContext>, Set<TUser>> = new Map();
private __programUsersMap: Map<GLCatProgram, Set<TUser>> = new Map();
public getProgram(
user: TUser,
vert: string,
frag: string,
options?: GLCatProgramLinkOptions,
): GLCatProgram<WebGL2RenderingContext> {
): GLCatProgram {
let program = this.__programMap.get( vert + frag );
if ( !program ) {
if ( process.env.DEV ) {
@@ -41,7 +41,7 @@ export class ShaderPool<TUser> {
vert: string,
frag: string,
options?: GLCatProgramLinkOptions
): Promise<GLCatProgram<WebGL2RenderingContext>> {
): Promise<GLCatProgram> {
let program = this.__programMap.get( vert + frag );
if ( !program ) {
let promise = this.__ongoingPromises.get( vert + frag );
@@ -85,7 +85,7 @@ export class ShaderPool<TUser> {
}
}
private __setUser( user: TUser, program: GLCatProgram<WebGL2RenderingContext> ): void {
private __setUser( user: TUser, program: GLCatProgram ): void {
let users = this.__programUsersMap.get( program );
if ( !users ) {
users = new Set();
@@ -97,7 +97,7 @@ export class ShaderPool<TUser> {
}
}
private __deleteUser( user: TUser, program: GLCatProgram<WebGL2RenderingContext> ): void {
private __deleteUser( user: TUser, program: GLCatProgram ): void {
const users = this.__programUsersMap.get( program )!;
if ( !users.has( user ) ) {
@@ -108,7 +108,7 @@ export class ShaderPool<TUser> {
users.delete( user );
}
private __countUsers( program: GLCatProgram<WebGL2RenderingContext> ): number {
private __countUsers( program: GLCatProgram ): number {
const users = this.__programUsersMap.get( program )!;
return users.size;
}

View File

@@ -3,14 +3,14 @@ import GLCat, { GLCatTexture } from '@fms-cat/glcat-ts';
import { gl } from '../globals/canvas';
export class RandomTexture {
private __texture: GLCatTexture<WebGL2RenderingContext>;
private __texture: GLCatTexture;
private __array: Uint8Array;
private __rng: Xorshift;
private __width: number;
private __height: number;
public constructor(
glCat: GLCat<WebGL2RenderingContext>,
glCat: GLCat,
width: number,
height: number,
) {
@@ -22,7 +22,7 @@ export class RandomTexture {
this.__texture.textureWrap( gl.REPEAT );
}
public get texture(): GLCatTexture<WebGL2RenderingContext> {
public get texture(): GLCatTexture {
return this.__texture;
}

View File

@@ -74,10 +74,10 @@
resolved "https://registry.yarnpkg.com/@fms-cat/experimental/-/experimental-0.5.0.tgz#41ebe9ce2b4bfca7b194f3a5c8aad951264a4ac0"
integrity sha512-01vnWv6fCrwvR0hsEhmDKhrQ/k0NjAsbV4+lDJJ8xCOdHDjbtHxSjv92Px2WxDMpv2JYfIpw2d8iqGZzVAvcAg==
"@fms-cat/glcat-ts@^0.14.0":
version "0.14.0"
resolved "https://registry.yarnpkg.com/@fms-cat/glcat-ts/-/glcat-ts-0.14.0.tgz#881573c559c9a56f2b429c919011fbdfbbdd6c55"
integrity sha512-qaRvW1Hua0quOdsp58f0LAEaaYuU8LwG6hwoA/y7lmMGppuAeTmssnL+i/WKbI/h7TVI3JmPhPwRBXS1/+t55Q==
"@fms-cat/glcat-ts@^0.14.2":
version "0.14.2"
resolved "https://registry.yarnpkg.com/@fms-cat/glcat-ts/-/glcat-ts-0.14.2.tgz#548019d8b31ccf9d5aa6e1bfd01d73bd1ad2e4de"
integrity sha512-Pv32IeyZXJiFaf8mhAzOkoef4gaaVWYITuwENrtKi+4rwkebLcx9SEqoG8qDAFeWmm0ANKFYsYCRyhns4VSnRA==
"@nodelib/fs.scandir@2.1.4":
version "2.1.4"