Skip to content

Commit 6b90122

Browse files
committed
Update dependencies
1 parent 1d92e98 commit 6b90122

File tree

11 files changed

+137
-263
lines changed

11 files changed

+137
-263
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
name: Build
4848
strategy:
4949
matrix:
50-
os: [ubuntu-22.04, windows-2022, macos-14, [self-hosted, linux, ARM64]]
50+
os: [ubuntu-22.04, windows-2022, macos-14]
5151

5252
runs-on: ${{ matrix.os }}
5353

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
name: Unit Tests
1717
strategy:
1818
matrix:
19-
os: [ubuntu-22.04, windows-2022, macos-14, [self-hosted, linux, ARM64]]
19+
os: [ubuntu-22.04, windows-2022, macos-14]
2020

2121
runs-on: ${{ matrix.os }}
2222

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Luis Blanco
3+
Copyright (c) 2025 Luis Blanco
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const webgl = require('webgl-raub');
3434
Here `webgl` contains the **WebGL** API, like a `WebGLRenderingContext` instance would. See
3535
[WebGLRenderingContext docs](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext)
3636
for reference, and [TypeScript definitions](/index.d.ts) for the full list of exports.
37+
There are also numerous non-WebGL methods exported in case you want to use advanced OpenGL functions.
3738

3839
To use browser **WebGL** libs, like [three.js](https://threejs.org/),
3940
several additional interfaces must also be provided to mimic the browser.

core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { getBin, createLogger } = require('addon-tools-raub');
66

77
createLogger({ name: 'webgl' });
88

9-
const core = require(`./${getBin()}/webgl`);
9+
const core = require(`./${getBin()}/webgl.node`);
1010

1111

1212
module.exports = core;

eslint.config.js

Lines changed: 1 addition & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,3 @@
11
'use strict';
22

3-
const js = require('@eslint/js');
4-
5-
6-
module.exports = [
7-
{
8-
ignores: ['examples/libs']
9-
},
10-
js.configs.recommended,
11-
{
12-
languageOptions: {
13-
'parserOptions': {
14-
'ecmaVersion': 2022,
15-
sourceType: 'commonjs'
16-
},
17-
globals: {
18-
global: 'readonly',
19-
require: 'readonly',
20-
Buffer: 'readonly',
21-
module: 'readonly',
22-
console: 'readonly',
23-
__dirname: 'readonly',
24-
process: 'readonly',
25-
setTimeout: 'readonly',
26-
setImmediate: 'readonly',
27-
clearImmediate: 'readonly',
28-
},
29-
},
30-
'rules': {
31-
'arrow-parens': ['error', 'always'],
32-
'no-trailing-spaces': [
33-
'error',
34-
{
35-
'skipBlankLines': true
36-
}
37-
],
38-
'indent': [
39-
'error',
40-
'tab',
41-
{
42-
'SwitchCase': 1
43-
}
44-
],
45-
'operator-linebreak': [
46-
'error',
47-
'after',
48-
{
49-
'overrides': {
50-
'?': 'before',
51-
':': 'before'
52-
}
53-
}
54-
],
55-
'max-len': ['error', 110],
56-
'quotes': [
57-
'error',
58-
'single'
59-
],
60-
'semi': [
61-
'error',
62-
'always'
63-
],
64-
'no-multiple-empty-lines': ['error', { 'max': 3, 'maxEOF': 1, 'maxBOF': 1 }],
65-
'keyword-spacing': ['error', { 'before': true, 'after': true }],
66-
'space-before-blocks': ['error'],
67-
'space-before-function-paren': [
68-
'error', {'anonymous': 'always', 'named': 'never', 'asyncArrow': 'always'}
69-
],
70-
'camelcase': ['error'],
71-
'no-tabs': [0],
72-
'no-unused-vars': [
73-
'error',
74-
{
75-
'argsIgnorePattern': '^_',
76-
'varsIgnorePattern': '^_',
77-
'caughtErrorsIgnorePattern': '^_'
78-
}
79-
],
80-
'global-require': [0],
81-
'no-underscore-dangle': [0],
82-
'no-plusplus': [0],
83-
'no-shadow': [0],
84-
'node/no-unpublished-require': [0],
85-
'no-process-exit': [0],
86-
'linebreak-style': [0],
87-
'node/no-missing-require': [0],
88-
'no-console': [0],
89-
'node/no-unsupported-features/es-builtins': 0,
90-
'node/no-unsupported-features/node-builtins': 0,
91-
'func-names': [
92-
'error',
93-
'never',
94-
{
95-
'generators': 'never'
96-
}
97-
]
98-
}
99-
},
100-
];
3+
module.exports = require('addon-tools-raub/utils/eslint-common');

examples/cube.js

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ const { mat4 } = require('./libs/glMatrix-0.9.5.min');
88

99
Document.setWebgl(webgl);
1010
const document = new Document({ vsync: true, autoEsc: true });
11-
webgl.canvas = document;
12-
const frame = document.requestAnimationFrame;
1311

1412
let xRot = 0;
1513
let xSpeed = 5;
@@ -342,45 +340,22 @@ const drawScene = () => {
342340
};
343341

344342

345-
let lastTime = 0;
346-
// let fps = 0;
347-
348-
const animate = (timeNow) => {
349-
if (lastTime) {
350-
351-
const elapsed = timeNow - lastTime;
352-
// fps = Math.round(1000 / elapsed);
353-
354-
xRot += (xSpeed * elapsed) / 1000.0;
355-
yRot += (ySpeed * elapsed) / 1000.0;
356-
357-
}
358-
359-
lastTime = timeNow;
343+
const animate = () => {
344+
xRot = (xSpeed * Date.now()) * 0.001;
345+
yRot = (ySpeed * Date.now()) * 0.001;
360346
};
361347

362348

363-
const tick = (timeNow) => {
364-
drawScene();
365-
animate(timeNow);
366-
367-
gl.finish(); // for timing
368-
frame(tick, 0);
369-
};
349+
initContext(document);
350+
initShaders();
351+
initBuffers();
370352

353+
gl.clearColor(255, 0, 0, 1);
354+
gl.enable(gl.DEPTH_TEST);
371355

372-
const start = () => {
373-
const canvas = document.createElement('canvas');
374-
375-
initContext(canvas);
376-
initShaders();
377-
initBuffers();
378-
379-
gl.clearColor(255, 0, 0, 1);
380-
gl.enable(gl.DEPTH_TEST);
381-
382-
tick(Date.now());
356+
const tick = (timeNow) => {
357+
animate();
358+
drawScene();
359+
document.requestAnimationFrame(tick);
383360
};
384-
385-
start();
386-
361+
document.requestAnimationFrame(tick);

examples/package-lock.json

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"main": "lesson05.js",
66
"dependencies": {
7-
"glfw-raub": "^6.0.0",
8-
"image-raub": "^5.0.0"
7+
"glfw-raub": "^6.1.0",
8+
"image-raub": "^5.1.0"
99
}
1010
}

0 commit comments

Comments
 (0)