fix msys2 compilation when opengl, vulkan and d3d9 are disabled

This commit is contained in:
Brad Parker 2017-01-13 14:31:36 -05:00
parent 69ce5bdd65
commit 7c6bf6aaf7
5 changed files with 24 additions and 3 deletions

View File

@ -60,11 +60,13 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam);
} }
#endif #endif
#ifdef HAVE_D3D9
extern "C" bool dinput_handle_message(void *dinput, UINT message, extern "C" bool dinput_handle_message(void *dinput, UINT message,
WPARAM wParam, LPARAM lParam); WPARAM wParam, LPARAM lParam);
extern void *dinput_gdi; extern void *dinput_gdi;
extern void *dinput_wgl; extern void *dinput_wgl;
extern void *dinput; extern void *dinput;
#endif
unsigned g_resize_width = 0; unsigned g_resize_width = 0;
unsigned g_resize_height = 0; unsigned g_resize_height = 0;
@ -426,6 +428,7 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
extern void ui_window_win32_set_droppable(void *data, bool droppable); extern void ui_window_win32_set_droppable(void *data, bool droppable);
#ifdef HAVE_D3D9
LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message, LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message,
WPARAM wparam, LPARAM lparam) WPARAM wparam, LPARAM lparam)
{ {
@ -466,11 +469,15 @@ LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message,
return 0; return 0;
} }
#ifdef HAVE_D3D9
if (dinput && dinput_handle_message(dinput, message, wparam, lparam)) if (dinput && dinput_handle_message(dinput, message, wparam, lparam))
return 0; return 0;
#endif
return DefWindowProc(hwnd, message, wparam, lparam); return DefWindowProc(hwnd, message, wparam, lparam);
} }
#endif
#if defined(HAVE_OPENGL) || defined(HAVE_VULKAN)
LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message, LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message,
WPARAM wparam, LPARAM lparam) WPARAM wparam, LPARAM lparam)
{ {
@ -510,10 +517,13 @@ LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message,
return 0; return 0;
} }
#ifdef HAVE_D3D9
if (dinput_wgl && dinput_handle_message(dinput_wgl, message, wparam, lparam)) if (dinput_wgl && dinput_handle_message(dinput_wgl, message, wparam, lparam))
return 0; return 0;
#endif
return DefWindowProc(hwnd, message, wparam, lparam); return DefWindowProc(hwnd, message, wparam, lparam);
} }
#endif
LRESULT CALLBACK WndProcGDI(HWND hwnd, UINT message, LRESULT CALLBACK WndProcGDI(HWND hwnd, UINT message,
WPARAM wparam, LPARAM lparam) WPARAM wparam, LPARAM lparam)
@ -569,8 +579,10 @@ LRESULT CALLBACK WndProcGDI(HWND hwnd, UINT message,
return 0; return 0;
} }
#ifdef HAVE_D3D9
if (dinput_gdi && dinput_handle_message(dinput_gdi, message, wparam, lparam)) if (dinput_gdi && dinput_handle_message(dinput_gdi, message, wparam, lparam))
return 0; return 0;
#endif
return DefWindowProc(hwnd, message, wparam, lparam); return DefWindowProc(hwnd, message, wparam, lparam);
} }

View File

@ -120,11 +120,15 @@ void win32_window_reset(void);
void win32_destroy_window(void); void win32_destroy_window(void);
#ifdef HAVE_D3D9
LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message, LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message,
WPARAM wparam, LPARAM lparam); WPARAM wparam, LPARAM lparam);
#endif
#if defined(HAVE_OPENGL) || defined(HAVE_VULKAN)
LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message, LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message,
WPARAM wparam, LPARAM lparam); WPARAM wparam, LPARAM lparam);
#endif
LRESULT CALLBACK WndProcGDI(HWND hwnd, UINT message, LRESULT CALLBACK WndProcGDI(HWND hwnd, UINT message,
WPARAM wparam, LPARAM lparam); WPARAM wparam, LPARAM lparam);

View File

@ -26,7 +26,7 @@
#include "../menu_display.h" #include "../menu_display.h"
#if defined(_WIN32) && !defined(_XBOX) #if defined(_WIN32) && !defined(_XBOX)
#include "../common/win32_common.h" #include "../../gfx/common/win32_common.h"
#endif #endif
static void *menu_display_gdi_get_default_mvp(void) static void *menu_display_gdi_get_default_mvp(void)

View File

@ -455,7 +455,9 @@ if [ "$HAVE_MATERIALUI" != 'no' ] || [ "$HAVE_XMB" != 'no' ] || [ "$HAVE_ZARCH"
echo "Notice: RGUI not available, MaterialUI, XMB and ZARCH will also be disabled." echo "Notice: RGUI not available, MaterialUI, XMB and ZARCH will also be disabled."
elif [ "$HAVE_OPENGL" = 'no' ] && [ "$HAVE_OPENGLES" = 'no' ] && [ "$HAVE_VULKAN" = 'no' ]; then elif [ "$HAVE_OPENGL" = 'no' ] && [ "$HAVE_OPENGLES" = 'no' ] && [ "$HAVE_VULKAN" = 'no' ]; then
if [ "$OS" = 'Win32' ]; then if [ "$OS" = 'Win32' ]; then
echo "Notice: Hardware rendering context not available, the GDI video driver must be used." HAVE_SHADERPIPELINE=no
HAVE_VULKAN=no
echo "Notice: Hardware rendering context not available."
else else
HAVE_MATERIALUI=no HAVE_MATERIALUI=no
HAVE_XMB=no HAVE_XMB=no

View File

@ -364,6 +364,7 @@ void shader_dlg_show(HWND parent_hwnd)
window->set_focused(&g_shader_dlg.window); window->set_focused(&g_shader_dlg.window);
} }
#if defined(HAVE_OPENGL) || defined(HAVE_VULKAN)
static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message,
WPARAM wparam, LPARAM lparam) WPARAM wparam, LPARAM lparam)
{ {
@ -440,6 +441,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message,
return DefWindowProc(hwnd, message, wparam, lparam); return DefWindowProc(hwnd, message, wparam, lparam);
} }
#endif
bool win32_window_init(WNDCLASSEX *wndclass, bool win32_window_init(WNDCLASSEX *wndclass,
bool fullscreen, const char *class_name) bool fullscreen, const char *class_name)
@ -475,6 +477,7 @@ bool win32_window_init(WNDCLASSEX *wndclass,
bool win32_shader_dlg_init(void) bool win32_shader_dlg_init(void)
{ {
#if defined(HAVE_OPENGL) || defined(HAVE_VULKAN)
static bool inited = false; static bool inited = false;
int pos_y; int pos_y;
HFONT hFont; HFONT hFont;
@ -522,7 +525,7 @@ bool win32_shader_dlg_init(void)
pos_y += SHADER_DLG_SEPARATOR_HEIGHT + SHADER_DLG_CTRL_MARGIN; pos_y += SHADER_DLG_SEPARATOR_HEIGHT + SHADER_DLG_CTRL_MARGIN;
g_shader_dlg.parameters_start_y = pos_y; g_shader_dlg.parameters_start_y = pos_y;
#endif
return true; return true;
} }