window create now accepts flags as parameter

This commit is contained in:
2026-04-10 15:48:11 +02:00
parent d28dbc1083
commit daefc73de7
2 changed files with 8 additions and 2 deletions

View File

@@ -12,9 +12,14 @@ namespace SakuraVNE {
Window::Window(const WindowData &data) : m_Data(data) {} Window::Window(const WindowData &data) : m_Data(data) {}
Window::~Window() { Destroy(); } Window::~Window() { Destroy(); }
void Window::Create() { void Window::Create(std::span<const SDL_WindowFlags> flags) {
// TODO: maybe get an unknow amount of parameters / an array of window flags? or just provide a seperate function for it // TODO: maybe get an unknow amount of parameters / an array of window flags? or just provide a seperate function for it
SDL_WindowFlags windowFlags = (SDL_WindowFlags)(SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY); SDL_WindowFlags windowFlags = (SDL_WindowFlags)(SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY);
for (auto &flag : flags) {
windowFlags |= flag;
}
m_Handle = SDL_CreateWindow(m_Data.title.c_str(), m_Data.width, m_Data.height, windowFlags); m_Handle = SDL_CreateWindow(m_Data.title.c_str(), m_Data.width, m_Data.height, windowFlags);
if (!m_Handle) { if (!m_Handle) {

View File

@@ -5,6 +5,7 @@
#include "imgui_impl_sdl3.h" #include "imgui_impl_sdl3.h"
#include <cstdint> #include <cstdint>
#include <functional> #include <functional>
#include <span>
#include <string> #include <string>
namespace SakuraVNE { namespace SakuraVNE {
@@ -26,7 +27,7 @@ public:
Window(const WindowData &data = WindowData()); Window(const WindowData &data = WindowData());
~Window(); ~Window();
void Create(); void Create(std::span<const SDL_WindowFlags> flags = {});
void Destroy(); void Destroy();
void Update(); void Update();