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_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) {
|
||||
Shutdown();
|
||||
return false;
|
||||
|
||||
@@ -11,10 +11,8 @@ namespace SakuraVNE {
|
||||
Window::Window(const WindowData &data) : m_Data(data) {}
|
||||
Window::~Window() { Destroy(); }
|
||||
|
||||
bool Window::Create(std::span<const SDL_WindowFlags> flags) {
|
||||
for (auto &flag : flags) {
|
||||
m_Flags |= flag;
|
||||
}
|
||||
bool Window::Create(const SDL_WindowFlags flags) {
|
||||
m_Flags |= flags;
|
||||
|
||||
m_Handle = SDL_CreateWindow(m_Data.title.c_str(), m_Data.width, m_Data.height, m_Flags);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace SakuraVNE {
|
||||
struct WindowData {
|
||||
std::span<const SDL_WindowFlags> windowFlags;
|
||||
SDL_WindowFlags windowFlags;
|
||||
std::string title = "Window Title";
|
||||
int width = 1280;
|
||||
int height = 720;
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
Window(const WindowData &data = WindowData());
|
||||
~Window();
|
||||
|
||||
bool Create(std::span<const SDL_WindowFlags> flags = {});
|
||||
bool Create(const SDL_WindowFlags flags = 0);
|
||||
void Destroy();
|
||||
|
||||
void Update();
|
||||
|
||||
Reference in New Issue
Block a user