Skip to content

Commit

Permalink
Fix #220 Wrong BindAttribLocation Values
Browse files Browse the repository at this point in the history
  • Loading branch information
sebavan committed Jan 18, 2022
1 parent 63a0c85 commit 451b5eb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/backend/commands/bindAttribLocation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { BaseCommand } from "./baseCommand";

export class BindAttribLocation extends BaseCommand {
public static readonly commandName = "bindAttribLocation";

protected get spiedCommandName(): string {
return BindAttribLocation.commandName;
}

protected stringifyArgs(args: IArguments): string[] {
const stringified = [];
// Program
if (args.length > 0) {
const arg = args[0];
const stringifiedValue = this.stringifyValue(arg);
stringified.push(stringifiedValue);
}
// Index
if (args.length > 1) {
const arg = '' + args[1];
stringified.push(arg);
}
// Name
if (args.length > 2) {
stringified.push(args[2]);
}
return stringified;
}
}
2 changes: 2 additions & 0 deletions src/backend/spies/commandSpy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BaseCommand } from "../commands/baseCommand";
import { OriginFunctionHelper } from "../utils/originFunctionHelper";
import { ICommandCapture } from "../../shared/capture/commandCapture";
import { Time } from "../../shared/utils/time";
import { BindAttribLocation } from "../commands/bindAttribLocation";
import { BlitFrameBuffer } from "../commands/blitFrameBuffer";
import { Clear } from "../commands/clear";
import { DefaultCommand } from "../commands/defaultCommand";
Expand Down Expand Up @@ -123,6 +124,7 @@ export class CommandSpy {
}

CommandSpy.customCommandsConstructors = {
[BindAttribLocation.commandName]: (options: IContextInformation) => new BindAttribLocation(options),
[BlitFrameBuffer.commandName]: (options: IContextInformation) => new BlitFrameBuffer(options),
[Clear.commandName]: (options: IContextInformation) => new Clear(options),
[DisableVertexAttribArray.commandName]: (options: IContextInformation) => new DisableVertexAttribArray(options),
Expand Down

0 comments on commit 451b5eb

Please sign in to comment.