mirror of https://github.com/axmolengine/axmol.git
fixed #1522: CCEGLView class of desktop platforms should override CCEGLViewProtocol::setScissorInPoints.
This commit is contained in:
parent
0fd3a541f2
commit
c797af0fe9
|
@ -261,6 +261,15 @@ void CCEGLView::setViewPortInPoints(float x , float y , float w , float h)
|
|||
(GLsizei)(h * m_fScaleY * m_fFrameZoomFactor));
|
||||
}
|
||||
|
||||
void CCEGLView::setScissorInPoints(float x , float y , float w , float h)
|
||||
{
|
||||
glScissor((GLint)(x * m_fScaleX * m_fFrameZoomFactor + m_obViewPortRect.origin.x * m_fFrameZoomFactor),
|
||||
(GLint)(y * m_fScaleY * m_fFrameZoomFactor + m_obViewPortRect.origin.y * m_fFrameZoomFactor),
|
||||
(GLsizei)(w * m_fScaleX * m_fFrameZoomFactor),
|
||||
(GLsizei)(h * m_fScaleY * m_fFrameZoomFactor));
|
||||
}
|
||||
|
||||
|
||||
bool CCEGLView::isOpenGLReady()
|
||||
{
|
||||
return bIsInit;
|
||||
|
|
|
@ -33,6 +33,8 @@ public:
|
|||
*/
|
||||
virtual void setFrameSize(float width, float height);
|
||||
virtual void setViewPortInPoints(float x , float y , float w , float h);
|
||||
virtual void setScissorInPoints(float x , float y , float w , float h);
|
||||
|
||||
/*
|
||||
* Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop.
|
||||
*/
|
||||
|
|
|
@ -49,6 +49,7 @@ public:
|
|||
* Set opengl view port rectangle with points.
|
||||
*/
|
||||
virtual void setViewPortInPoints(float x , float y , float w , float h);
|
||||
virtual void setScissorInPoints(float x , float y , float w , float h);
|
||||
|
||||
virtual void setIMEKeyboardState(bool bOpen);
|
||||
virtual void setMultiTouchMask(bool mask);
|
||||
|
|
|
@ -98,6 +98,16 @@ void CCEGLView::setViewPortInPoints(float x , float y , float w , float h)
|
|||
(GLsizei)(h * m_fScaleY * frameZoomFactor));
|
||||
}
|
||||
|
||||
void CCEGLView::setScissorInPoints(float x , float y , float w , float h)
|
||||
{
|
||||
float frameZoomFactor = [[EAGLView sharedEGLView] frameZoomFactor];
|
||||
|
||||
glScissor((GLint)(x * m_fScaleX * frameZoomFactor + m_obViewPortRect.origin.x * frameZoomFactor),
|
||||
(GLint)(y * m_fScaleY * frameZoomFactor + m_obViewPortRect.origin.y * frameZoomFactor),
|
||||
(GLsizei)(w * m_fScaleX * frameZoomFactor),
|
||||
(GLsizei)(h * m_fScaleY * frameZoomFactor));
|
||||
}
|
||||
|
||||
void CCEGLView::setMultiTouchMask(bool mask)
|
||||
{
|
||||
//EAGLView *glView = [EAGLView sharedEGLView];
|
||||
|
|
|
@ -697,6 +697,14 @@ void CCEGLView::setViewPortInPoints(float x , float y , float w , float h)
|
|||
(GLsizei)(h * m_fScaleY * m_fFrameZoomFactor));
|
||||
}
|
||||
|
||||
void CCEGLView::setScissorInPoints(float x , float y , float w , float h)
|
||||
{
|
||||
glScissor((GLint)(x * m_fScaleX * m_fFrameZoomFactor + m_obViewPortRect.origin.x * m_fFrameZoomFactor),
|
||||
(GLint)(y * m_fScaleY * m_fFrameZoomFactor + m_obViewPortRect.origin.y * m_fFrameZoomFactor),
|
||||
(GLsizei)(w * m_fScaleX * m_fFrameZoomFactor),
|
||||
(GLsizei)(h * m_fScaleY * m_fFrameZoomFactor));
|
||||
}
|
||||
|
||||
CCEGLView* CCEGLView::sharedOpenGLView()
|
||||
{
|
||||
static CCEGLView* s_pEglView = NULL;
|
||||
|
|
|
@ -73,6 +73,8 @@ public:
|
|||
void setAccelerometerKeyHook( LPFN_ACCELEROMETER_KEYHOOK lpfnAccelerometerKeyHook );
|
||||
|
||||
virtual void setViewPortInPoints(float x , float y , float w , float h);
|
||||
virtual void setScissorInPoints(float x , float y , float w , float h);
|
||||
|
||||
// static function
|
||||
/**
|
||||
@brief get the shared main open gl window
|
||||
|
|
Loading…
Reference in New Issue