changed the type of the windowflags in windowdata struct and window create function argument
This commit is contained in:
@@ -50,7 +50,7 @@ bool Application::Init() {
|
|||||||
|
|
||||||
m_AppData.windowdata.eventCallback = [this](Event &event) { RaiseEvent(event); };
|
m_AppData.windowdata.eventCallback = [this](Event &event) { RaiseEvent(event); };
|
||||||
m_Window.push_back(std::make_shared<Window>(m_AppData.windowdata));
|
m_Window.push_back(std::make_shared<Window>(m_AppData.windowdata));
|
||||||
bool isSuccessful = m_Window[0]->Create();
|
bool isSuccessful = m_Window[0]->Create({m_AppData.windowdata.windowFlags});
|
||||||
if (!isSuccessful) {
|
if (!isSuccessful) {
|
||||||
Shutdown();
|
Shutdown();
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -11,10 +11,8 @@ namespace SakuraVNE {
|
|||||||
Window::Window(const WindowData &data) : m_Data(data) {}
|
Window::Window(const WindowData &data) : m_Data(data) {}
|
||||||
Window::~Window() { Destroy(); }
|
Window::~Window() { Destroy(); }
|
||||||
|
|
||||||
bool Window::Create(std::span<const SDL_WindowFlags> flags) {
|
bool Window::Create(const SDL_WindowFlags flags) {
|
||||||
for (auto &flag : flags) {
|
m_Flags |= flags;
|
||||||
m_Flags |= flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_Handle = SDL_CreateWindow(m_Data.title.c_str(), m_Data.width, m_Data.height, m_Flags);
|
m_Handle = SDL_CreateWindow(m_Data.title.c_str(), m_Data.width, m_Data.height, m_Flags);
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
namespace SakuraVNE {
|
namespace SakuraVNE {
|
||||||
struct WindowData {
|
struct WindowData {
|
||||||
std::span<const SDL_WindowFlags> windowFlags;
|
SDL_WindowFlags windowFlags;
|
||||||
std::string title = "Window Title";
|
std::string title = "Window Title";
|
||||||
int width = 1280;
|
int width = 1280;
|
||||||
int height = 720;
|
int height = 720;
|
||||||
@@ -27,7 +27,7 @@ public:
|
|||||||
Window(const WindowData &data = WindowData());
|
Window(const WindowData &data = WindowData());
|
||||||
~Window();
|
~Window();
|
||||||
|
|
||||||
bool Create(std::span<const SDL_WindowFlags> flags = {});
|
bool Create(const SDL_WindowFlags flags = 0);
|
||||||
void Destroy();
|
void Destroy();
|
||||||
|
|
||||||
void Update();
|
void Update();
|
||||||
|
|||||||
Reference in New Issue
Block a user