mirror of https://github.com/BOINC/boinc.git
parent
c2444c5206
commit
d5e035456d
|
@ -219,7 +219,6 @@ static int setup_shared_mem() {
|
||||||
app_client_shm = new APP_CLIENT_SHM;
|
app_client_shm = new APP_CLIENT_SHM;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
char buf[256];
|
|
||||||
sprintf(buf, "%s%s", SHM_PREFIX, aid.shmem_seg_name);
|
sprintf(buf, "%s%s", SHM_PREFIX, aid.shmem_seg_name);
|
||||||
hSharedMem = attach_shmem(buf, (void**)&app_client_shm->shm);
|
hSharedMem = attach_shmem(buf, (void**)&app_client_shm->shm);
|
||||||
if (hSharedMem == NULL) {
|
if (hSharedMem == NULL) {
|
||||||
|
@ -501,7 +500,6 @@ int boinc_temporary_exit(int delay) {
|
||||||
//
|
//
|
||||||
void boinc_exit(int status) {
|
void boinc_exit(int status) {
|
||||||
int retval;
|
int retval;
|
||||||
char buf[256];
|
|
||||||
|
|
||||||
if (options.backwards_compatible_graphics) {
|
if (options.backwards_compatible_graphics) {
|
||||||
graphics_cleanup();
|
graphics_cleanup();
|
||||||
|
@ -774,9 +772,10 @@ static void handle_trickle_down_msg() {
|
||||||
// runs in timer thread
|
// runs in timer thread
|
||||||
//
|
//
|
||||||
static void handle_process_control_msg() {
|
static void handle_process_control_msg() {
|
||||||
char buf[MSG_CHANNEL_SIZE], log_buf[256];
|
char buf[MSG_CHANNEL_SIZE];
|
||||||
if (app_client_shm->shm->process_control_request.get_msg(buf)) {
|
if (app_client_shm->shm->process_control_request.get_msg(buf)) {
|
||||||
#ifdef DEBUG_BOINC_API
|
#ifdef DEBUG_BOINC_API
|
||||||
|
char log_buf[256]
|
||||||
fprintf(stderr, "%s got process control msg %s\n",
|
fprintf(stderr, "%s got process control msg %s\n",
|
||||||
boinc_msg_prefix(log_buf), buf
|
boinc_msg_prefix(log_buf), buf
|
||||||
);
|
);
|
||||||
|
|
|
@ -50,8 +50,9 @@ static UINT_PTR gfx_timer_id = 0;
|
||||||
static bool fullscreen;
|
static bool fullscreen;
|
||||||
|
|
||||||
void boinc_close_window_and_quit(const char* p) {
|
void boinc_close_window_and_quit(const char* p) {
|
||||||
|
char buf[256];
|
||||||
fprintf(stderr, "%s Close event (%s) detected, shutting down.\n",
|
fprintf(stderr, "%s Close event (%s) detected, shutting down.\n",
|
||||||
boinc_msg_prefix(), p
|
boinc_msg_prefix(buf), p
|
||||||
);
|
);
|
||||||
|
|
||||||
window_ready = false;
|
window_ready = false;
|
||||||
|
@ -72,6 +73,7 @@ void boinc_close_window_and_quit(const char* p) {
|
||||||
|
|
||||||
void SetupPixelFormat(HDC win_dc) {
|
void SetupPixelFormat(HDC win_dc) {
|
||||||
int nPixelFormat;
|
int nPixelFormat;
|
||||||
|
char buf[256];
|
||||||
|
|
||||||
static PIXELFORMATDESCRIPTOR pfd = {
|
static PIXELFORMATDESCRIPTOR pfd = {
|
||||||
sizeof(PIXELFORMATDESCRIPTOR), // size of structure.
|
sizeof(PIXELFORMATDESCRIPTOR), // size of structure.
|
||||||
|
@ -103,7 +105,7 @@ void SetupPixelFormat(HDC win_dc) {
|
||||||
if (!SetPixelFormat(win_dc, nPixelFormat, &pfd)) {
|
if (!SetPixelFormat(win_dc, nPixelFormat, &pfd)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s ERROR: Couldn't set pixel format for device context (0x%x).\n",
|
"%s ERROR: Couldn't set pixel format for device context (0x%x).\n",
|
||||||
boinc_msg_prefix(), GetLastError()
|
boinc_msg_prefix(buf), GetLastError()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -113,6 +115,7 @@ static void make_window(const char* title) {
|
||||||
int width, height;
|
int width, height;
|
||||||
DWORD dwExStyle;
|
DWORD dwExStyle;
|
||||||
DWORD dwStyle;
|
DWORD dwStyle;
|
||||||
|
char buf[256];
|
||||||
|
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
HDC screenDC=GetDC(NULL);
|
HDC screenDC=GetDC(NULL);
|
||||||
|
@ -165,14 +168,14 @@ static void make_window(const char* title) {
|
||||||
if (!SetForegroundWindow(window)) {
|
if (!SetForegroundWindow(window)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s ERROR: SetForegroundWindow() failed (0x%x).\n",
|
"%s ERROR: SetForegroundWindow() failed (0x%x).\n",
|
||||||
boinc_msg_prefix(), GetLastError()
|
boinc_msg_prefix(buf), GetLastError()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GetCursorPos(&mousePos)) {
|
if (!GetCursorPos(&mousePos)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s ERROR: GetCursorPos() failed (0x%x).\n",
|
"%s ERROR: GetCursorPos() failed (0x%x).\n",
|
||||||
boinc_msg_prefix(), GetLastError()
|
boinc_msg_prefix(buf), GetLastError()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,7 +183,7 @@ static void make_window(const char* title) {
|
||||||
if (!win_dc) {
|
if (!win_dc) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s ERROR: GetDC() failed (0x%x).\n",
|
"%s ERROR: GetDC() failed (0x%x).\n",
|
||||||
boinc_msg_prefix(), GetLastError()
|
boinc_msg_prefix(buf), GetLastError()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
SetupPixelFormat(win_dc);
|
SetupPixelFormat(win_dc);
|
||||||
|
@ -189,7 +192,7 @@ static void make_window(const char* title) {
|
||||||
if (!gl_dc) {
|
if (!gl_dc) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s ERROR: wglCreateContext() failed (0x%x).\n",
|
"%s ERROR: wglCreateContext() failed (0x%x).\n",
|
||||||
boinc_msg_prefix(), GetLastError()
|
boinc_msg_prefix(buf), GetLastError()
|
||||||
);
|
);
|
||||||
ReleaseDC(window, win_dc);
|
ReleaseDC(window, win_dc);
|
||||||
return;
|
return;
|
||||||
|
@ -198,7 +201,7 @@ static void make_window(const char* title) {
|
||||||
if(!wglMakeCurrent(win_dc, gl_dc)) {
|
if(!wglMakeCurrent(win_dc, gl_dc)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s ERROR: wglMakeCurrent() failed (0x%x).\n",
|
"%s ERROR: wglMakeCurrent() failed (0x%x).\n",
|
||||||
boinc_msg_prefix(), GetLastError()
|
boinc_msg_prefix(buf), GetLastError()
|
||||||
);
|
);
|
||||||
ReleaseDC(window, win_dc);
|
ReleaseDC(window, win_dc);
|
||||||
wglDeleteContext(gl_dc);
|
wglDeleteContext(gl_dc);
|
||||||
|
@ -408,17 +411,18 @@ static VOID CALLBACK timer_handler(HWND, UINT, UINT, DWORD) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void boinc_graphics_loop(int argc, char** argv, const char* title) {
|
void boinc_graphics_loop(int argc, char** argv, const char* title) {
|
||||||
|
char buf[256];
|
||||||
if (!diagnostics_is_initialized()) {
|
if (!diagnostics_is_initialized()) {
|
||||||
boinc_init_graphics_diagnostics(BOINC_DIAG_DEFAULTS);
|
boinc_init_graphics_diagnostics(BOINC_DIAG_DEFAULTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "%s Starting graphics application.\n", boinc_msg_prefix());
|
fprintf(stderr, "%s Starting graphics application.\n", boinc_msg_prefix(buf));
|
||||||
|
|
||||||
for (int i=1; i<argc; i++) {
|
for (int i=1; i<argc; i++) {
|
||||||
if (!strcmp(argv[i], "--fullscreen")) {
|
if (!strcmp(argv[i], "--fullscreen")) {
|
||||||
fullscreen = true;
|
fullscreen = true;
|
||||||
fprintf(stderr, "%s fullscreen mode requested.\n",
|
fprintf(stderr, "%s fullscreen mode requested.\n",
|
||||||
boinc_msg_prefix()
|
boinc_msg_prefix(buf)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -446,7 +450,7 @@ void boinc_graphics_loop(int argc, char** argv, const char* title) {
|
||||||
unreg_win_class();
|
unreg_win_class();
|
||||||
|
|
||||||
fprintf(stderr, "%s Shutting down graphics application.\n",
|
fprintf(stderr, "%s Shutting down graphics application.\n",
|
||||||
boinc_msg_prefix()
|
boinc_msg_prefix(buf)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue