Simulant  21.12-1292
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
platform.h
1 #pragma once
2 
3 #include "../../platform.h"
4 #include <SDL.h>
5 
6 namespace smlt {
7 
8 class OSXPlatform : public Platform {
9 public:
10  std::string name() const override {
11  return "osx";
12  }
13 
14  Resolution native_resolution() const override {
15  SDL_DisplayMode mode;
16 
17  Resolution native;
18  if(SDL_GetDesktopDisplayMode(0, &mode) == -1) {
19  S_WARN("Unable to get the current desktop display mode!!");
20  S_WARN("{0}", SDL_GetError());
21  S_WARN("Falling back to 1080p");
22  native.width = 1920;
23  native.height = 1080;
24  native.refresh_rate = 60;
25  } else {
26  native.width = mode.w;
27  native.height = mode.h;
28  native.refresh_rate = mode.refresh_rate;
29  }
30  return native;
31  }
32 
33  uint64_t available_ram_in_bytes() const override {
34  return MEMORY_VALUE_UNAVAILABLE;
35  }
36 
37  uint64_t total_ram_in_bytes() const override {
38  return MEMORY_VALUE_UNAVAILABLE;
39  }
40 
41  uint64_t available_vram_in_bytes() const override {
42  return MEMORY_VALUE_UNAVAILABLE;
43  }
44 
45  uint64_t process_ram_usage_in_bytes(ProcessID process_id) const override {
46  _S_UNUSED(process_id);
47  return MEMORY_VALUE_UNAVAILABLE;
48  }
49 };
50 
51 }
smlt::OSXPlatform
Definition: platform.h:8
smlt
Definition: animation.cpp:25
smlt::Platform
Definition: platform.h:18
smlt::Resolution
Definition: platform.h:10