mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-09 19:03:29 +00:00
fix graphic bug
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@85 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -17,6 +17,7 @@ struct _MwLL {
|
|||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
void* user;
|
void* user;
|
||||||
|
int copy_buffer;
|
||||||
|
|
||||||
MwLLHandler handler;
|
MwLLHandler handler;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ struct _MwLL {
|
|||||||
Colormap colormap;
|
Colormap colormap;
|
||||||
void* user;
|
void* user;
|
||||||
Atom wm_delete;
|
Atom wm_delete;
|
||||||
|
int copy_buffer;
|
||||||
|
|
||||||
unsigned int width;
|
unsigned int width;
|
||||||
unsigned int height;
|
unsigned int height;
|
||||||
|
|||||||
11
src/gdi.c
11
src/gdi.c
@@ -28,9 +28,11 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
|
|||||||
u->ll->hDC = hbdc;
|
u->ll->hDC = hbdc;
|
||||||
MwLLDispatch(u->ll, draw);
|
MwLLDispatch(u->ll, draw);
|
||||||
|
|
||||||
dc = BeginPaint(hWnd, &ps);
|
if(u->ll->copy_buffer) {
|
||||||
StretchBlt(dc, 0, 0, rc.right - rc.left, rc.bottom - rc.top, hbdc, 0, 0, rc.right - rc.left, rc.bottom - rc.top, SRCCOPY);
|
dc = BeginPaint(hWnd, &ps);
|
||||||
EndPaint(hWnd, &ps);
|
StretchBlt(dc, 0, 0, rc.right - rc.left, rc.bottom - rc.top, hbdc, 0, 0, rc.right - rc.left, rc.bottom - rc.top, SRCCOPY);
|
||||||
|
EndPaint(hWnd, &ps);
|
||||||
|
}
|
||||||
|
|
||||||
DeleteDC(hbdc);
|
DeleteDC(hbdc);
|
||||||
DeleteObject(hbmp);
|
DeleteObject(hbmp);
|
||||||
@@ -82,7 +84,8 @@ MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height) {
|
|||||||
|
|
||||||
RegisterClassEx(&wc);
|
RegisterClassEx(&wc);
|
||||||
|
|
||||||
r->hWnd = CreateWindow(parent == NULL ? "milsko" : "STATIC", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x, y, width, height, parent == NULL ? NULL : parent->hWnd, 0, wc.hInstance, NULL);
|
r->copy_buffer = 1;
|
||||||
|
r->hWnd = CreateWindow(parent == NULL ? "milsko" : "STATIC", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x, y, width, height, parent == NULL ? NULL : parent->hWnd, 0, wc.hInstance, NULL);
|
||||||
|
|
||||||
u->ll = r;
|
u->ll = r;
|
||||||
if(parent == NULL) {
|
if(parent == NULL) {
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ static void create(MwWidget handle) {
|
|||||||
o->visual = glXChooseVisual(handle->lowlevel->display, DefaultScreen(handle->lowlevel->display), attribs);
|
o->visual = glXChooseVisual(handle->lowlevel->display, DefaultScreen(handle->lowlevel->display), attribs);
|
||||||
o->gl = glXCreateContext(handle->lowlevel->display, o->visual, NULL, GL_TRUE);
|
o->gl = glXCreateContext(handle->lowlevel->display, o->visual, NULL, GL_TRUE);
|
||||||
#endif
|
#endif
|
||||||
handle->internal = o;
|
handle->internal = o;
|
||||||
|
handle->lowlevel->copy_buffer = 0;
|
||||||
|
|
||||||
MwSetDefault(handle);
|
MwSetDefault(handle);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height) {
|
|||||||
r->display = parent->display;
|
r->display = parent->display;
|
||||||
p = parent->window;
|
p = parent->window;
|
||||||
}
|
}
|
||||||
r->window = XCreateSimpleWindow(r->display, p, x, y, width, height, 0, 0, WhitePixel(r->display, XDefaultScreen(r->display)));
|
r->window = XCreateSimpleWindow(r->display, p, x, y, width, height, 0, 0, WhitePixel(r->display, XDefaultScreen(r->display)));
|
||||||
|
r->copy_buffer = 1;
|
||||||
|
|
||||||
r->width = width;
|
r->width = width;
|
||||||
r->height = height;
|
r->height = height;
|
||||||
@@ -168,7 +169,7 @@ void MwLLNextEvent(MwLL handle) {
|
|||||||
MwLLGetXYWH(handle, &x, &y, &w, &h);
|
MwLLGetXYWH(handle, &x, &y, &w, &h);
|
||||||
|
|
||||||
MwLLDispatch(handle, draw);
|
MwLLDispatch(handle, draw);
|
||||||
XCopyArea(handle->display, handle->pixmap, handle->window, handle->gc, 0, 0, w, h, 0, 0);
|
if(handle->copy_buffer) XCopyArea(handle->display, handle->pixmap, handle->window, handle->gc, 0, 0, w, h, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user