Hello, guys,
I am using irrlicht engine in iPhone using opengl es2, when I resize my view, the coordinate seems to be wrong.
Here are the following steps:
1. params.WindowSize = (160,240)
params.WindowId = theView
pDevice = createDeviceEx(params)
pDriver = pDevice->getDriver()
beginScene()
pDriver->draw2DImage(destRect(0, 20, 160, 200), sourceRect(0,0,160,200), texture)
endScene()
2. Then theView size is changed to (320,480) by the application,
and we call this api:
pDriver->onResize(320,480) //in iPhone 4, I also double the width and height for the retina display.
pDriver->draw2DImage(destRect(0,40,320,400), sourceRect(0,0,160,200))
As the described, I have both resize the driver and recalculated the texture's position to make it center in the y-axis.
However, the step2's result shows that the 2d image's position is completely wrong.
Is it possible to resize the view without recreated the device in the iPhone?
Thank you.
problems about resize view in iOS
Re: problems about resize view in iOS
Under iOS Irrlicht works in fullscreen mode with native device resolution. Params.WindowSize may be even (0,0). Why You need smaller window for Irrlicht in your iOS app? (all apps are fullscreen)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: problems about resize view in iOS
@Nadro,
I was not using irrlicht for game developing, there is a child view rendering the 3D model, while there are many other UI controls below the child view in the app's window.
If the view's size is not changed, it works, however, when it the size is changed, it failed to get the right position.
But in android, the rendering scene is scaled with the window size.
I was not using irrlicht for game developing, there is a child view rendering the 3D model, while there are many other UI controls below the child view in the app's window.
If the view's size is not changed, it works, however, when it the size is changed, it failed to get the right position.
But in android, the rendering scene is scaled with the window size.
Re: problems about resize view in iOS
Hmmm, in future i'll look again into windows size case on iOS, but currently I have other things to do in Irrlicht. You can change window behaviour by editing Irrlicht sources (CIrrDeviceiOS.mm and COGLES(1)Driver.cpp (only part related to window size)).
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes