aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/je_window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Graphics/je_window.cpp')
-rw-r--r--src/libjin/Graphics/je_window.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/libjin/Graphics/je_window.cpp b/src/libjin/Graphics/je_window.cpp
index 8c36c85..f0b789e 100644
--- a/src/libjin/Graphics/je_window.cpp
+++ b/src/libjin/Graphics/je_window.cpp
@@ -27,15 +27,15 @@ namespace JinEngine
return false;
const Setting* setting = (Setting*)s;
- size.w = setting->width;
- size.h = setting->height;
- fps = setting->fps;
+ mSize.w = setting->width;
+ mSize.h = setting->height;
+ mFps = setting->fps;
bool vsync = setting->vsync;
const char* title = setting->title;
- if (wnd)
+ if (mWnd)
{
- SDL_DestroyWindow(wnd);
+ SDL_DestroyWindow(mWnd);
SDL_FlushEvent(SDL_WINDOWEVENT);
}
@@ -62,14 +62,14 @@ namespace JinEngine
if (setting->fullscreen) flag |= SDL_WINDOW_FULLSCREEN;
if (setting->resizable) flag |= SDL_WINDOW_RESIZABLE;
- wnd = SDL_CreateWindow(title, wx, wy, size.w, size.h, flag);
- if (wnd == NULL)
+ mWnd = SDL_CreateWindow(title, wx, wy, mSize.w, mSize.h, flag);
+ if (mWnd == NULL)
return false;
- ctx = SDL_GL_CreateContext(wnd);
+ ctx = SDL_GL_CreateContext(mWnd);
if (ctx == NULL)
return false;
SDL_GL_SetSwapInterval(vsync ? 1 : 0);
- SDL_GL_MakeCurrent(wnd, ctx);
+ SDL_GL_MakeCurrent(mWnd, ctx);
// default configuration
gl.setClearColor(0, 0, 0, 0xff);
gl.pushColor(0xff, 0xff, 0xff, 0xff);
@@ -90,19 +90,19 @@ namespace JinEngine
gl.disable(GL_BLEND);
gl.disable(GL_TEXTURE_2D);
// close window
- SDL_DestroyWindow(wnd);
+ SDL_DestroyWindow(mWnd);
SDL_Quit();
}
void Window::swapBuffers()
{
- if (wnd)
- SDL_GL_SwapWindow(wnd);
+ if (mWnd)
+ SDL_GL_SwapWindow(mWnd);
}
void Window::setTitle(const char* title)
{
- SDL_SetWindowTitle(wnd, title);
+ SDL_SetWindowTitle(mWnd, title);
};
} // namespace Graphics