Hi @slackmoehrle, @huanxinyin I get a new problem regarding resizing windows after updating to 2.4.
In 1.8.2 I made changes in CCGLViewImpl-desktop.cpp
file in this function for different size of windows
static void onGLFWWindowSizeFunCallback(GLFWwindow *window, int width, int height)
{
if (_view){
cocos2d::Size screenSize = cocos2d::Size::ZERO;
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
if (nullptr != monitor) {
const GLFWvidmode* videoMode = glfwGetVideoMode(monitor);
screenSize = cocos2d::Size(videoMode->width, videoMode->height);
}
int w = screenSize.width/2.036;
int h = screenSize.height/2.236;
if (width <= w || height <=h)
{
width = w;
height = h;
}
else if (width <= (screenSize.width/1.9) || height <= (screenSize.height/2.1)){
width = screenSize.width/1.92;
height = screenSize.height/2.105;
}else if(width >= screenSize.width || height >= screenSize.height){
width = screenSize.width/1.0052;
height = screenSize.height/1.103;
}_view->onGLFWWindowSizeFunCallback(window, width, height);
}
}
But in 2.4 CCGLView-desktop.cpp
there is this function
void GLView::onGLFWWindowSizeFunCallback(GLFWwindow *window, int width, int height)
{
int targetWidth = width * _scale, targetHeight = height * _scale;
Application::getInstance()->updateViewSize(targetWidth, targetHeight);
EventDispatcher::dispatchResizeEvent(targetWidth, targetHeight);
}
If I give different width and height to this function as I have done in 1.8.2, it is not working. Please provide a proper solution for this issue.