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
|
2024-10-13 04:22:09 +02:00
|
|
|
#include <raylib.h>
|
|
|
|
|
#include <raymath.h>
|
|
|
|
|
|
2024-11-26 01:58:09 +01:00
|
|
|
#include "state.h"
|
2024-11-14 00:55:09 +01:00
|
|
|
#include "app-manager.h"
|
2024-11-02 15:52:16 +01:00
|
|
|
|
2024-10-09 02:01:23 +02:00
|
|
|
#include <cstdlib>
|
|
|
|
|
#include <stdio.h>
|
2024-11-02 15:52:16 +01:00
|
|
|
#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-13 04:22:09 +02:00
|
|
|
|
2024-10-26 16:31:23 +02:00
|
|
|
//ToggleFullscreen();
|
2024-11-26 01:58:09 +01:00
|
|
|
|
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-10-23 03:25:57 +02:00
|
|
|
|
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-10-25 02:43:41 +02:00
|
|
|
|
2024-11-14 00:55:09 +01:00
|
|
|
SetTargetFPS(state->settings.fps);
|
2024-10-13 04:22:09 +02:00
|
|
|
|
2024-11-26 01:58:09 +01:00
|
|
|
app.init();
|
|
|
|
|
app.ui.init();
|
2024-10-23 00:23:24 +02:00
|
|
|
|
2024-11-26 01:58:09 +01:00
|
|
|
app.loadState();
|
2024-11-06 15:35:25 +01:00
|
|
|
|
2024-11-26 01:58:09 +01:00
|
|
|
app.startSignals();
|
2024-11-08 01:43:06 +01:00
|
|
|
|
2024-10-13 04:22:09 +02:00
|
|
|
while(!WindowShouldClose()){
|
2024-11-26 01:58:09 +01:00
|
|
|
app.update();
|
|
|
|
|
app.draw();
|
2024-10-09 02:01:23 +02:00
|
|
|
}
|
|
|
|
|
|
2024-11-30 03:01:26 +01:00
|
|
|
app.close();
|
2024-11-02 23:12:38 +01:00
|
|
|
|
2024-10-13 04:22:09 +02:00
|
|
|
CloseWindow();
|
|
|
|
|
|
|
|
|
|
return 0;
|
2024-10-09 02:01:23 +02:00
|
|
|
}
|
|
|
|
|
|