You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
801 B
40 lines
801 B
#pragma once |
|
|
|
#include "mouse.hpp" |
|
#include "window.hpp" |
|
#include "cloth.hpp" |
|
#include <SDL2/SDL_render.h> |
|
|
|
struct App_config { |
|
const char* win_name; |
|
Vec2 window_dimensions; |
|
Vec2 cloth_startpos; |
|
Vec2 cloth_dimensions; |
|
unsigned int cloth_spacing; |
|
Vec2f gravity; |
|
float efficiency_factor; |
|
float friction_factor; |
|
float timestep; |
|
float cursor_radius; |
|
RGB background_color; |
|
RGB point_color; |
|
RGB point_selected_color; |
|
RGB connection_color; |
|
}; |
|
|
|
struct App { |
|
bool is_running; |
|
bool paused; |
|
App_config conf; |
|
Mouse* mouse; |
|
Window* window; |
|
Cloth* cloth; |
|
}; |
|
|
|
App* app_init(App_config conf); |
|
|
|
void app_update(App* app); |
|
void app_handle_input(App* app); |
|
void app_render(App* app); |
|
void destroy_app(App* app); |
|
void toggle_pause(App* app); |