From 7243b00cad9239a842ac1a66adc343e9c6fe2993 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 2 Jun 2016 15:46:22 +0800 Subject: [PATCH] add a new create method to create resizable window --- cocos/platform/desktop/CCGLViewImpl-desktop.cpp | 7 ++++++- cocos/platform/desktop/CCGLViewImpl-desktop.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cocos/platform/desktop/CCGLViewImpl-desktop.cpp b/cocos/platform/desktop/CCGLViewImpl-desktop.cpp index 40e1a563bd..424a212ce1 100644 --- a/cocos/platform/desktop/CCGLViewImpl-desktop.cpp +++ b/cocos/platform/desktop/CCGLViewImpl-desktop.cpp @@ -299,9 +299,14 @@ GLViewImpl::~GLViewImpl() } GLViewImpl* GLViewImpl::create(const std::string& viewName) +{ + return GLViewImpl::create(viewName, false); +} + +GLViewImpl* GLViewImpl::create(const std::string& viewName, bool resizable) { auto ret = new (std::nothrow) GLViewImpl; - if(ret && ret->initWithRect(viewName, Rect(0, 0, 960, 640), 1.0f, false)) { + if(ret && ret->initWithRect(viewName, Rect(0, 0, 960, 640), 1.0f, resizable)) { ret->autorelease(); return ret; } diff --git a/cocos/platform/desktop/CCGLViewImpl-desktop.h b/cocos/platform/desktop/CCGLViewImpl-desktop.h index 24061f2767..e44ef40bca 100644 --- a/cocos/platform/desktop/CCGLViewImpl-desktop.h +++ b/cocos/platform/desktop/CCGLViewImpl-desktop.h @@ -57,6 +57,7 @@ class CC_DLL GLViewImpl : public GLView { public: static GLViewImpl* create(const std::string& viewName); + static GLViewImpl* create(const std::string& viewName, bool resizable); static GLViewImpl* createWithRect(const std::string& viewName, Rect size, float frameZoomFactor = 1.0f, bool resizable = false); static GLViewImpl* createWithFullScreen(const std::string& viewName); static GLViewImpl* createWithFullScreen(const std::string& viewName, const GLFWvidmode &videoMode, GLFWmonitor *monitor);