-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
48 lines (35 loc) · 1.25 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <SDL3/SDL_main.h>
#include <utility/imgui_common.hpp>
#include <engine/audio.hpp>
#include <game/application.hpp>
#include <game/data/lobby_discovery.hpp>
int main(int, char*[])
{
Log("[INFO] Starting Game!");
SDLAbortIfFailed(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO));
Log("[INFO] Initialized SDL Successfully!");
SDLAbortIfFailed(Mix_Init(MIX_INIT_MP3 | MIX_INIT_OGG));
SDLAbortIfFailed(Mix_OpenAudio(0, nullptr));
Log("[INFO] Initialized SDL_Mixer Successfully!");
{
Application game {};
Log("[INFO] Initialized Game Successfully!");
imgui_shortcuts::InitSDL3(game.renderer.GetWindow(), game.renderer.GetRenderer());
Log("[INFO] Initialized ImGui Successfully!");
// Music music = Music::Create("assets/music/Retro_Platforming-David_Fesliyan.mp3").value();
// music.Start();
while (!game.close_game)
{
imgui_shortcuts::StartFrame();
game.HandleInput();
game.DoFrame();
imgui_shortcuts::EndFrame(game.renderer.GetRenderer());
SDL_RenderPresent(game.renderer.GetRenderer());
}
imgui_shortcuts::ShutdownSDL3();
}
Mix_CloseAudio();
Mix_Quit();
SDL_Quit();
return 0;
}