mirror of https://github.com/BOINC/boinc.git
parent
0c43d386d9
commit
3ac0842d3a
|
@ -17,8 +17,8 @@
|
||||||
// Contributor(s):
|
// Contributor(s):
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef _BOINC_API
|
#ifndef _BOINC_API_
|
||||||
#define _BOINC_API
|
#define _BOINC_API_
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef HAVE_SYS_TIME_H
|
||||||
|
|
|
@ -42,6 +42,7 @@ static HINSTANCE hInstance; // Holds The Instance Of The Application
|
||||||
static RECT rect = {50, 50, 50+640, 50+480};
|
static RECT rect = {50, 50, 50+640, 50+480};
|
||||||
static int current_graphics_mode = MODE_HIDE_GRAPHICS;
|
static int current_graphics_mode = MODE_HIDE_GRAPHICS;
|
||||||
static POINT mousePos;
|
static POINT mousePos;
|
||||||
|
static UINT m_uEndSSMsg;
|
||||||
|
|
||||||
BOOL win_loop_done;
|
BOOL win_loop_done;
|
||||||
|
|
||||||
|
@ -64,7 +65,6 @@ void SetMode(int mode) {
|
||||||
DWORD dwExStyle;
|
DWORD dwExStyle;
|
||||||
DWORD dwStyle;
|
DWORD dwStyle;
|
||||||
|
|
||||||
|
|
||||||
if(hWnd) {
|
if(hWnd) {
|
||||||
if (hRC) wglDeleteContext(hRC);
|
if (hRC) wglDeleteContext(hRC);
|
||||||
if (hdc) ReleaseDC(hWnd, hdc);
|
if (hdc) ReleaseDC(hWnd, hdc);
|
||||||
|
@ -172,13 +172,19 @@ LRESULT CALLBACK WndProc( HWND hWnd, // Handle For This Window
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
case WM_MBUTTONDOWN:
|
case WM_MBUTTONDOWN:
|
||||||
case WM_RBUTTONDOWN:
|
case WM_RBUTTONDOWN:
|
||||||
if(current_graphics_mode == MODE_FULLSCREEN) SetMode(MODE_HIDE_GRAPHICS);
|
if(current_graphics_mode == MODE_FULLSCREEN) {
|
||||||
|
SetMode(MODE_HIDE_GRAPHICS);
|
||||||
|
PostMessage(HWND_BROADCAST, m_uEndSSMsg, 0, 0);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
if(current_graphics_mode == MODE_FULLSCREEN) {
|
if(current_graphics_mode == MODE_FULLSCREEN) {
|
||||||
POINT cPos;
|
POINT cPos;
|
||||||
GetCursorPos(&cPos);
|
GetCursorPos(&cPos);
|
||||||
if(cPos.x != mousePos.x || cPos.y != mousePos.y) SetMode(MODE_HIDE_GRAPHICS);
|
if(cPos.x != mousePos.x || cPos.y != mousePos.y) {
|
||||||
|
SetMode(MODE_HIDE_GRAPHICS);
|
||||||
|
PostMessage(HWND_BROADCAST, m_uEndSSMsg, 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
|
@ -220,6 +226,7 @@ DWORD WINAPI win_graphics_event_loop( LPVOID gi ) {
|
||||||
MSG msg; // Windows Message Structure
|
MSG msg; // Windows Message Structure
|
||||||
|
|
||||||
double start = (double)time(0);
|
double start = (double)time(0);
|
||||||
|
m_uEndSSMsg = RegisterWindowMessage(END_SS_MSG);
|
||||||
|
|
||||||
// Register window class and graphics mode message
|
// Register window class and graphics mode message
|
||||||
reg_win_class();
|
reg_win_class();
|
||||||
|
|
Loading…
Reference in New Issue