Don't make context current in DisplayImplementation.createWindow(), but let Display do it explicitly to increase native call granularity

This commit is contained in:
Elias Naur 2005-01-14 09:24:59 +00:00
parent 3d30d60c7e
commit 859204c4a0
2 changed files with 2 additions and 7 deletions

View File

@ -202,12 +202,13 @@ public final class Display {
*/
private static void createWindow() throws LWJGLException {
display_impl.createWindow(current_mode, fullscreen, (fullscreen) ? 0 : x, (fullscreen) ? 0 : y);
makeCurrent();
// if no display location set, center window
if(x == -1 && y == -1) {
setLocation(Math.max(0, (initial_mode.getWidth() - current_mode.getWidth()) / 2),
Math.max(0, (initial_mode.getHeight() - current_mode.getHeight()) / 2));
}
setTitle(title);
initControls();
setVSyncEnabled(vsync);

View File

@ -662,12 +662,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_createWindow(JNIEnv *e
return;
}
result = wglMakeCurrent(display_hdc, display_hglrc);
if (!result) {
throwException(env, "Could not bind context to window");
closeWindow(display_hwnd, display_hdc);
return;
}
extgl_InitWGL(env);
ShowWindow(display_hwnd, SW_SHOW);
UpdateWindow(display_hwnd);