|
7 | 7 |
|
8 | 8 | #include <stdio.h>
|
9 | 9 | #include <assert.h>
|
| 10 | +#include <stdint.h> |
10 | 11 | #include <emscripten/emscripten.h>
|
11 | 12 | #include <GL/glut.h>
|
12 | 13 |
|
13 | 14 | typedef struct {
|
14 |
| - int width; |
15 |
| - int height; |
| 15 | + int32_t width; |
| 16 | + int32_t height; |
16 | 17 | } rect_size_t;
|
17 | 18 |
|
18 | 19 | static rect_size_t browser_window_size = { 0, 0 };
|
@@ -47,18 +48,18 @@ int equal_size(rect_size_t rect_1, rect_size_t rect_2) {
|
47 | 48 | /**
|
48 | 49 | * Obtain various dimensions
|
49 | 50 | */
|
50 |
| -EM_JS(void, get_browser_window_size, (int* width, int* height), { |
| 51 | +EM_JS(void, get_browser_window_size, (int32_t* width, int32_t* height), { |
51 | 52 | setValue(width, window.innerWidth, 'i32');
|
52 | 53 | setValue(height, window.innerHeight, 'i32');
|
53 | 54 | });
|
54 | 55 |
|
55 |
| -EM_JS(void, get_canvas_client_size, (int* width, int* height), { |
| 56 | +EM_JS(void, get_canvas_client_size, (int32_t* width, int32_t* height), { |
56 | 57 | const canvas = Module.canvas;
|
57 | 58 | setValue(width, canvas.clientWidth, 'i32');
|
58 | 59 | setValue(height, canvas.clientHeight, 'i32');
|
59 | 60 | });
|
60 | 61 |
|
61 |
| -EM_JS(void, get_canvas_size, (int* width, int* height), { |
| 62 | +EM_JS(void, get_canvas_size, (int32_t* width, int32_t* height), { |
62 | 63 | const canvas = Module.canvas;
|
63 | 64 | setValue(width, canvas.width, 'i32');
|
64 | 65 | setValue(height, canvas.height, 'i32');
|
@@ -176,8 +177,8 @@ void start_tests() {
|
176 | 177 | * Reshape callback - record latest size, verify and run next test if async
|
177 | 178 | */
|
178 | 179 | void reshape(int w, int h) {
|
179 |
| - glut_reshape_size.width = w; |
180 |
| - glut_reshape_size.height = h; |
| 180 | + glut_reshape_size.width = (int32_t)w; |
| 181 | + glut_reshape_size.height = (int32_t)h; |
181 | 182 |
|
182 | 183 | if (run_async_verification) {
|
183 | 184 | run_async_verification = 0; /* Only one verification per test */
|
|
0 commit comments