mirror of https://github.com/axmolengine/axmol.git
add setContentScaleFactor()
This commit is contained in:
parent
fb0987ae6c
commit
0298500abe
|
@ -789,6 +789,23 @@ void CCDirector::showProfilers()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void CCDirector::setContentScaleFactor(CGFloat scaleFactor)
|
||||||
|
{
|
||||||
|
if (scaleFactor != m_fContentScaleFactor)
|
||||||
|
{
|
||||||
|
m_fContentScaleFactor = scaleFactor;
|
||||||
|
m_obSurfaceSize = CGSizeMake(m_obScreenSize.width * scaleFactor, m_obScreenSize.height * scaleFactor);
|
||||||
|
|
||||||
|
if (m_pobOpenGLView)
|
||||||
|
{
|
||||||
|
updateContentScaleFactor();
|
||||||
|
}
|
||||||
|
|
||||||
|
// update projection
|
||||||
|
setProjection(m_eProjection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// should we afford 4 types of director ??
|
// should we afford 4 types of director ??
|
||||||
// I think DisplayLinkDirector is enough
|
// I think DisplayLinkDirector is enough
|
||||||
// so we now only support DisplayLinkDirector
|
// so we now only support DisplayLinkDirector
|
||||||
|
|
|
@ -246,11 +246,8 @@ public:
|
||||||
Only available when compiled using SDK >= 4.0.
|
Only available when compiled using SDK >= 4.0.
|
||||||
@since v0.99.4
|
@since v0.99.4
|
||||||
*/
|
*/
|
||||||
inline void setContentScaleFactor(CGFloat obCGFloatValue)
|
void setContentScaleFactor(CGFloat scaleFactor);
|
||||||
{
|
|
||||||
assert(! isOpenGLAttached());
|
|
||||||
m_fContentScaleFactor = obCGFloatValue;
|
|
||||||
}
|
|
||||||
inline CGFloat getContentScaleFactor(void) { return m_fContentScaleFactor; }
|
inline CGFloat getContentScaleFactor(void) { return m_fContentScaleFactor; }
|
||||||
|
|
||||||
// UI dependent
|
// UI dependent
|
||||||
|
|
Loading…
Reference in New Issue