mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
better x11 clearing
This commit is contained in:
parent
bccaeec475
commit
9f734e3cbf
@ -710,12 +710,22 @@ receive_command() {
|
|||||||
void P3DX11SplashWindow::
|
void P3DX11SplashWindow::
|
||||||
redraw() {
|
redraw() {
|
||||||
if (_composite_image == NULL) {
|
if (_composite_image == NULL) {
|
||||||
|
// Clear the whole window, if there's no image.
|
||||||
XClearWindow(_display, _window);
|
XClearWindow(_display, _window);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
// If we have an image, draw it.
|
||||||
|
int xo = (_win_width - _composite_width) / 2;
|
||||||
|
int yo = (_win_height - _composite_height) / 2;
|
||||||
XPutImage(_display, _window, _graphics_context, _composite_image, 0, 0,
|
XPutImage(_display, _window, _graphics_context, _composite_image, 0, 0,
|
||||||
(_win_width - _composite_width) / 2, (_win_height - _composite_height) / 2,
|
xo, yo, _composite_width, _composite_height);
|
||||||
_composite_width, _composite_height);
|
|
||||||
|
// Then clear the rectangles around it carefully (rather than just
|
||||||
|
// clearing the whole window first, to avoid flicking).
|
||||||
|
XClearArea(_display, _window, 0, 0, _win_width, yo, False);
|
||||||
|
XClearArea(_display, _window, 0, yo, xo, _composite_height, False);
|
||||||
|
XClearArea(_display, _window, _win_width - xo, yo, xo, _composite_height, False);
|
||||||
|
XClearArea(_display, _window, 0, _win_height - yo, _win_width, yo, False);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -768,7 +778,7 @@ make_window() {
|
|||||||
|
|
||||||
long event_mask =
|
long event_mask =
|
||||||
ButtonPressMask | ButtonReleaseMask |
|
ButtonPressMask | ButtonReleaseMask |
|
||||||
PointerMotionMask | StructureNotifyMask;
|
PointerMotionMask | StructureNotifyMask | ExposureMask;
|
||||||
|
|
||||||
// Initialize window attributes
|
// Initialize window attributes
|
||||||
XSetWindowAttributes wa;
|
XSetWindowAttributes wa;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user