From fc2a39cd58b8ef9df45d2ae6a25141f9e51e0bff Mon Sep 17 00:00:00 2001 From: Themaister Date: Sun, 7 Aug 2011 21:15:50 +0200 Subject: [PATCH] More appropriate renaming. --- gfx/gfx_common.c | 18 +++++++++++++----- gfx/gfx_common.h | 2 +- gfx/gl.c | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/gfx/gfx_common.c b/gfx/gfx_common.c index 5bf00bb6c7..abbe69a60d 100644 --- a/gfx/gfx_common.c +++ b/gfx/gfx_common.c @@ -63,11 +63,8 @@ bool gfx_window_title(char *buf, size_t size) #ifdef _WIN32 #include #include "dynamic.h" -void gfx_set_composition(void) +void gfx_set_dwm(void) { - if (!g_settings.video.disable_composition) - return; - static bool inited = false; if (inited) return; @@ -76,10 +73,20 @@ void gfx_set_composition(void) dylib_t lib = dylib_load("dwmapi.dll"); if (!lib) { - SSNES_ERR("Did not find dwmapi.dll"); + SSNES_LOG("Did not find dwmapi.dll"); return; } + HRESULT (WINAPI *mmcss)(BOOL) = (HRESULT (WINAPI*)(BOOL))dylib_proc(lib, "DwmEnableMMCSS"); + if (mmcss) + { + SSNES_LOG("Setting multimedia scheduling for DWM.\n"); + mmcss(TRUE); + } + + if (!g_settings.video.disable_composition) + return; + HRESULT (WINAPI *composition_enable)(UINT) = (HRESULT (WINAPI*)(UINT))dylib_proc(lib, "DwmEnableComposition"); if (!composition_enable) { @@ -94,5 +101,6 @@ void gfx_set_composition(void) dylib_close(lib); } + #endif diff --git a/gfx/gfx_common.h b/gfx/gfx_common.h index 2a24933da6..e73f757f02 100644 --- a/gfx/gfx_common.h +++ b/gfx/gfx_common.h @@ -25,7 +25,7 @@ bool gfx_window_title(char *buf, size_t size); void gfx_window_title_reset(void); #ifdef _WIN32 -void gfx_set_composition(void); +void gfx_set_dwm(void); #endif #endif diff --git a/gfx/gl.c b/gfx/gl.c index 3e844e6dca..4fd2a91d46 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -1037,7 +1037,7 @@ static void gl_set_nonblock_state(void *data, bool state) static void* gl_init(const video_info_t *video, const input_driver_t **input, void **input_data) { #ifdef _WIN32 - gfx_set_composition(); + gfx_set_dwm(); #endif if (SDL_Init(SDL_INIT_VIDEO) < 0)