mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=3208
This commit is contained in:
parent
db1f8520ae
commit
74fbc08cb4
|
@ -13,7 +13,6 @@
|
||||||
* Visit My Site At nehe.gamedev.net
|
* Visit My Site At nehe.gamedev.net
|
||||||
* Adapted to BOINC by Eric Heien
|
* Adapted to BOINC by Eric Heien
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
|
||||||
#include "boinc_api.h"
|
#include "boinc_api.h"
|
||||||
|
@ -25,8 +24,8 @@
|
||||||
|
|
||||||
// application needs to define mouse handlers
|
// application needs to define mouse handlers
|
||||||
//
|
//
|
||||||
extern void boinc_app_mouse_button(int x, int y, bool is_down);
|
extern void boinc_app_mouse_button(int x, int y, int which, bool is_down);
|
||||||
extern void boinc_app_mouse_move(int x, int y);
|
extern void boinc_app_mouse_move(int x, int y, bool left, bool middle, bool right);
|
||||||
|
|
||||||
|
|
||||||
#define BOINC_WINDOW_CLASS_NAME "BOINC_app"
|
#define BOINC_WINDOW_CLASS_NAME "BOINC_app"
|
||||||
|
@ -189,6 +188,17 @@ void SetMode(int mode) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void parse_mouse_event(UINT uMsg, int& which, bool& down) {
|
||||||
|
switch(uMsg) {
|
||||||
|
case WM_LBUTTONDOWN: which = 0; down = true; break;
|
||||||
|
case WM_MBUTTONDOWN: which = 1; down = true; break;
|
||||||
|
case WM_RBUTTONDOWN: which = 2; down = true; break;
|
||||||
|
case WM_LBUTTONUP: which = 0; down = false; break;
|
||||||
|
case WM_MBUTTONUP: which = 1; down = false; break;
|
||||||
|
case WM_RBUTTONUP: which = 2; down = false; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// message handler (includes timer, Windows msgs)
|
// message handler (includes timer, Windows msgs)
|
||||||
//
|
//
|
||||||
LRESULT CALLBACK WndProc(
|
LRESULT CALLBACK WndProc(
|
||||||
|
@ -202,6 +212,11 @@ LRESULT CALLBACK WndProc(
|
||||||
return 0;
|
return 0;
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
case WM_KEYUP:
|
case WM_KEYUP:
|
||||||
|
if(current_graphics_mode == MODE_FULLSCREEN) {
|
||||||
|
SetMode(MODE_HIDE_GRAPHICS);
|
||||||
|
PostMessage(HWND_BROADCAST, m_uEndSSMsg, 0, 0);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
case WM_MBUTTONDOWN:
|
case WM_MBUTTONDOWN:
|
||||||
case WM_RBUTTONDOWN:
|
case WM_RBUTTONDOWN:
|
||||||
|
@ -212,9 +227,12 @@ LRESULT CALLBACK WndProc(
|
||||||
SetMode(MODE_HIDE_GRAPHICS);
|
SetMode(MODE_HIDE_GRAPHICS);
|
||||||
PostMessage(HWND_BROADCAST, m_uEndSSMsg, 0, 0);
|
PostMessage(HWND_BROADCAST, m_uEndSSMsg, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
POINT cPos;
|
int which;
|
||||||
GetCursorPos(&cPos);
|
bool down;
|
||||||
boinc_app_mouse_button(cPos.x, cPos.y, uMsg==WM_LBUTTONDOWN);
|
POINT cPos;
|
||||||
|
GetCursorPos(&cPos);
|
||||||
|
parse_mouse_event(uMsg, which, down);
|
||||||
|
boinc_app_mouse_button(cPos.x, cPos.y, which, down);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
|
@ -226,7 +244,12 @@ LRESULT CALLBACK WndProc(
|
||||||
PostMessage(HWND_BROADCAST, m_uEndSSMsg, 0, 0);
|
PostMessage(HWND_BROADCAST, m_uEndSSMsg, 0, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
boinc_app_mouse_move(cPos.x, cPos.y);
|
boinc_app_mouse_move(
|
||||||
|
cPos.x, cPos.y,
|
||||||
|
(wParam&MK_LBUTTON)!=0,
|
||||||
|
(wParam&MK_MBUTTON)!=0,
|
||||||
|
(wParam&MK_RBUTTON)!=0
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
|
|
|
@ -11253,3 +11253,9 @@ Rom April 1 2004
|
||||||
client/win/
|
client/win/
|
||||||
boinc_gui.rc, .h
|
boinc_gui.rc, .h
|
||||||
wingui_mainwindow.cpp, .h
|
wingui_mainwindow.cpp, .h
|
||||||
|
|
||||||
|
David April 1 2004
|
||||||
|
- extend mouse interface to handle buttons better
|
||||||
|
|
||||||
|
api/
|
||||||
|
windows_opengl.C
|
||||||
|
|
Loading…
Reference in New Issue