Windows Phone CCEGLView: bug and possible solution. Cocos 2.2.2

In my game I set resolution policy to “kResolutionExactFit”. However, that didn’t worked (I wanted my viewport to stretch over the whole display, while it was maintaining original ratio, leaving borders on the sides).

After a while, I found this line (CCEGLView.cpp, line 451):

CCEGLView::sharedOpenGLView()>setDesignResolutionSize;
No matter which resolution policy I apply
you always overwriting it by kResolutionShowAll value.

In my opinion, this is a bug, and you should use existing resolution policy.

Thank you.

Thanks for your feed back. We will test it and find a solution in this problem.:slight_smile:

Hello ilidan n chenjc,
I am also facing the same problem. I want to use ‘kResolutionNoBorder’ policy but it is not working, instead is always using ‘kResolutionShowAll’ policy as if it is hard coded somewhere.
If you have found any solution plz let me…

Hey suveerjacob, may be ilidan is right, I change kResolutionShowAll to m_eResolutionPolicy and works OK, in line (CCEGLView.cpp, line 451).

Hello Chenjc, i tried the solution you gave but i am facing some weird problem like when i run the project on simulator (x86 architecture) it works fine. But when i test the project in real device (Nokia Lumia 520, on ARM architecture) the solution is not working. Although it is not using ‘kResolutionShowAll’ policy(as previously) but it is using ‘kResolutionExactFit’ policy instead.

I even tried hard coding ‘kResolutionNoBorder’ policy in CCEGLView.cpp(at the same place u told, ie in ‘updateView()’ method) but it is still using the same ‘kResolutionExactFit’ policy.
I need to use ‘kResolutionNoBorder’ policy as my game does not look good in other policies…

Hi suveerjacob, it test OK in Lumia820 in the cocos2dx master branch. While using kResolutionShowAll it was not change to kResolutionExactFit instead.

Hey Chenjc… i tried every possible thing from… like cleaning n recompiling, creating a new project, hardcoding etc… but i cannot find any solution… I dont know why it is working absolutely FINE in simulator but it is not working in my real device(lumia 520)…
I am using cocos2dx-master version which i downloaded from this link --> https://github.com/cocos2d/cocos2d-x/tree/master/

It may be the reason of device, I will find a lumia 520 to test if possible, and may be you can try at other device if you have. Thanks.

The device is not prepared! :stuck_out_tongue:

ilidan

hey Eschmelax,
Sorry bro… i did’nt get your answer…

Hello Chenjc, Did you find any solution of the resolution policy problem… what i have noticed is that in TestCpp samples ‘KResolutionShowAll’ policy is used. In my case every other policy EXCEPT ‘kResolutionNoBorder’ is working fine.

The weird thing is that ‘kResolutionNoBorder’ is working fine on simulators but not on actual device(Lumia 520).
I really need the solution of the problem.

Hi suveerjacob, you said it changed to kResolutionExactFit in all other policy last time, and it was just kResolutionNoBorder not working fine now. But I tests ok. Can you attach some pictures of the errors?

Hello Chenjc,
I am sending you the links of the screenshots.
1- My AppDelegate.cpp code:
http://www.reddropdonor.com/images/Screenshots_policy/AppDelegate.PNG
2- Results from Emulator (It is working fine)
http://www.reddropdonor.com/images/Screenshots_policy/Emulator.PNG
3- Screenshot from the real device(You can see the background stretched)
http://www.reddropdonor.com/images/Screenshots_policy/Real_Device_ScreenShot.png
4- Output log while running on real device(lumia 520 in release mode)
http://www.reddropdonor.com/images/Screenshots_policy/output_log_real_device.PNG

As you can see that it is running fine in simulator but not on actual Device.

Plz do help me with this problem…

Hey suveerjacob, I couldn’t open the link, send it to my email or attach them in your replyed not using a link, my email jingchen.chen@cocos2d-x.org, Thanks.

Hello Chenjc… i have sent you an email on the above email Id… plz do check it…

bug created at #4050, and https://github.com/MSOpenTech/cocos2d-x/issues/38.