Add a separate build option for the OpenGL renderer
This commit is contained in:
@@ -69,6 +69,7 @@ CMAKE_DEPENDENT_OPTION(MGA "Matrox Mystique graphics adapters" ON "DEV_BRANCH" O
|
|||||||
CMAKE_DEPENDENT_OPTION(NO_SIO "Machines without emulated Super I/O chips" ON "DEV_BRANCH" OFF)
|
CMAKE_DEPENDENT_OPTION(NO_SIO "Machines without emulated Super I/O chips" ON "DEV_BRANCH" OFF)
|
||||||
CMAKE_DEPENDENT_OPTION(OLIVETTI "Olivetti M290" ON "DEV_BRANCH" OFF)
|
CMAKE_DEPENDENT_OPTION(OLIVETTI "Olivetti M290" ON "DEV_BRANCH" OFF)
|
||||||
CMAKE_DEPENDENT_OPTION(OPEN_AT "OpenAT" ON "DEV_BRANCH" OFF)
|
CMAKE_DEPENDENT_OPTION(OPEN_AT "OpenAT" ON "DEV_BRANCH" OFF)
|
||||||
|
CMAKE_DEPENDENT_OPTION(OPENGL "OpenGL 3.3 Core renderer" ON "DEV_BRANCH" OFF)
|
||||||
CMAKE_DEPENDENT_OPTION(PAS16 "Pro Audio Spectrum 16" OFF "DEV_BRANCH" OFF)
|
CMAKE_DEPENDENT_OPTION(PAS16 "Pro Audio Spectrum 16" OFF "DEV_BRANCH" OFF)
|
||||||
CMAKE_DEPENDENT_OPTION(PS2M70T4 "IBM PS/2 model 70 (type 4)" ON "DEV_BRANCH" OFF)
|
CMAKE_DEPENDENT_OPTION(PS2M70T4 "IBM PS/2 model 70 (type 4)" ON "DEV_BRANCH" OFF)
|
||||||
CMAKE_DEPENDENT_OPTION(S3TRIO3D2X "S3 Trio3D/2X" ON "DEV_BRANCH" OFF)
|
CMAKE_DEPENDENT_OPTION(S3TRIO3D2X "S3 Trio3D/2X" ON "DEV_BRANCH" OFF)
|
||||||
|
@@ -529,7 +529,7 @@ load_general(void)
|
|||||||
enable_discord = !!config_get_int(cat, "enable_discord", 0);
|
enable_discord = !!config_get_int(cat, "enable_discord", 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEV_BRANCH /* feature-opengl */
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
video_framerate = config_get_int(cat, "video_gl_framerate", -1);
|
video_framerate = config_get_int(cat, "video_gl_framerate", -1);
|
||||||
video_vsync = config_get_int(cat, "video_gl_vsync", 0);
|
video_vsync = config_get_int(cat, "video_gl_vsync", 0);
|
||||||
strcpy_s(video_shader, sizeof(video_shader), config_get_string(cat, "video_gl_shader", ""));
|
strcpy_s(video_shader, sizeof(video_shader), config_get_string(cat, "video_gl_shader", ""));
|
||||||
@@ -1974,7 +1974,7 @@ save_general(void)
|
|||||||
config_delete_var(cat, "enable_discord");
|
config_delete_var(cat, "enable_discord");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEV_BRANCH /* feature-opengl */
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
if (video_framerate != -1)
|
if (video_framerate != -1)
|
||||||
config_set_int(cat, "video_gl_framerate", video_framerate);
|
config_set_int(cat, "video_gl_framerate", video_framerate);
|
||||||
else
|
else
|
||||||
|
@@ -341,7 +341,7 @@
|
|||||||
#define IDM_DISCORD 40090
|
#define IDM_DISCORD 40090
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEV_BRANCH /* feature-opengl */
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
#define IDM_VID_GL_FPS_BLITTER 40100
|
#define IDM_VID_GL_FPS_BLITTER 40100
|
||||||
#define IDM_VID_GL_FPS_25 40101
|
#define IDM_VID_GL_FPS_25 40101
|
||||||
#define IDM_VID_GL_FPS_30 40102
|
#define IDM_VID_GL_FPS_30 40102
|
||||||
|
@@ -63,7 +63,7 @@ DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
|
|||||||
#define ZIP_SUBMENU_NAME L"ZIPSubmenu"
|
#define ZIP_SUBMENU_NAME L"ZIPSubmenu"
|
||||||
#define MO_SUBMENU_NAME L"MOSubmenu"
|
#define MO_SUBMENU_NAME L"MOSubmenu"
|
||||||
|
|
||||||
#ifdef DEV_BRANCH /* feature-opengl */
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
#define VID_GL_SUBMENU L"VidGLSubMenu"
|
#define VID_GL_SUBMENU L"VidGLSubMenu"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -66,7 +66,7 @@ BEGIN
|
|||||||
MENUITEM "&SDL (Software)", IDM_VID_SDL_SW
|
MENUITEM "&SDL (Software)", IDM_VID_SDL_SW
|
||||||
MENUITEM "SDL (&Hardware)", IDM_VID_SDL_HW
|
MENUITEM "SDL (&Hardware)", IDM_VID_SDL_HW
|
||||||
MENUITEM "SDL (&OpenGL)", IDM_VID_SDL_OPENGL
|
MENUITEM "SDL (&OpenGL)", IDM_VID_SDL_OPENGL
|
||||||
#ifdef DEV_BRANCH /* feature-opengl */
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
MENUITEM "Open&GL (3.3 Core)", IDM_VID_OPENGL_CORE
|
MENUITEM "Open&GL (3.3 Core)", IDM_VID_OPENGL_CORE
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_VNC
|
#ifdef USE_VNC
|
||||||
@@ -237,7 +237,7 @@ BEGIN
|
|||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
#ifdef DEV_BRANCH /* feature-opengl */
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
VidGLSubMenu MENU DISCARDABLE
|
VidGLSubMenu MENU DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
POPUP "Target &framerate"
|
POPUP "Target &framerate"
|
||||||
|
@@ -20,7 +20,7 @@ add_library(plat OBJECT win.c win_dynld.c win_thread.c win_cdrom.c
|
|||||||
|
|
||||||
add_library(ui OBJECT win_ui.c win_stbar.c win_sdl.c win_dialog.c win_about.c
|
add_library(ui OBJECT win_ui.c win_stbar.c win_sdl.c win_dialog.c win_about.c
|
||||||
win_settings.c win_devconf.c win_snd_gain.c win_specify_dim.c win_new_floppy.c
|
win_settings.c win_devconf.c win_snd_gain.c win_specify_dim.c win_new_floppy.c
|
||||||
win_jsconf.c win_media_menu.c 86Box.rc glad.c win_opengl.c win_opengl_glslp.c)
|
win_jsconf.c win_media_menu.c 86Box.rc)
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# MSVC complains when we include the manifest from 86Box.rc...
|
# MSVC complains when we include the manifest from 86Box.rc...
|
||||||
@@ -49,5 +49,11 @@ if(DISCORD)
|
|||||||
target_sources(ui PRIVATE win_discord.c)
|
target_sources(ui PRIVATE win_discord.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(OPENGL)
|
||||||
|
# PUBLIC due to config.c
|
||||||
|
target_compile_definitions(ui PUBLIC USE_OPENGL)
|
||||||
|
target_sources(ui PRIVATE glad.c win_opengl.c win_opengl_glslp.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(86Box advapi32 comctl32 comdlg32 gdi32 shell32 iphlpapi
|
target_link_libraries(86Box advapi32 comctl32 comdlg32 gdi32 shell32 iphlpapi
|
||||||
dxguid imm32 hid setupapi uxtheme version winmm psapi)
|
dxguid imm32 hid setupapi uxtheme version winmm psapi)
|
||||||
|
@@ -63,6 +63,9 @@ ifeq ($(DEV_BUILD), y)
|
|||||||
ifndef OPEN_AT
|
ifndef OPEN_AT
|
||||||
OPEN_AT := y
|
OPEN_AT := y
|
||||||
endif
|
endif
|
||||||
|
ifndef OPENGL
|
||||||
|
OPENGL := y
|
||||||
|
endif
|
||||||
ifndef PAS16
|
ifndef PAS16
|
||||||
PAS16 := n
|
PAS16 := n
|
||||||
endif
|
endif
|
||||||
@@ -133,6 +136,9 @@ else
|
|||||||
ifndef OPEN_AT
|
ifndef OPEN_AT
|
||||||
OPEN_AT := n
|
OPEN_AT := n
|
||||||
endif
|
endif
|
||||||
|
ifndef OPENGL
|
||||||
|
OPENGL := n
|
||||||
|
endif
|
||||||
ifndef PAS16
|
ifndef PAS16
|
||||||
PAS16 := n
|
PAS16 := n
|
||||||
endif
|
endif
|
||||||
@@ -433,7 +439,7 @@ ifeq ($(WX), y)
|
|||||||
UIOBJ := wx_main.o wx_ui.o wx_stbar.o wx_render.o
|
UIOBJ := wx_main.o wx_ui.o wx_stbar.o wx_render.o
|
||||||
else
|
else
|
||||||
UIOBJ := win_ui.o win_stbar.o \
|
UIOBJ := win_ui.o win_stbar.o \
|
||||||
win_sdl.o win_opengl.o win_opengl_glslp.o glad.o \
|
win_sdl.o \
|
||||||
win_dialog.o win_about.o \
|
win_dialog.o win_about.o \
|
||||||
win_settings.o win_devconf.o win_snd_gain.o win_specify_dim.o \
|
win_settings.o win_devconf.o win_snd_gain.o win_specify_dim.o \
|
||||||
win_new_floppy.o win_jsconf.o win_media_menu.o
|
win_new_floppy.o win_jsconf.o win_media_menu.o
|
||||||
@@ -527,6 +533,12 @@ ifeq ($(OPEN_AT), y)
|
|||||||
OPTS += -DUSE_OPEN_AT
|
OPTS += -DUSE_OPEN_AT
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(OPENGL), y)
|
||||||
|
OPTS += -DUSE_OPENGL
|
||||||
|
RFLAGS += -DUSE_OPENGL
|
||||||
|
DEVBROBJ += win_opengl.o win_opengl_glslp.o glad.o
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(PAS16), y)
|
ifeq ($(PAS16), y)
|
||||||
OPTS += -DUSE_PAS16
|
OPTS += -DUSE_PAS16
|
||||||
DEVBROBJ += snd_pas16.o
|
DEVBROBJ += snd_pas16.o
|
||||||
|
@@ -104,7 +104,7 @@ static const struct {
|
|||||||
{ "SDL_Software", 1, (int(*)(void*))sdl_inits, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs, NULL },
|
{ "SDL_Software", 1, (int(*)(void*))sdl_inits, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs, NULL },
|
||||||
{ "SDL_Hardware", 1, (int(*)(void*))sdl_inith, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs, NULL },
|
{ "SDL_Hardware", 1, (int(*)(void*))sdl_inith, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs, NULL },
|
||||||
{ "SDL_OpenGL", 1, (int(*)(void*))sdl_initho, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs, NULL }
|
{ "SDL_OpenGL", 1, (int(*)(void*))sdl_initho, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs, NULL }
|
||||||
#ifdef DEV_BRANCH /* feature-opengl */
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
,{ "OpenGL_Core", 1, (int(*)(void*))opengl_init, opengl_close, opengl_resize, opengl_pause, NULL, opengl_set_fs, opengl_reload}
|
,{ "OpenGL_Core", 1, (int(*)(void*))opengl_init, opengl_close, opengl_resize, opengl_pause, NULL, opengl_set_fs, opengl_reload}
|
||||||
#else
|
#else
|
||||||
,{ "OpenGL_Core", 1, (int(*)(void*))sdl_initho, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs, NULL } /* fall back to SDL_OpenGL */
|
,{ "OpenGL_Core", 1, (int(*)(void*))sdl_initho, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs, NULL } /* fall back to SDL_OpenGL */
|
||||||
@@ -939,7 +939,7 @@ plat_vidapi_name(int api)
|
|||||||
case 2:
|
case 2:
|
||||||
name = "sdl_opengl";
|
name = "sdl_opengl";
|
||||||
break;
|
break;
|
||||||
#ifdef DEV_BRANCH /* feature-opengl */
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
case 3:
|
case 3:
|
||||||
name = "opengl_core";
|
name = "opengl_core";
|
||||||
break;
|
break;
|
||||||
|
@@ -207,7 +207,7 @@ int delete_submenu(HMENU parent, HMENU target)
|
|||||||
static void
|
static void
|
||||||
show_render_options_menu()
|
show_render_options_menu()
|
||||||
{
|
{
|
||||||
#ifdef DEV_BRANCH /* feature-opengl */
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
static int menu_vidapi = -1;
|
static int menu_vidapi = -1;
|
||||||
static HMENU cur_menu = NULL;
|
static HMENU cur_menu = NULL;
|
||||||
|
|
||||||
@@ -288,7 +288,7 @@ ResetAllMenus(void)
|
|||||||
CheckMenuItem(menuMain, IDM_VID_SDL_SW, MF_UNCHECKED);
|
CheckMenuItem(menuMain, IDM_VID_SDL_SW, MF_UNCHECKED);
|
||||||
CheckMenuItem(menuMain, IDM_VID_SDL_HW, MF_UNCHECKED);
|
CheckMenuItem(menuMain, IDM_VID_SDL_HW, MF_UNCHECKED);
|
||||||
CheckMenuItem(menuMain, IDM_VID_SDL_OPENGL, MF_UNCHECKED);
|
CheckMenuItem(menuMain, IDM_VID_SDL_OPENGL, MF_UNCHECKED);
|
||||||
#ifdef DEV_BRANCH /* feature-opengl */
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
CheckMenuItem(menuMain, IDM_VID_OPENGL_CORE, MF_UNCHECKED);
|
CheckMenuItem(menuMain, IDM_VID_OPENGL_CORE, MF_UNCHECKED);
|
||||||
show_render_options_menu();
|
show_render_options_menu();
|
||||||
#endif
|
#endif
|
||||||
@@ -738,7 +738,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
case IDM_VID_SDL_SW:
|
case IDM_VID_SDL_SW:
|
||||||
case IDM_VID_SDL_HW:
|
case IDM_VID_SDL_HW:
|
||||||
case IDM_VID_SDL_OPENGL:
|
case IDM_VID_SDL_OPENGL:
|
||||||
#ifdef DEV_BRANCH /* feature-opengl */
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
case IDM_VID_OPENGL_CORE:
|
case IDM_VID_OPENGL_CORE:
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_VNC
|
#ifdef USE_VNC
|
||||||
@@ -751,7 +751,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
show_render_options_menu();
|
show_render_options_menu();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef DEV_BRANCH /* feature-opengl */
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
case IDM_VID_GL_FPS_BLITTER:
|
case IDM_VID_GL_FPS_BLITTER:
|
||||||
case IDM_VID_GL_FPS_25:
|
case IDM_VID_GL_FPS_25:
|
||||||
case IDM_VID_GL_FPS_30:
|
case IDM_VID_GL_FPS_30:
|
||||||
|
Reference in New Issue
Block a user