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