70 lines
1.2 KiB
C++
70 lines
1.2 KiB
C++
/*
|
|
*
|
|
* VISEQ - The Visual Sequencer
|
|
* 2024 Sebastian Kujas
|
|
*
|
|
*/
|
|
|
|
#define RAYGUI_IMPLEMENTATION
|
|
#include <raylib.h>
|
|
#include <raymath.h>
|
|
|
|
#include "state.h"
|
|
#include "app-manager.h"
|
|
|
|
#include <cstdlib>
|
|
#include <stdio.h>
|
|
#include <memory>
|
|
|
|
VISEQ::APP::AppManager app;
|
|
|
|
std::shared_ptr<VISEQ::APP::State> state = VISEQ::APP::State::get();
|
|
|
|
int main(){
|
|
|
|
srand(time(NULL));
|
|
|
|
InitWindow(1920, 1080, "VISEQ - The Visual Sequencer");
|
|
|
|
int current_monitor = GetCurrentMonitor();
|
|
int monitor_width = GetMonitorWidth(current_monitor);
|
|
int monitor_height = GetMonitorHeight(current_monitor);
|
|
|
|
SetWindowMonitor(current_monitor);
|
|
SetWindowState(FLAG_WINDOW_RESIZABLE);
|
|
|
|
SetWindowSize(monitor_width - 300, monitor_height - 300);
|
|
|
|
//ToggleFullscreen();
|
|
|
|
state->settings.fps = 60.0f;
|
|
state->settings.bpm = 120.0f;
|
|
state->settings.grid = 60.0f; // 120px for a 16th note
|
|
|
|
state->settings.speed = (state->settings.grid * 16.0f) * (state->settings.bpm / 120.f);
|
|
|
|
state->settings.width = monitor_width - 300;
|
|
state->settings.height = monitor_height - 300;
|
|
|
|
SetTargetFPS(state->settings.fps);
|
|
|
|
app.init();
|
|
app.ui.init();
|
|
|
|
app.loadState();
|
|
|
|
app.startSignals();
|
|
|
|
while(!WindowShouldClose()){
|
|
app.update();
|
|
app.draw();
|
|
}
|
|
|
|
app.close();
|
|
|
|
CloseWindow();
|
|
|
|
return 0;
|
|
}
|
|
|