summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--makefile8
-rw-r--r--scripts/genie.lua2
-rw-r--r--scripts/src/osd/sdl.lua55
-rw-r--r--scripts/src/osd/sdl_cfg.lua19
4 files changed, 75 insertions, 9 deletions
diff --git a/makefile b/makefile
index 0a0443a576c..387b6be445f 100644
--- a/makefile
+++ b/makefile
@@ -328,6 +328,14 @@ endif
endif
PARAMS += --USE_QT=$(USE_QT)
+ifdef NO_OPENGL
+PARAMS += --NO_OPENGL='$(NO_OPENGL)'
+endif
+
+ifdef USE_DISPATCH_GL
+PARAMS += --USE_DISPATCH_GL='$(USE_DISPATCH_GL)'
+endif
+
ifdef NO_X11
PARAMS += --NO_X11='$(NO_X11)'
endif
diff --git a/scripts/genie.lua b/scripts/genie.lua
index 2511d22668e..9d0e78c92a3 100644
--- a/scripts/genie.lua
+++ b/scripts/genie.lua
@@ -697,7 +697,6 @@ configuration { "nacl*" }
configuration { "linux-*" }
links {
"dl",
- "GL",
}
defines
{
@@ -727,7 +726,6 @@ configuration { "mingw*" }
}
if _OPTIONS["osd"]=="sdl" then
links {
- "opengl32",
"SDL2",
"imm32",
"version",
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua
index 93de0e87dfd..d3a8dc0faa5 100644
--- a/scripts/src/osd/sdl.lua
+++ b/scripts/src/osd/sdl.lua
@@ -23,12 +23,22 @@ function maintargetosdoptions(_target)
"SDL_ttf",
}
end
+ if _OPTIONS["NO_OPENGL"]~="1" and _OPTIONS["USE_DISPATCH_GL"]~="1" then
+ links {
+ "GL"
+ }
+ end
linkoptions {
string.gsub(os.outputof("pkg-config --libs fontconfig"), '[\r\n]+', ' '),
}
end
if _OPTIONS["targetos"]=="windows" then
+ if _OPTIONS["NO_OPENGL"]~="1" and _OPTIONS["USE_DISPATCH_GL"]~="1" then
+ links {
+ "opengl32"
+ }
+ end
configuration { "mingw*" }
linkoptions{
"-municode",
@@ -44,7 +54,6 @@ function maintargetosdoptions(_target)
configuration { "vs*" }
links {
"SDL2",
- "opengl32",
}
configuration {}
@@ -104,6 +113,40 @@ end
newoption {
+ trigger = "NO_OPENGL",
+ description = "Disable use of OpenGL",
+ allowed = {
+ { "0", "Enable OpenGL" },
+ { "1", "Disable OpenGL" },
+ },
+}
+
+if not _OPTIONS["NO_OPENGL"] then
+ if _OPTIONS["targetos"]=="os2" then
+ _OPTIONS["NO_OPENGL"] = "1"
+ else
+ _OPTIONS["NO_OPENGL"] = "0"
+ end
+end
+
+newoption {
+ trigger = "USE_DISPATCH_GL",
+ description = "Use GL-dispatching",
+ allowed = {
+ { "0", "Link to OpenGL library" },
+ { "1", "Use GL-dispatching" },
+ },
+}
+
+if not _OPTIONS["USE_DISPATCH_GL"] then
+ if USE_BGFX == 1 then
+ _OPTIONS["USE_DISPATCH_GL"] = "0"
+ else
+ _OPTIONS["USE_DISPATCH_GL"] = "1"
+ end
+end
+
+newoption {
trigger = "NO_X11",
description = "Disable use of X11",
allowed = {
@@ -365,13 +408,10 @@ project ("osd_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/sdl/watchdog.c",
MAME_DIR .. "src/osd/modules/lib/osdobj_common.c",
MAME_DIR .. "src/osd/modules/render/drawsdl.c",
- MAME_DIR .. "src/osd/modules/render/drawogl.c",
MAME_DIR .. "src/osd/modules/debugger/none.c",
MAME_DIR .. "src/osd/modules/debugger/debugint.c",
MAME_DIR .. "src/osd/modules/debugger/debugwin.c",
MAME_DIR .. "src/osd/modules/debugger/debugqt.c",
- MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.c",
- MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.c",
MAME_DIR .. "src/osd/modules/font/font_sdl.c",
MAME_DIR .. "src/osd/modules/font/font_windows.c",
MAME_DIR .. "src/osd/modules/font/font_osx.c",
@@ -386,6 +426,13 @@ project ("osd_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/modules/sound/sdl_sound.c",
MAME_DIR .. "src/osd/modules/sound/none.c",
}
+ if _OPTIONS["NO_OPENGL"]~="1" then
+ files {
+ MAME_DIR .. "src/osd/modules/render/drawogl.c",
+ MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.c",
+ MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.c",
+ }
+ end
if _OPTIONS["SDL_LIBVER"]=="sdl2" then
files {
MAME_DIR .. "src/osd/modules/render/draw13.c",
diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua
index 909816b56a4..dfebfe5a211 100644
--- a/scripts/src/osd/sdl_cfg.lua
+++ b/scripts/src/osd/sdl_cfg.lua
@@ -2,6 +2,22 @@ forcedincludes {
MAME_DIR .. "src/osd/sdl/sdlprefix.h"
}
+if _OPTIONS["NO_OPENGL"]=="1" then
+ defines {
+ "USE_OPENGL=0",
+ }
+else
+ defines {
+ "USE_OPENGL=1",
+ }
+ if _OPTIONS["USE_DISPATCH_GL"]=="1" then
+ defines {
+ "USE_DISPATCH_GL=1",
+ }
+ end
+end
+
+
if _OPTIONS["NO_X11"]=="1" then
defines {
"SDLMAME_NO_X11",
@@ -94,7 +110,6 @@ if _OPTIONS["targetos"]=="windows" then
"SDLMAME_WIN32",
"UNICODE",
"_UNICODE",
- "USE_OPENGL=1",
"USE_QTDEBUG=" .. USE_QT,
"SDLMAME_NET_PCAP",
"main=utf8_main",
@@ -114,7 +129,6 @@ if _OPTIONS["targetos"]=="windows" then
elseif _OPTIONS["targetos"]=="linux" then
defines {
- "USE_OPENGL=1",
"USE_QTDEBUG=" .. USE_QT,
"SDLMAME_NET_TAPTUN",
}
@@ -125,7 +139,6 @@ elseif _OPTIONS["targetos"]=="macosx" then
defines {
"SDLMAME_MACOSX",
"SDLMAME_DARWIN",
- "USE_OPENGL=1",
"USE_QTDEBUG=0",
"SDLMAME_NET_PCAP",
}