1154
1154
nuxAssert (w >= 0);
1155
1155
nuxAssert (h >= 0);
1157
NUX_RETURN_IF_FALSE (w >= 0);
1158
NUX_RETURN_IF_FALSE (h >= 0);
1156
1160
_scissor.x = x;
1157
1161
_scissor.y = y;
1158
1162
_scissor.width = w;
1159
1163
_scissor.height = h;
1161
if (_scissor.width < 0)
1163
nuxAssertMsg (0, TEXT ("[GraphicsEngine::SetViewport] Incorrect context size.") );
1167
if (_scissor.height < 0)
1169
nuxAssertMsg (0, TEXT ("[GraphicsEngine::SetViewport] Incorrect context size.") );
1170
_scissor.height = 1;
1173
CHECKGL ( glScissor (_scissor.x /*+ m_ScissorXOffset*/, _scissor.y /*+ m_ScissorYOffset*/, _scissor.width, _scissor.height) );
1167
_scissor.width += _scissor.x;
1173
_scissor.height += _scissor.y;
1177
if (_scissor.width <= 0)
1179
// jaytaoko: This is a hack for what looks like a bug (#726033) in the radeon opensource driver
1180
// on R300/400/500. Rather than passing a null region to glScissor, we give the clip area a 1 pixel width.
1181
//_scissor.width = 1;
1182
CHECKGL (glScissor (0, 0, 1, 1));
1186
if (_scissor.height <= 0)
1188
// jaytaoko: This is a hack for what looks like a bug (#726033) in the radeon opensource driver
1189
// on R300/400/500. Rather than passing a null region to glScissor, we give the clip area a 1 pixel height.
1190
//_scissor.height = 1;
1191
CHECKGL (glScissor (0, 0, 1, 1));
1195
CHECKGL (glScissor (_scissor.x, _scissor.y, _scissor.width, _scissor.height));
1176
1198
Rect GraphicsEngine::GetScissorRect()