Files
viseq/src/main.cpp
T

72 lines
1.3 KiB
C++
Raw Normal View History

2024-10-09 02:01:23 +02:00
/*
*
2024-11-04 19:28:12 +01:00
* VISEQ - The Visual Sequencer
2024-10-30 02:03:03 +01:00
* 2024 Sebastian Kujas
2024-10-09 02:01:23 +02:00
*
*/
2024-11-30 03:01:26 +01:00
2024-10-25 16:41:37 +02:00
#define RAYGUI_IMPLEMENTATION
#include <raylib.h>
#include <raymath.h>
#include "state.h"
2024-11-14 00:55:09 +01:00
#include "app-manager.h"
2024-10-09 02:01:23 +02:00
#include <cstdlib>
#include <stdio.h>
#include <cmath>
#include <memory>
2024-10-09 02:01:23 +02:00
2024-11-14 00:55:09 +01:00
VISEQ::APP::AppManager app;
2024-11-30 03:01:26 +01:00
2024-11-14 00:55:09 +01:00
std::shared_ptr<VISEQ::APP::State> state = VISEQ::APP::State::get();
2024-10-09 02:01:23 +02:00
int main(){
srand(time(NULL));
2024-11-01 14:08:27 +01:00
InitWindow(1920, 1080, "VISEQ - The Visual Sequencer");
2024-10-26 16:31:23 +02:00
int current_monitor = GetCurrentMonitor();
int monitor_width = GetMonitorWidth(current_monitor);
int monitor_height = GetMonitorHeight(current_monitor);
2024-10-25 16:41:37 +02:00
2024-10-26 16:31:23 +02:00
SetWindowMonitor(current_monitor);
SetWindowState(FLAG_WINDOW_RESIZABLE);
SetWindowSize(monitor_width - 300, monitor_height - 300);
2024-10-26 16:31:23 +02:00
//ToggleFullscreen();
2024-11-14 00:55:09 +01:00
state->settings.fps = 60.0f;
state->settings.bpm = 120.0f;
state->settings.grid = 60.0f; // 120px for a 16th note
2024-11-14 00:55:09 +01:00
state->settings.speed = (state->settings.grid * 16.0f) * (state->settings.bpm / 120.f);
2024-10-25 16:41:37 +02:00
2024-11-14 00:55:09 +01:00
state->settings.width = monitor_width - 300;
state->settings.height = monitor_height - 300;
2024-11-14 00:55:09 +01:00
SetTargetFPS(state->settings.fps);
app.init();
app.ui.init();
app.loadState();
2024-11-06 15:35:25 +01:00
app.startSignals();
2024-11-08 01:43:06 +01:00
while(!WindowShouldClose()){
app.update();
app.draw();
2024-10-09 02:01:23 +02:00
}
2024-11-30 03:01:26 +01:00
app.close();
CloseWindow();
return 0;
2024-10-09 02:01:23 +02:00
}