Windows: Made WindowsDisplayPeerInfo take hwnd and hdc arguments

This commit is contained in:
Elias Naur 2008-04-30 16:01:25 +00:00
parent 2420133bb9
commit 1006aed308
4 changed files with 14 additions and 12 deletions

View file

@ -155,7 +155,7 @@ final class WindowsDisplay implements DisplayImplementation {
long parent_hwnd = parent != null ? getHwnd(parent) : 0;
boolean isUndecorated = isUndecorated();
nCreateWindow(mode, fullscreen, x, y, isUndecorated, parent != null, parent_hwnd);
peer_info.initDC();
peer_info.initDC(getHwnd(), getHdc());
showWindow(getHwnd(), SW_SHOWDEFAULT);
if (parent == null) {
setForegroundWindow(getHwnd());
@ -468,6 +468,7 @@ final class WindowsDisplay implements DisplayImplementation {
private static native long getDllInstance();
private static native long getHwnd();
private static native long getHdc();
private static native long getDesktopWindow();
static void centerCursor(long hwnd) {
getGlobalClientRect(getHwnd(), rect);

View file

@ -49,11 +49,11 @@ final class WindowsDisplayPeerInfo extends WindowsPeerInfo {
GLContext.loadOpenGLLibrary();
}
void initDC() throws LWJGLException {
nInitDC(getHandle());
void initDC(long hwnd, long hdc) throws LWJGLException {
nInitDC(getHandle(), hwnd, hdc);
choosePixelFormat(0, 0, pixel_format, null, true, true, false, true);
}
private static native void nInitDC(ByteBuffer peer_info_handle);
private static native void nInitDC(ByteBuffer peer_info_handle, long hwnd, long hdc);
protected void doLockAndInitHandle() throws LWJGLException {
// NO-OP