Windows: Moved pixel format logic from WindowsDisplayPeerInfo.initDC to WindowsDisplay.createWindow
This commit is contained in:
parent
bf4b5a5890
commit
b11fcc99f6
|
@ -174,6 +174,8 @@ final class WindowsDisplay implements DisplayImplementation {
|
||||||
throw new LWJGLException("Failed to get dc");
|
throw new LWJGLException("Failed to get dc");
|
||||||
}
|
}
|
||||||
peer_info.initDC(getHwnd(), getHdc());
|
peer_info.initDC(getHwnd(), getHdc());
|
||||||
|
int format = WindowsPeerInfo.choosePixelFormat(getHdc(), 0, 0, peer_info.getPixelFormat(), null, true, true, false, true);
|
||||||
|
WindowsPeerInfo.setPixelFormat(getHdc(), format);
|
||||||
showWindow(getHwnd(), SW_SHOWDEFAULT);
|
showWindow(getHwnd(), SW_SHOWDEFAULT);
|
||||||
if (parent == null) {
|
if (parent == null) {
|
||||||
setForegroundWindow(getHwnd());
|
setForegroundWindow(getHwnd());
|
||||||
|
|
|
@ -49,10 +49,12 @@ final class WindowsDisplayPeerInfo extends WindowsPeerInfo {
|
||||||
GLContext.loadOpenGLLibrary();
|
GLContext.loadOpenGLLibrary();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final PixelFormat getPixelFormat() {
|
||||||
|
return pixel_format;
|
||||||
|
}
|
||||||
|
|
||||||
void initDC(long hwnd, long hdc) throws LWJGLException {
|
void initDC(long hwnd, long hdc) throws LWJGLException {
|
||||||
nInitDC(getHandle(), hwnd, hdc);
|
nInitDC(getHandle(), hwnd, hdc);
|
||||||
int format = choosePixelFormat(hdc, 0, 0, pixel_format, null, true, true, false, true);
|
|
||||||
setPixelFormat(hdc, format);
|
|
||||||
}
|
}
|
||||||
private static native void nInitDC(ByteBuffer peer_info_handle, long hwnd, long hdc);
|
private static native void nInitDC(ByteBuffer peer_info_handle, long hwnd, long hdc);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue