sdl
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user