Compare commits

...

3 Commits

2 changed files with 13 additions and 4 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

@@ -1,10 +1,10 @@
#pragma once #pragma once
#include "Event.h" #include "Event.h"
#include "SDL3/SDL_events.h"
#include "SDL3/SDL_video.h" #include "SDL3/SDL_video.h"
#include "imgui_impl_sdl3.h"
#include <cstdint>
#include <functional> #include <functional>
#include <span>
#include <string> #include <string>
namespace SakuraVNE { namespace SakuraVNE {
@@ -26,10 +26,14 @@ 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();
// TODO: implement
void AddFlags(std::span<const SDL_WindowFlags> flags = {});
// TODO: implement
void RemoveFlags(std::span<const SDL_WindowFlags> flags = {});
void Resize(); void Resize();
void ProcessEvent(const SDL_Event &event); void ProcessEvent(const SDL_Event &event);