Skip to content

Commit e5c263b

Browse files
committed
Adjust build
1 parent e448ef9 commit e5c263b

34 files changed

+105
-181
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
run: npm ci
6767

6868
- name: Ubuntu Install Wayland
69-
if: matrix.os == 'ubuntu-22.04'
69+
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-22.04-arm'
7070
run: sudo apt-get install -y libwayland-dev libgles2-mesa-dev
7171

7272
- name: Build Current Binary

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: npm ci
3838

3939
- name: Ubuntu Install Wayland
40-
if: matrix.os == 'ubuntu-22.04'
40+
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-22.04-arm'
4141
run: sudo apt-get install -y libwayland-dev libgles2-mesa-dev
4242

4343
- name: Build Current Binary

js/window.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class Window extends EventEmitter {
568568
_requestAnimationFrame(cb) {
569569
return setImmediate(() => {
570570
glfw.pollEvents();
571-
cb(Date.now());
571+
cb(performance.now());
572572
this.swapBuffers();
573573
});
574574
}

src/binding.gyp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,6 @@
99
'includes': ['../node_modules/addon-tools-raub/utils/common.gypi'],
1010
'sources': [
1111
'cpp/bindings.cpp',
12-
'cpp/glfw-clipboard.cpp',
13-
'cpp/glfw-console.cpp',
14-
'cpp/glfw-context.cpp',
15-
'cpp/glfw-cursor.cpp',
16-
'cpp/glfw-events.cpp',
17-
'cpp/glfw-info.cpp',
18-
'cpp/glfw-init.cpp',
19-
'cpp/glfw-input.cpp',
20-
'cpp/glfw-joystick.cpp',
21-
'cpp/glfw-monitors.cpp',
22-
'cpp/glfw-platform.cpp',
23-
'cpp/glfw-time.cpp',
24-
'cpp/glfw-timers.cpp',
25-
'cpp/glfw-version.cpp',
26-
'cpp/glfw-vulkan.cpp',
27-
'cpp/glfw-window.cpp',
2812
],
2913
'include_dirs': [
3014
'<(gl_include)',

src/cpp/bindings.cpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
#include "glfw-clipboard.hpp"
2-
#include "glfw-console.hpp"
3-
#include "glfw-context.hpp"
4-
#include "glfw-cursor.hpp"
5-
#include "glfw-events.hpp"
6-
#include "glfw-info.hpp"
7-
#include "glfw-init.hpp"
8-
#include "glfw-input.hpp"
9-
#include "glfw-joystick.hpp"
10-
#include "glfw-monitors.hpp"
11-
#include "glfw-platform.hpp"
12-
#include "glfw-time.hpp"
13-
#include "glfw-timers.hpp"
14-
#include "glfw-version.hpp"
15-
#include "glfw-vulkan.hpp"
16-
#include "glfw-window.hpp"
17-
1+
#include "glfw-clipboard.cpp"
2+
#include "glfw-console.cpp"
3+
#include "glfw-context.cpp"
4+
#include "glfw-cursor.cpp"
5+
#include "glfw-events.cpp"
6+
#include "glfw-info.cpp"
7+
#include "glfw-init.cpp"
8+
#include "glfw-input.cpp"
9+
#include "glfw-joystick.cpp"
10+
#include "glfw-monitors.cpp"
11+
#include "glfw-platform.cpp"
12+
#include "glfw-time.cpp"
13+
#include "glfw-timers.cpp"
14+
#include "glfw-version.cpp"
15+
#include "glfw-vulkan.cpp"
16+
#include "glfw-window.cpp"
1817

1918
#define JS_GLFW_CONSTANT(name) \
2019
exports.Set(#name, static_cast<double>(GLFW_ ## name));

src/cpp/glfw-clipboard.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ DBG_EXPORT JS_METHOD(setClipboardString) { NAPI_ENV; THIS_WINDOW;
88
REQ_STR_ARG(1, str);
99

1010
glfwSetClipboardString(window, str.c_str());
11-
RET_UNDEFINED;
11+
RET_GLFW_VOID;
1212
}
1313

1414

src/cpp/glfw-clipboard.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef _GLFW_CLIPBOARD_HPP_
2-
#define _GLFW_CLIPBOARD_HPP_
1+
#pragma once
32

43
#include "glfw-common.hpp"
54

@@ -8,6 +7,3 @@ namespace glfw {
87
DBG_EXPORT JS_METHOD(setClipboardString);
98
DBG_EXPORT JS_METHOD(getClipboardString);
109
} // namespace glfw
11-
12-
13-
#endif /* _GLFW_CLIPBOARD_HPP_ */

src/cpp/glfw-common.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef _GLFW_COMMON_HPP_
2-
#define _GLFW_COMMON_HPP_
1+
#pragma once
32

43
#include <addon-tools.hpp>
54

@@ -34,5 +33,9 @@
3433
#define STATE_ENV \
3534
Napi::Env env = state->emitter.Env();
3635

36+
#define RET_GLFW_VOID \
37+
return glfw::undefined;
3738

38-
#endif /* _GLFW_COMMON_HPP_ */
39+
namespace glfw {
40+
Napi::Value undefined;
41+
}

src/cpp/glfw-console.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44

55
namespace glfw {
66

7-
DBG_EXPORT JS_METHOD(hideConsole) { NAPI_ENV;
7+
DBG_EXPORT JS_METHOD(hideConsole) {
88
#ifdef _WIN32
99
auto wnd = FindWindowA("ConsoleWindowClass", nullptr);
1010
ShowWindow(wnd, 0);
1111
#endif
12-
RET_UNDEFINED;
12+
RET_GLFW_VOID;
1313
}
1414

15-
DBG_EXPORT JS_METHOD(showConsole) { NAPI_ENV;
15+
DBG_EXPORT JS_METHOD(showConsole) {
1616
#ifdef _WIN32
1717
auto wnd = FindWindowA("ConsoleWindowClass", nullptr);
1818
ShowWindow(wnd, 1);
1919
#endif
20-
RET_UNDEFINED;
20+
RET_GLFW_VOID;
2121
}
2222

2323
} // namespace glfw

src/cpp/glfw-console.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef _GLFW_CONSOLE_HPP_
2-
#define _GLFW_CONSOLE_HPP_
1+
#pragma once
32

43
#include "glfw-common.hpp"
54

@@ -8,6 +7,3 @@ namespace glfw {
87
DBG_EXPORT JS_METHOD(hideConsole);
98
DBG_EXPORT JS_METHOD(showConsole);
109
} // namespace glfw
11-
12-
13-
#endif /* _GLFW_CONSOLE_HPP_ */

0 commit comments

Comments
 (0)