Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
xorz57 committed Jan 25, 2024
1 parent 6b6dd62 commit b93914b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 8 additions & 0 deletions include/Application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

#include "SoftBody.hpp"

#include <SFML/System/String.hpp>
#include <SFML/System/Time.hpp>
#include <SFML/Window/ContextSettings.hpp>
#include <SFML/Window/VideoMode.hpp>
#include <SFML/Window/WindowStyle.hpp>

class Application {
public:
Expand All @@ -11,6 +15,10 @@ class Application {
void Run();

private:
sf::VideoMode mMode{600u, 600u};
sf::String mTitle{"ParticlePhysics"};
sf::Uint32 mStyle{sf::Style::Default};
sf::ContextSettings mSettings{24u, 8u, 8u, 3u, 3u};
glm::vec2 mGravitationalAcceleration{0.0f, 10.0f};
std::vector<SoftBody> mSoftBodies;
};
10 changes: 1 addition & 9 deletions src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
#include <SFML/Graphics/CircleShape.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/VertexArray.hpp>
#include <SFML/Window/ContextSettings.hpp>
#include <SFML/Window/Event.hpp>
#include <SFML/Window/VideoMode.hpp>
#include <SFML/Window/WindowStyle.hpp>

#define IMGUI_DEFINE_MATH_OPERATORS
#include <imgui-SFML.h>
Expand Down Expand Up @@ -56,12 +53,7 @@ void Application::FixedUpdate(const sf::Time &fixedDeltaTime) {
}

void Application::Run() {
sf::VideoMode mode{600u, 600u};
sf::String title{"ParticlePhysics"};
sf::Uint32 style{sf::Style::Default};
sf::ContextSettings settings{24u, 8u, 8u, 3u, 3u};

sf::RenderWindow window(mode, title, style, settings);
sf::RenderWindow window(mMode, mTitle, mStyle, mSettings);
window.setFramerateLimit(120u);

sf::View view = window.getDefaultView();
Expand Down

0 comments on commit b93914b

Please sign in to comment.