aboutsummaryrefslogtreecommitdiff
path: root/src/render/window.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-05-16 19:19:03 +0800
committerchai <chaifix@163.com>2018-05-16 19:19:03 +0800
commitd45064be602c3becb046d86913ea8013774b0079 (patch)
tree5e2e995c2139b934ed50f75d0a31eae7180aab59 /src/render/window.cpp
parentfdaf0e7eb6b9d9bdd7d5ab5f814f4ebbf791ff67 (diff)
v0.1.0
Diffstat (limited to 'src/render/window.cpp')
-rw-r--r--src/render/window.cpp28
1 files changed, 4 insertions, 24 deletions
diff --git a/src/render/window.cpp b/src/render/window.cpp
index a12c92f..a929057 100644
--- a/src/render/window.cpp
+++ b/src/render/window.cpp
@@ -1,18 +1,14 @@
#include "window.h"
#include "libs/GLee/GLee.h"
#include "canvas.h"
+#include "utils/macros.h"
namespace jin
{
namespace render
{
- Window* Window::g_wnd = 0;
-
- Window* Window::get()
- {
- return (g_wnd ? g_wnd : (g_wnd = new Window()));
- }
-
+ shared Window* Window::g_wnd = 0;
+
Window::Window(): wnd(0), ctx(0)
{
}
@@ -44,7 +40,7 @@ namespace render
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
- Uint32 flags = SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL;
+ Uint32 flags = SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL ;
int wx = SDL_WINDOWPOS_UNDEFINED,
wy = SDL_WINDOWPOS_UNDEFINED;
@@ -83,21 +79,5 @@ namespace render
return ctx;
}
- int Window::getW()
- {
- return w;
- }
-
- int Window::getH()
- {
- return h;
- }
-
- void Window::swapBuffers()
- {
- if (wnd)
- SDL_GL_SwapWindow(wnd);
- }
-
}
} \ No newline at end of file