Skip to content

Commit

Permalink
delete dom dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
LCluber committed May 24, 2021
1 parent 06d7571 commit 9fa7bf4
Show file tree
Hide file tree
Showing 9 changed files with 316 additions and 944 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 0.5.11 (May 24th 2021)
-----------------------------
* Delete Dom dependency

Version 0.5.10 (May 23th 2021)
-----------------------------
* Delete logger dependency
Expand Down
1 change: 1 addition & 0 deletions dist/roostr.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ export declare class Renderer {
setClearColor(red: number, green: number, blue: number, alpha: number): void;
clearFrame(): void;
getContext(): WebGLRenderingContext | null;
private findById;
}

export declare class MeshRenderer {
Expand Down
1,225 changes: 295 additions & 930 deletions dist/roostr.iife.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/roostr.iife.min.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions dist/roostr.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/

import { Matrix4x3, Matrix4x4, Vector3 } from '@lcluber/type6js';
import { Dom } from '@lcluber/weejs';

class SceneRenderer {
constructor(context) {
Expand Down Expand Up @@ -217,7 +216,7 @@ class Scene {

class Renderer {
constructor(canvasID) {
this.canvas = Dom.findById(canvasID);
this.canvas = this.findById(canvasID);
this.canvas.width = 1280;
this.canvas.height = 720;
this.context = this.canvas.getContext("webgl") || this.canvas.getContext("experimental-webgl", { alpha: false });
Expand Down Expand Up @@ -255,6 +254,9 @@ class Renderer {
getContext() {
return this.context;
}
findById(id) {
return document.getElementById(id);
}
}

class Camera {
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lcluber/roostrjs",
"version": "0.5.10",
"version": "0.5.11",
"description": "WebGL 3D engine written in TypeScript",
"keywords": [
"WebGL 3D engine"
Expand Down Expand Up @@ -38,8 +38,7 @@
"morgan": "1.8.1",
"pug": "2.0.0-beta11",
"serve-favicon": "2.4.0",
"@lcluber/type6js": "2.0.1",
"@lcluber/weejs": "1.0.1"
"@lcluber/type6js": "3.0.0"
},
"devDependencies": {
"@fortawesome/fontawesome-free": "5.3.1",
Expand Down
9 changes: 5 additions & 4 deletions src/ts/renderer/global.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@

//var canvas = require('./canvas');
import {Dom} from '@lcluber/weejs';

export class Renderer {

canvas: HTMLCanvasElement;
context: WebGLRenderingContext;

constructor(canvasID:string) {
this.canvas = Dom.findById(canvasID) as HTMLCanvasElement;
this.canvas = this.findById(canvasID) as HTMLCanvasElement;
// default resolution
this.canvas.width = 1280;
this.canvas.height = 720;
Expand Down Expand Up @@ -84,4 +81,8 @@ export class Renderer {
return this.context;
}

private findById(id: string): HTMLCanvasElement | null {
return document.getElementById(id) as HTMLCanvasElement;
}

}
2 changes: 1 addition & 1 deletion web/public/js/main.min.js

Large diffs are not rendered by default.

0 comments on commit 9fa7bf4

Please sign in to comment.