#pragma once #ifdef linux #include #include #elif defined _WIN32 // Good lord, windows.h overwrote the std::min() max() definitions #define NOMINMAX #include // As if hardware is ever going to move away from 1.2 #define CL_USE_DEPRECATED_OPENCL_1_2_APIS #include #include #elif defined TARGET_OS_MAC #include #include #include #include #include #endif #include "util.hpp" #include #include "map/Old_Map.h" #include "CLCaster.h" #include "Camera.h" #include "Input.h" #include "LightController.h" #include "LightHandle.h" #include "map/Map.h" // Srsly people who macro error codes are the devil #undef ERROR #include "Logger.h" class Application { public: const int WINDOW_X = 1536; const int WINDOW_Y = 1024; const int MAP_X = 256; const int MAP_Y = 256; const int MAP_Z = 256; Application(); ~Application(); bool init_clcaster(); bool init_events(); bool game_loop(); private: static float elap_time(); sf::Sprite window_sprite; sf::Texture window_texture; sf::Texture spritesheet; std::shared_ptr window; std::shared_ptr map; std::shared_ptr camera; std::shared_ptr raycaster; std::shared_ptr light_handle; std::shared_ptr light_controller; Input input_handler; std::shared_ptr window_handler; // The sfml imgui wrapper I'm using requires Update be called with sf::Time // Might modify it to also accept seconds sf::Clock sf_delta_clock; fps_counter fps; // vars for us to use with ImGUI float light_color[4] = { 0, 0, 0, 0 }; float light_pos[4] = { 100, 100, 30 }; char screenshot_buf[128]{ 0 }; bool paused = false; float camera_speed = 1.0; // Game loop values float step_size = 0.0166f; double frame_time = 0.0, elapsed_time = 0.0, delta_time = 0.0, accumulator_time = 0.0, current_time = 0.0; };