*** empty log message ***

This commit is contained in:
Elias Naur 2004-11-09 11:00:49 +00:00
parent 4094c4ed7d
commit f02e90eb7e
2 changed files with 17 additions and 6 deletions

View File

@ -46,16 +46,18 @@
#define WINDOWCLASSNAME "LWJGLWINDOW" #define WINDOWCLASSNAME "LWJGLWINDOW"
#define GAMMA_SIZE (3*256)
static jobjectArray GetAvailableDisplayModesEx(JNIEnv * env); static jobjectArray GetAvailableDisplayModesEx(JNIEnv * env);
static jobjectArray GetAvailableDisplayModes(JNIEnv * env); static jobjectArray GetAvailableDisplayModes(JNIEnv * env);
static char * getDriver(); static char * getDriver();
bool modeSet = false; // Whether we've done a display mode change static bool modeSet = false; // Whether we've done a display mode change
WORD* originalGamma = new WORD[256 * 3]; // Original gamma settings static WORD originalGamma[256 * 3]; // Original gamma settings
WORD* currentGamma = new WORD[256 * 3]; // Current gamma settings static WORD currentGamma[256 * 3]; // Current gamma settings
DEVMODE devmode; // Now we'll remember this value for the future static DEVMODE devmode; // Now we'll remember this value for the future
extern HWND display_hwnd = NULL; // Handle to the window extern HWND display_hwnd; // Handle to the window
extern RECT clientSize; extern RECT clientSize;
char * driver = getDriver(); static char * driver = getDriver();
jobjectArray getAvailableDisplayModes(JNIEnv *env) jobjectArray getAvailableDisplayModes(JNIEnv *env)
{ {
@ -282,6 +284,7 @@ jobject initDisplay(JNIEnv * env)
if (GetDeviceGammaRamp(screenDC, originalGamma) == FALSE) { if (GetDeviceGammaRamp(screenDC, originalGamma) == FALSE) {
printfDebug("Failed to get initial device gamma\n"); printfDebug("Failed to get initial device gamma\n");
} }
memcpy(currentGamma, originalGamma, sizeof(WORD)*GAMMA_SIZE);
ReleaseDC(NULL, screenDC); ReleaseDC(NULL, screenDC);
return newMode; return newMode;
} }

View File

@ -550,6 +550,14 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_update
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_swapBuffers JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_swapBuffers
(JNIEnv * env, jobject self) (JNIEnv * env, jobject self)
{ {
display_hdc = GetDC(display_hwnd);
if (!applyPixelFormat(display_hdc, pixel_format_index)) {
closeWindow(display_hwnd, display_hdc);
throwException(env, "Could not apply pixel format to window");
return;
}
BOOL result = wglMakeCurrent(display_hdc, display_hglrc);
isDirty = false; isDirty = false;
SwapBuffers(display_hdc); SwapBuffers(display_hdc);
} }