This commit is contained in:
Asuro
2025-02-08 18:54:09 +01:00
parent 149de529e6
commit aa18ffd1a5
8 changed files with 285 additions and 339 deletions

View File

@@ -1,7 +1,9 @@
#include "Setup.h"
#include "Log.h"
#include "SDL3/SDL_video.h"
#include "rendering/Rendering.h"
#include <cstdint>
#include <SDL3/SDL.h>
namespace Game
{
@@ -20,7 +22,29 @@ namespace Game
void Setup(void* window)
{
Log("Game Setup Start!");
Instance.Rendering.Setup(window);
if (!SDL_Init(SDL_INIT_VIDEO))
{
Log("Failed to init SDL!");
return;
}
SDL_Window* sdlWindow = SDL_CreateWindow("SDL", 1920, 1080, SDL_WINDOW_RESIZABLE | SDL_WINDOW_OPENGL);
if (sdlWindow == nullptr)
{
Log("Failed to init SDL Window!");
return;
}
auto props = SDL_GetWindowProperties(sdlWindow);
SDL_EnumerateProperties(props, [](void*, SDL_PropertiesID id, const char* name)
{
Log("Prop: %s", name);
}, nullptr);
void* hwnd = SDL_GetPointerProperty(props, "SDL.window.win32.hwnd", nullptr);
if (hwnd == nullptr)
{
Log("Failed to get window pointer!");
return;
}
Instance.Rendering.Setup(hwnd);
}
void Update()