summaryrefslogtreecommitdiff
path: root/src/platform/stub_platform.cc
blob: a177ab3c86ed8891d83bb1d3ce0053c80a025cdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Stub platform implementation for size measurement builds.
// All functions are no-ops. Binary compiles but does NOT run.
// This file is only compiled when STRIP_EXTERNAL_LIBS is defined.

#if defined(STRIP_EXTERNAL_LIBS)

#include "platform.h"
#include "stub_types.h"

// Forward declare GLFWwindow stub
struct GLFWwindow {};

PlatformState platform_init(bool fullscreen, int width, int height) {
  PlatformState state = {};
  state.width = width;
  state.height = height;
  state.aspect_ratio = (float)width / (float)height;
  state.window = nullptr;
  state.time = 0.0;
  state.is_fullscreen = fullscreen;
  return state;
}

void platform_shutdown(PlatformState* state) {
  (void)state;
}

void platform_poll(PlatformState* state) {
  (void)state;
}

bool platform_should_close(PlatformState* state) {
  (void)state;
  return false;
}

void platform_toggle_fullscreen(PlatformState* state) {
  (void)state;
}

WGPUSurface platform_create_wgpu_surface(WGPUInstance instance,
                                         PlatformState* state) {
  (void)instance;
  (void)state;
  return nullptr;
}

double platform_get_time() {
  return 0.0;
}

#endif // STRIP_EXTERNAL_LIBS