#pragma once // As if hardware is ever going to move away from 1.2 #define CL_USE_DEPRECATED_OPENCL_1_2_APIS #ifdef linux #include #include #elif defined _WIN32 // Good lord, windows.h overwrote the std::min() max() definitions #define NOMINMAX #include #include #include #elif defined TARGET_OS_MAC #include #include #include #include #include #endif #pragma once #include #include #include "Camera.h" #include "Input.h" #include "LightController.h" #include "LightHandle.h" #include "map/Map.h" #include "util.hpp" #include "GraphTimer.h" // Srsly people who macro error codes are the devil #undef ERROR #include "Logger.h" class CLCaster; class Application { public: // static const int WINDOW_X = 1366; // static const int WINDOW_Y = 768; // static const int WINDOW_X = 500; // static const int WINDOW_Y = 500; static const int WINDOW_X = 50; static const int WINDOW_Y = 50; static const int MAP_X; static const int MAP_Y; static const int MAP_Z; 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; GraphTimer fps; 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; // 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; };