Determining device type

Determining device type
0.0 0



I am looking for way how to determine device type. I am currently looking to the static_fullPathFromRelativePath but i am not sure that i get it right.

Let’s say that i have my own implementation of atlas and set of generated files. Each “atlas” file is created for certain device resolution. I want to load proper atlas, currently i am doing it by just guess made by size of window. But there must be better way. So I went to CCTextureCache with hope that I find some facility which do just this job (determining 2x, -hd flags). But I am not sure that I completely get it there is define called CC_IS_RETINA_DISPLAY_SUPPORTED which handles this somehow but how does it work during runtime? I want one binary for all types of devices and just decide what type of assets should be loaded. How do i do that?

I try to summarize my questions:

* How do I determine type of device which i am running on?
* Is it possible to mock this by some flags when i am running on windows version and just want to try other resolutions ?

Does it make sense ?




These 2 documents are recommended:
* How to develop retina-display games in cocos2d
* [[How does cocos2d-x support multi-resolution]]

Then for your questions:
# cocos2d-x hasn’t wrap any resolution-detection methods, you had to invoke it from platform sdk.
# You can mock different resolutions by setting the widh & height to the win32 window in AppDelegate::applicaionDidFinishLaunching