mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 11:28:17 -04:00
make prepare_display_region work
This commit is contained in:
parent
eeda66f4e4
commit
e9857b36b9
@ -1086,28 +1086,18 @@ prepare_display_region() {
|
|||||||
} else if (_current_display_region != _actual_display_region) {
|
} else if (_current_display_region != _actual_display_region) {
|
||||||
_actual_display_region = _current_display_region;
|
_actual_display_region = _current_display_region;
|
||||||
|
|
||||||
#ifndef NO_MULTIPLE_DISPLAY_REGIONS
|
|
||||||
int l, b, w, h;
|
int l, b, w, h;
|
||||||
_actual_display_region->get_region_pixels(l, b, w, h);
|
_actual_display_region->get_region_pixels(l, b, w, h);
|
||||||
GLint x = GLint(l);
|
|
||||||
GLint y = GLint(b);
|
// Create the viewport
|
||||||
GLsizei width = GLsizei(w);
|
D3DVIEWPORT8 vp = {l,b,w,h,0.0f,1.0f};
|
||||||
GLsizei height = GLsizei(h);
|
HRESULT hr = scrn.pD3DDevice->SetViewport( &vp );
|
||||||
#ifdef WBD_GL_MODE
|
if(FAILED(hr)) {
|
||||||
// call_glScissor( x, y, width, height );
|
dxgsg_cat.fatal() << "SetViewport failed for device #" << scrn.CardIDNum << D3DERRORSTRING(hr);
|
||||||
// call_glViewport( x, y, width, height );
|
exit(1);
|
||||||
#else
|
|
||||||
if ( _scissor_x != x || _scissor_y != y ||
|
|
||||||
_scissor_width != width || _scissor_height != height )
|
|
||||||
{
|
|
||||||
_scissor_x = x; _scissor_y = y;
|
|
||||||
_scissor_width = width; _scissor_height = height;
|
|
||||||
RECT cliprect;
|
|
||||||
SetRect(&cliprect, x, y, x+width, y+height );
|
|
||||||
set_clipper(cliprect);
|
|
||||||
}
|
}
|
||||||
#endif //WBD_GL_MODE
|
|
||||||
#endif
|
// Note: for DX9, also change scissor clipping state here
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user