diff --git a/api/graphics2.C b/api/graphics2.C index 2e383fc844..151054b037 100644 --- a/api/graphics2.C +++ b/api/graphics2.C @@ -1,3 +1,6 @@ +#include "util.h" +#include "graphics_api.h" + double boinc_max_fps; double boinc_max_gfx_cpu_frac; @@ -57,3 +60,17 @@ bool throttled_app_render(int x, int y, double t) { } return false; } + +void get_window_title(APP_INIT_DATA& aid, char* buf, int len) { + if (aid.app_version) { + snprintf(buf, len, + "%s version %.2f [workunit: %s]", + aid.app_name, aid.app_version/100.0, aid.wu_name + ); + } else { + snprintf(buf, len, + "%s [workunit: %s]", + aid.app_name, aid.wu_name + ); + } +} diff --git a/api/graphics2_win.C b/api/graphics2_win.C index 32a2367815..a29f239daa 100755 --- a/api/graphics2_win.C +++ b/api/graphics2_win.C @@ -21,6 +21,7 @@ #include "graphics_api.h" #include "app_ipc.h" #include "util.h" +#include "str_util.h" #include "graphics_impl.h" #define BOINC_WINDOW_CLASS_NAME "BOINC_app" @@ -40,6 +41,7 @@ static HDC myhDC; static bool visible = true; static bool window_ready=false; static UINT_PTR gfx_timer_id = 0; +static bool fullscreen; void close_window() { window_ready=false; @@ -181,16 +183,16 @@ LRESULT CALLBACK WndProc( return 0; case WM_KEYDOWN: if(!window_ready) return 0; - if (current_graphics_mode == MODE_FULLSCREEN) { - set_mode(MODE_HIDE_GRAPHICS); + if (fullscreen) { + close_window(); } else { boinc_app_key_press((int)wParam, (int)lParam); } return 0; case WM_KEYUP: if(!window_ready) return 0; - if (current_graphics_mode == MODE_FULLSCREEN) { - set_mode(MODE_HIDE_GRAPHICS); + if (fullscreen) { + close_window(); } else { boinc_app_key_release((int)wParam, (int)lParam); } @@ -334,10 +336,17 @@ void boinc_graphics(int argc, char** argv) { fullscreen = true; } } - boinc_get_init_data(aid); - if (!strlen(aid.app_name)) { - strcpy(aid.app_name, "BOINC Application"); - } - make_window(fullscreen); + make_window(); win_graphics_event_loop(); } + +int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode) { + LPSTR command_line; + char* argv[100]; + int argc; + + command_line = GetCommandLine(); + argc = parse_command_line( command_line, argv ); + boinc_graphics(argc, argv); +} + diff --git a/checkin_notes b/checkin_notes index f319e739a7..5a01ef9b7c 100755 --- a/checkin_notes +++ b/checkin_notes @@ -5182,3 +5182,8 @@ David 22 May 2007 graphics2_win.C (new) sched/ Makefile.am + +David 22 May 2007 + api/ + graphics2.C + graphics2_win.C