File tree Expand file tree Collapse file tree 11 files changed +404
-316
lines changed
Expand file tree Collapse file tree 11 files changed +404
-316
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ include_directories(polymer PRIVATE ..)
2727
2828if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
2929 # Ignore VMA nullability warnings
30- set (CMAKE_CXX_FLAGS "${CMAKE_CPP_FLAGS} -Wno-nullability-completeness -Wplacement-new= " )
30+ set (CMAKE_CXX_FLAGS "${CMAKE_CPP_FLAGS} -Wno-nullability-completeness" )
3131endif ()
3232
3333if (UNIX )
Original file line number Diff line number Diff line change 44#include < polymer/asset/asset_system.h>
55#include < polymer/camera.h>
66#include < polymer/connection.h>
7+ #include < polymer/input.h>
78#include < polymer/render/block_mesher.h>
89#include < polymer/render/chunk_renderer.h>
910#include < polymer/render/font_renderer.h>
@@ -17,18 +18,6 @@ namespace polymer {
1718
1819struct MemoryArena ;
1920
20- // TODO: Make this more advanced
21- struct InputState {
22- bool forward;
23- bool backward;
24- bool left;
25- bool right;
26- bool climb;
27- bool fall;
28- bool sprint;
29- bool display_players;
30- };
31-
3221struct Player {
3322 char name[17 ];
3423 char uuid[16 ];
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ namespace polymer {
4+
5+ // TODO: Make this more advanced
6+ struct InputState {
7+ bool forward;
8+ bool backward;
9+ bool left;
10+ bool right;
11+ bool climb;
12+ bool fall;
13+ bool sprint;
14+ bool display_players;
15+ };
16+
17+ } // namespace polymer
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ struct ArgParser {
6262 static ArgParser Parse (int argc, char * argv[]) {
6363 ArgParser result = {};
6464
65- for (int i = 0 ; i < argc; ++i) {
65+ for (int i = 0 ; i < argc && i < polymer_array_count (args) ; ++i) {
6666 char * current = argv[i];
6767
6868 if (current[0 ] == ' -' ) {
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ #include < polymer/math.h>
4+ #include < polymer/render/vulkan.h>
5+
6+ namespace polymer {
7+
8+ using PolymerWindow = void *;
9+
10+ struct ExtensionRequest {
11+ const char ** extensions;
12+ u32 extension_count = 0 ;
13+
14+ const char ** device_extensions;
15+ u32 device_extension_count = 0 ;
16+
17+ const char ** validation_layers;
18+ u32 validation_layer_count = 0 ;
19+ };
20+
21+ using PlatformGetPlatformName = const char * (*)();
22+
23+ using PlatformWindowCreate = PolymerWindow (*)(int width, int height);
24+ using PlatformWindowCreateSurface = bool (*)(PolymerWindow window, VkSurfaceKHR* surface);
25+ using PlatformWindowGetRect = IntRect (*)(PolymerWindow window);
26+ using PlatformWindowPump = void (*)(PolymerWindow window);
27+
28+ using PlatformGetExtensionRequest = ExtensionRequest (*)();
29+
30+ struct Platform {
31+ PlatformGetPlatformName GetPlatformName;
32+
33+ PlatformWindowCreate WindowCreate;
34+ PlatformWindowCreateSurface WindowCreateSurface;
35+ PlatformWindowGetRect WindowGetRect;
36+ PlatformWindowPump WindowPump;
37+
38+ PlatformGetExtensionRequest GetExtensionRequest;
39+ };
40+
41+ } // namespace polymer
You can’t perform that action at this time.
0 commit comments