diff --git a/api/windows_opengl.C b/api/windows_opengl.C index 5e72cf12d0..9b83009db6 100755 --- a/api/windows_opengl.C +++ b/api/windows_opengl.C @@ -30,16 +30,6 @@ #define WIN32_LEAN_AND_MEAN // This trims down the windows libraries. #define WIN32_EXTRA_LEAN // Trims even farther. -//#define DRAW_WITH_DLL - -#ifdef DRAW_WITH_DLL -__declspec(dllimport) void vis_render(int,int,double,float*,int); -__declspec(dllimport) void vis_unload(); -__declspec(dllimport) void vis_init(); -#pragma comment(lib,"../../vis_dll/debug/vis.lib") -#endif - - static HDC hDC; static HGLRC hRC; static HWND hWnd=NULL; // Holds Our Window Handle @@ -65,11 +55,7 @@ BOOL reg_win_class(); BOOL unreg_win_class(); bool KillWindow() { -#ifdef DRAW_WITH_DLL - if(hDC) vis_unload(); -#else //if(hDC) app_unload_gl(); -#endif if (hRC) { // Do We Have A Rendering Context? if (!wglMakeCurrent(NULL,NULL)) { // Are We Able To Release The DC And RC Contexts? @@ -101,6 +87,7 @@ bool KillWindow() { // - when get mode change msg (via shared mem) // - when in SS mode and get user input // +extern FILE* gf(); void SetMode(int mode) { RECT WindowRect = {0,0,0,0}; int width, height; @@ -113,6 +100,8 @@ void SetMode(int mode) { current_graphics_mode = mode; + // ?? if mode is HIDE, can't we just return here? + if (current_graphics_mode == MODE_FULLSCREEN) { HDC screenDC=GetDC(NULL); WindowRect.left = WindowRect.top = 0; @@ -172,7 +161,16 @@ void SetMode(int mode) { ShowWindow(hWnd, SW_HIDE); } - app_client_shm->send_graphics_mode_msg(APP_CORE_GFX_SEG, current_graphics_mode); + // do GL initialization every time, since we're creating a new window + // + InitGL(); + app_init_gl(); + + // tell the core client that we're entering new mode + // + app_client_shm->send_graphics_mode_msg( + APP_CORE_GFX_SEG, current_graphics_mode + ); } // message handler (includes timer, Windows msgs) @@ -187,7 +185,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, // Handle For This Window static bool visible = true; switch(uMsg) { - case WM_ERASEBKGND: // Check To See If Windows Is Trying To Erase The Background + case WM_ERASEBKGND: // Check To See If Windows Is Trying To Erase The Background return 0; case WM_SHOWWINDOW: // this is an attempt to avoid wasting CPU time on rendering @@ -267,15 +265,11 @@ DWORD WINAPI win_graphics_event_loop( LPVOID gi ) { // Register window class and graphics mode message reg_win_class(); - if (standalone) { SetMode(MODE_WINDOW); } else { SetMode(MODE_HIDE_GRAPHICS); } - InitGL(); - app_init_gl(); - win_loop_done = false; using_opengl = true; while(!win_loop_done) { diff --git a/checkin_notes b/checkin_notes index d30c8cf77b..c9674ff836 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7066,3 +7066,20 @@ Karl 2003-10-25 client/win/ wingui_mainwindow.cpp + +David 25 Oct 2003 + - removed code that caps backoff count at one + TODO: we still need to reexamine the backoff policy, + so that multiple file failures don't lead to huge backoffs + - moved OpenGL init calls from the start of the event loop + back to SetMode, undoing an earlier change. + Turns out the need to be in SetMode because it creates a new + window every time. + This should fix the bug that cause Astropulse to show no graphics. + TODO: make sure that when an application window is hidden, + no rendering work gets done. + + api/ + windows_opengl.C + client/ + scheduler_op.C diff --git a/client/scheduler_op.C b/client/scheduler_op.C index db063b92de..32f0bcf8a9 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -170,10 +170,6 @@ int SCHEDULER_OP::set_min_rpc_time(PROJECT* p) { void SCHEDULER_OP::backoff(PROJECT* p, char *error_msg ) { msg_printf(p, MSG_ERROR, error_msg); - // Don't back off more if already backed off - // - if (p->min_rpc_time > 0) return; - if (p->master_fetch_failures >= gstate.master_fetch_retry_cap) { p->master_url_fetch_pending = true; } else {