summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/window/window_impl_sdl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/modules/asura-core/window/window_impl_sdl.cpp')
-rw-r--r--source/modules/asura-core/window/window_impl_sdl.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/source/modules/asura-core/window/window_impl_sdl.cpp b/source/modules/asura-core/window/window_impl_sdl.cpp
index 2679bc1..29a7540 100644
--- a/source/modules/asura-core/window/window_impl_sdl.cpp
+++ b/source/modules/asura-core/window/window_impl_sdl.cpp
@@ -21,15 +21,15 @@ namespace AsuraEngine
flag |= _sdl_flag
WindowImplSDL::WindowImplSDL()
- : mWnd(nullptr)
- , mGLContext(0)
+ : m_Wnd(nullptr)
+ , m_GLContext(0)
{
}
WindowImplSDL::~WindowImplSDL()
{
- SDL_GL_DeleteContext(mGLContext);
- SDL_DestroyWindow(mWnd);
+ SDL_GL_DeleteContext(m_GLContext);
+ SDL_DestroyWindow(m_Wnd);
SDL_FlushEvent(SDL_WINDOWEVENT);
}
@@ -65,9 +65,9 @@ namespace AsuraEngine
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 0);
- mWnd = SDL_CreateWindow(config.title.c_str(), config.x, config.y, config.width, config.height, flag);
+ m_Wnd = SDL_CreateWindow(config.title.c_str(), config.x, config.y, config.width, config.height, flag);
- if (!mWnd)
+ if (!m_Wnd)
return false;
// ͼ
@@ -96,7 +96,7 @@ namespace AsuraEngine
img->Unlock();
- SDL_SetWindowIcon(mWnd, surface);
+ SDL_SetWindowIcon(m_Wnd, surface);
SDL_FreeSurface(surface);
}
}
@@ -105,15 +105,15 @@ namespace AsuraEngine
{
}
- mGLContext = SDL_GL_CreateContext(mWnd);
+ m_GLContext = SDL_GL_CreateContext(m_Wnd);
- if (!mGLContext)
+ if (!m_GLContext)
{
- SDL_DestroyWindow(mWnd);
+ SDL_DestroyWindow(m_Wnd);
return false;
}
- SDL_GL_MakeCurrent(mWnd, mGLContext);
+ SDL_GL_MakeCurrent(m_Wnd, m_GLContext);
SDL_GL_SetSwapInterval(config.vsync ? 1 : 0);
return true;
@@ -121,32 +121,32 @@ namespace AsuraEngine
void WindowImplSDL::SetSize(uint width, uint height)
{
- SDL_SetWindowSize(mWnd, width, height);
+ SDL_SetWindowSize(m_Wnd, width, height);
}
void WindowImplSDL::SetPosition(int x, int y)
{
- SDL_SetWindowPosition(mWnd, x, y);
+ SDL_SetWindowPosition(m_Wnd, x, y);
}
void WindowImplSDL::SetTitils(const std::string& title)
{
- SDL_SetWindowTitle(mWnd, title.c_str());
+ SDL_SetWindowTitle(m_Wnd, title.c_str());
}
void WindowImplSDL::Show()
{
- SDL_ShowWindow(mWnd);
+ SDL_ShowWindow(m_Wnd);
}
void WindowImplSDL::Hide()
{
- SDL_HideWindow(mWnd);
+ SDL_HideWindow(m_Wnd);
}
void WindowImplSDL::SwapRenderBuffer()
{
- SDL_GL_SwapWindow(mWnd);
+ SDL_GL_SwapWindow(m_Wnd);
}
}