diff --git a/include/Camera.h b/include/Camera.h index 740f0ac..cb84706 100644 --- a/include/Camera.h +++ b/include/Camera.h @@ -1,7 +1,7 @@ #pragma once #include #include -#include "util.cpp" +#include "util.hpp" #include "Pub_Sub.h" class Camera : public VrEventSubscriber{ diff --git a/include/GL_Testing.h b/include/GL_Testing.h index c273574..5aeb8aa 100644 --- a/include/GL_Testing.h +++ b/include/GL_Testing.h @@ -1,6 +1,6 @@ #pragma once #include -#include +#include #include #ifdef _WIN32 diff --git a/include/LightController.h b/include/LightController.h index bf524c7..6d7b339 100644 --- a/include/LightController.h +++ b/include/LightController.h @@ -1,7 +1,7 @@ #pragma once #include #include -#include "util.cpp" +#include "util.hpp" #include "Pub_Sub.h" #include "raycaster/RayCaster.h" #include diff --git a/include/LightHandle.h b/include/LightHandle.h index 48c6df8..1846c5a 100644 --- a/include/LightHandle.h +++ b/include/LightHandle.h @@ -1,6 +1,6 @@ #pragma once #include -#include +#include #include #include "Pub_Sub.h" diff --git a/include/Map.h b/include/Map.h index e4c2d5c..e31d00b 100644 --- a/include/Map.h +++ b/include/Map.h @@ -8,7 +8,7 @@ #include #include #include -#include "util.cpp" +#include "util.hpp" #include #include #include diff --git a/include/util.cpp b/include/util.hpp similarity index 100% rename from include/util.cpp rename to include/util.hpp diff --git a/src/Old_Map.cpp b/src/Old_Map.cpp index 9ff9b9e..4d383a5 100644 --- a/src/Old_Map.cpp +++ b/src/Old_Map.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "util.cpp" +#include "util.hpp" #include #include diff --git a/src/Ray.cpp b/src/Ray.cpp index 31820bc..1709da7 100644 --- a/src/Ray.cpp +++ b/src/Ray.cpp @@ -2,7 +2,7 @@ #include #include "Map.h" #include -#include "util.cpp" +#include "util.hpp" Ray::Ray( Map *map, diff --git a/src/main.cpp b/src/main.cpp index 32077ec..9968a84 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,7 +23,7 @@ #endif #pragma once -#include "util.cpp" +#include "util.hpp" #include #include #include @@ -104,6 +104,7 @@ int main() { sf::RenderWindow window(sf::VideoMode(WINDOW_X, WINDOW_Y), "SFML"); window.setMouseCursorVisible(false); window.setKeyRepeatEnabled(false); + window.setFramerateLimit(60); ImGui::SFML::Init(window); window.resetGLStates(); @@ -168,14 +169,6 @@ int main() { // ========== DEBUG ========== fps_counter fps; - fps.set_position(sf::Vector2f(WINDOW_X - 200, WINDOW_Y - 100)); - - sf::Vector2f *dp = camera->get_direction_pointer(); - debug_text cam_text_x(1, 30, &dp->x, "incli: "); - debug_text cam_text_y(2, 30, &dp->y, "asmth: "); - debug_text cam_text_pos_x(3, 30, &camera->get_position_pointer()->x, "x: "); - debug_text cam_text_pos_y(4, 30, &camera->get_position_pointer()->y, "y: "); - debug_text cam_text_pos_z(5, 30, &camera->get_position_pointer()->z, "z: "); // =========================== Input input_handler; @@ -246,23 +239,40 @@ int main() { // Run the raycast raycaster->compute(); - window.clear(sf::Color::Black); - raycaster->draw(&window); // Give the frame counter the frame time and draw the average frame time fps.frame(delta_time); fps.draw(); - cam_text_x.draw(&window); - cam_text_y.draw(&window); + ImGui::Begin("Camera"); + + ImGui::Columns(2); + + ImGui::Text("Camera Inclination"); + ImGui::Text("Camera Azimuth"); + ImGui::Text("Camera Pos_X"); + ImGui::Text("Camera Poz_Y"); + ImGui::Text("Camera Poz_Z"); + + ImGui::NextColumn(); + + sf::Vector2f dir = camera->get_direction(); + sf::Vector3f pos = camera->get_position(); - cam_text_pos_x.draw(&window); - cam_text_pos_y.draw(&window); - cam_text_pos_z.draw(&window); + ImGui::Text(std::to_string(dir.x).c_str()); + ImGui::Text(std::to_string(dir.y).c_str()); + ImGui::Text(std::to_string(pos.x).c_str()); + ImGui::Text(std::to_string(pos.y).c_str()); + ImGui::Text(std::to_string(pos.z).c_str()); + + ImGui::End(); ImGui::Render(); + + + window.draw(sf::CircleShape(0)); window.display(); }