Skip to content

Commit

Permalink
Remove geometry.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakuna committed Jun 29, 2022
1 parent 48d2352 commit c452bfd
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 53 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lakuna/umbra.js",
"version": "4.0.0",
"version": "5.0.0",
"description": "A lightweight visual application framework for WebGL.",
"keywords": [
"front-end",
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export * from "./types/TypedArray.js";
export * from "./utility/clearContext.js";
export * from "./utility/Color.js";
export * from "./utility/Geometry.js";
export * from "./utility/makeFullscreenCanvas.js";
export * from "./utility/resizeContext.js";
export * from "./webgl/Attribute.js";
Expand Down
28 changes: 0 additions & 28 deletions src/utility/Geometry.ts

This file was deleted.

21 changes: 0 additions & 21 deletions src/webgl/VAO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,10 @@ import { Program } from "./Program.js";
import { AttributeState } from "./AttributeState.js";
import { Buffer } from "./Buffer.js";
import { BufferTarget, Primitive } from "./WebGLConstant.js";
import { Geometry } from "../utility/Geometry.js"
import { Framebuffer } from "./Framebuffer.js";

/** A collection of attribute state; a vertex attribute array. */
export class VAO {
/**
* Creates a vertex array object from a shape.
* @param program The program that the VAO is used with.
* @param geometry The shape to create the VAO from.
* @param positionAttributeName The name of the attribute that position data will be supplied to.
* @param texcoordAttributeName The name of the attribute that texture coordinate data will be supplied to.
* @param normalAttributeName The name of the attribute that normal data will be supplied to.
*/
public static fromGeometry(program: Program, geometry: Geometry, positionAttributeName: string, texcoordAttributeName?: string, normalAttributeName?: string): VAO {
const attributes: Array<AttributeState> = [];
attributes.push(new AttributeState(positionAttributeName, new Buffer(program.gl, geometry.positions)));
if (texcoordAttributeName && geometry.texcoords?.length) {
attributes.push(new AttributeState(texcoordAttributeName, new Buffer(program.gl, geometry.texcoords)));
}
if (normalAttributeName && geometry.normals?.length) {
attributes.push(new AttributeState(normalAttributeName, new Buffer(program.gl, geometry.normals)));
}
return new VAO(program, attributes, geometry.indices);
}

/**
* Creates a vertex array object.
* @param program The program that the VAO is used with.
Expand Down

0 comments on commit c452bfd

Please sign in to comment.