mirror of https://github.com/axmolengine/axmol.git
issue #2808: refractor setFrameZoomFactor() access, change init() parameter
This commit is contained in:
parent
86306a842d
commit
0af0951c35
|
@ -43,15 +43,14 @@ public:
|
|||
virtual void swapBuffers();
|
||||
virtual void setFrameSize(float width, float height);
|
||||
virtual void setIMEKeyboardState(bool bOpen);
|
||||
|
||||
bool init(const char* viewName, float width, float height);
|
||||
/*
|
||||
*frameZoomFactor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop.
|
||||
*/
|
||||
bool init(const char* viewName, float width, float height, float frameZoomFactor = 1.0f);
|
||||
public:
|
||||
|
||||
//void resize(int width, int height);
|
||||
/*
|
||||
* Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop.
|
||||
*/
|
||||
void setFrameZoomFactor(float fZoomFactor);
|
||||
|
||||
float getFrameZoomFactor();
|
||||
//void centerWindow();
|
||||
|
||||
|
@ -68,7 +67,10 @@ public:
|
|||
/** @deprecated Use getInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static EGLView* sharedOpenGLView();
|
||||
protected:
|
||||
|
||||
/*
|
||||
* Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop.
|
||||
*/
|
||||
void setFrameZoomFactor(float fZoomFactor);
|
||||
private:
|
||||
bool _captured;
|
||||
bool _supportTouch;
|
||||
|
|
|
@ -158,12 +158,13 @@ EGLView::~EGLView()
|
|||
s_pEglView = nullptr;
|
||||
}
|
||||
|
||||
bool EGLView::init(const char *viewName, float width, float height)
|
||||
bool EGLView::init(const char *viewName, float width, float height, float frameZoomFactor)
|
||||
{
|
||||
if(nullptr != _mainWindow) return true;
|
||||
|
||||
setViewName(viewName);
|
||||
setFrameSize(width, height);
|
||||
setFrameZoomFactor(frameZoomFactor);
|
||||
|
||||
glfwWindowHint(GLFW_RESIZABLE,GL_FALSE);
|
||||
_mainWindow = glfwCreateWindow(_screenSize.width * _frameZoomFactor, _screenSize.height * _frameZoomFactor, _viewName, nullptr, nullptr);
|
||||
|
|
Loading…
Reference in New Issue