Compare commits
3 Commits
d28dbc1083
...
e57149e9db
| Author | SHA1 | Date | |
|---|---|---|---|
| e57149e9db | |||
| 796769c6a4 | |||
| daefc73de7 |
@@ -12,9 +12,14 @@ namespace SakuraVNE {
|
||||
Window::Window(const WindowData &data) : m_Data(data) {}
|
||||
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
|
||||
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);
|
||||
|
||||
if (!m_Handle) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.h"
|
||||
#include "SDL3/SDL_events.h"
|
||||
#include "SDL3/SDL_video.h"
|
||||
#include "imgui_impl_sdl3.h"
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
|
||||
namespace SakuraVNE {
|
||||
@@ -26,10 +26,14 @@ public:
|
||||
Window(const WindowData &data = WindowData());
|
||||
~Window();
|
||||
|
||||
void Create();
|
||||
void Create(std::span<const SDL_WindowFlags> flags = {});
|
||||
void Destroy();
|
||||
|
||||
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 ProcessEvent(const SDL_Event &event);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user