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
|
||||
|
||||
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 ??
|
||||
// I think DisplayLinkDirector is enough
|
||||
// so we now only support DisplayLinkDirector
|
||||
|
|
|
@ -246,11 +246,8 @@ public:
|
|||
Only available when compiled using SDK >= 4.0.
|
||||
@since v0.99.4
|
||||
*/
|
||||
inline void setContentScaleFactor(CGFloat obCGFloatValue)
|
||||
{
|
||||
assert(! isOpenGLAttached());
|
||||
m_fContentScaleFactor = obCGFloatValue;
|
||||
}
|
||||
void setContentScaleFactor(CGFloat scaleFactor);
|
||||
|
||||
inline CGFloat getContentScaleFactor(void) { return m_fContentScaleFactor; }
|
||||
|
||||
// UI dependent
|
||||
|
|
Loading…
Reference in New Issue