placed back OPENGL check since GL is not same as GLES (nw)

This commit is contained in:
Miodrag Milanovic 2016-02-16 18:00:19 +01:00
parent 9eb2734495
commit 38e054c765
15 changed files with 179 additions and 125 deletions

View File

@ -1193,7 +1193,7 @@ endif
ifndef MARVELL_ROOTFS
$(error MARVELL_ROOTFS is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=steamlink --gcc_version=$(GCC_VERSION) --NO_USE_MIDI=1 --NO_X11=1 --NOASM=1 --SDL_INSTALL_ROOT=$(MARVELL_ROOTFS)/usr gmake
$(SILENT) $(GENIE) $(PARAMS) --gcc=steamlink --gcc_version=$(GCC_VERSION) --NO_OPENGL=1 --NO_USE_MIDI=1 --NO_X11=1 --NOASM=1 --SDL_INSTALL_ROOT=$(MARVELL_ROOTFS)/usr gmake
.PHONY: steamlink
ifndef MARVELL_SDK_PATH

View File

@ -38,7 +38,7 @@ if _OPTIONS["with-bundled-lua"] then
}
end
if (_OPTIONS["targetos"] == "windows" and _OPTIONS["osd"] ~= "osdmini" ) then
if (_OPTIONS["targetos"] == "windows") then
defines {
"UI_WINDOWS",
}

View File

@ -77,18 +77,27 @@ function osdmodulesbuild()
}
end
files {
MAME_DIR .. "src/osd/modules/render/drawogl.cpp",
MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.cpp",
MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.cpp",
MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.h",
MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.h",
MAME_DIR .. "src/osd/modules/opengl/osd_opengl.h",
}
if _OPTIONS["USE_DISPATCH_GL"]=="1" then
if _OPTIONS["NO_OPENGL"]=="1" then
defines {
"USE_DISPATCH_GL=1",
"USE_OPENGL=0",
}
else
files {
MAME_DIR .. "src/osd/modules/render/drawogl.cpp",
MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.cpp",
MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.cpp",
MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.h",
MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.h",
MAME_DIR .. "src/osd/modules/opengl/osd_opengl.h",
}
defines {
"USE_OPENGL=1",
}
if _OPTIONS["USE_DISPATCH_GL"]=="1" then
defines {
"USE_DISPATCH_GL=1",
}
end
end
files {
@ -242,19 +251,21 @@ end
function osdmodulestargetconf()
if _OPTIONS["targetos"]=="macosx" then
links {
"OpenGL.framework",
}
elseif _OPTIONS["USE_DISPATCH_GL"]~="1" then
if _OPTIONS["targetos"]=="windows" then
if _OPTIONS["NO_OPENGL"]~="1" then
if _OPTIONS["targetos"]=="macosx" then
links {
"opengl32",
}
else
links {
"GL",
"OpenGL.framework",
}
elseif _OPTIONS["USE_DISPATCH_GL"]~="1" then
if _OPTIONS["targetos"]=="windows" then
links {
"opengl32",
}
else
links {
"GL",
}
end
end
end
@ -331,6 +342,15 @@ newoption {
description = "Disable network access",
}
newoption {
trigger = "NO_OPENGL",
description = "Disable use of OpenGL",
allowed = {
{ "0", "Enable OpenGL" },
{ "1", "Disable OpenGL" },
},
}
newoption {
trigger = "USE_DISPATCH_GL",
description = "Use GL-dispatching",

View File

@ -6,6 +6,7 @@ defines {
"USE_QTDEBUG=0",
"USE_SDL",
"SDLMAME_NOASM=1",
"USE_OPENGL=0",
"NO_USE_MIDI=1",
"USE_XAUDIO2=0",
}

View File

@ -12,7 +12,7 @@ if SDL_NETWORK~="" and not _OPTIONS["DONT_USE_NETWORK"] then
}
end
if _OPTIONS["USE_DISPATCH_GL"]~="1" and _OPTIONS["MESA_INSTALL_ROOT"] then
if _OPTIONS["NO_OPENGL"]~="1" and _OPTIONS["USE_DISPATCH_GL"]~="1" and _OPTIONS["MESA_INSTALL_ROOT"] then
includedirs {
path.join(_OPTIONS["MESA_INSTALL_ROOT"],"include"),
}

View File

@ -86,6 +86,7 @@ const options_entry osd_options::s_option_entries[] =
{ OSDOPTION_FILTER ";glfilter;flt", "1", OPTION_BOOLEAN, "enable bilinear filtering on screen output" },
{ OSDOPTION_PRESCALE, "1", OPTION_INTEGER, "scale screen rendering by this amount in software" },
#if USE_OPENGL
{ NULL, NULL, OPTION_HEADER, "OpenGL-SPECIFIC OPTIONS" },
{ OSDOPTION_GL_FORCEPOW2TEXTURE, "0", OPTION_BOOLEAN, "force power of two textures (default no)" },
{ OSDOPTION_GL_NOTEXTURERECT, "0", OPTION_BOOLEAN, "don't use OpenGL GL_ARB_texture_rectangle (default on)" },
@ -113,6 +114,7 @@ const options_entry osd_options::s_option_entries[] =
{ OSDOPTION_SHADER_SCREEN "7", OSDOPTVAL_NONE, OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 7" },
{ OSDOPTION_SHADER_SCREEN "8", OSDOPTVAL_NONE, OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 8" },
{ OSDOPTION_SHADER_SCREEN "9", OSDOPTVAL_NONE, OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 9" },
#endif
{ NULL, NULL, OPTION_HEADER, "OSD SOUND OPTIONS" },
{ OSDOPTION_SOUND, OSDOPTVAL_AUTO, OPTION_STRING, "sound output method: " },

View File

@ -12,6 +12,8 @@
#ifndef _OSD_OPENGL_H
#define _OSD_OPENGL_H
#if USE_OPENGL
/* equivalent to #include <GL/gl.h>
* #include <GL/glext.h>
*/
@ -109,6 +111,8 @@
#endif /* USE_DISPATCH_GL */
#endif /* USE_OPENGL */
#endif /* _OSD_OPENGL_H */
#else /* MANGLE */

View File

@ -546,8 +546,12 @@ int drawsdl2_init(running_machine &machine, osd_draw_callbacks *callbacks)
osd_printf_verbose("Using SDL native texturing driver (SDL 2.0+)\n");
#if USE_OPENGL
// Load the GL library now - else MT will fail
const char *stemp = downcast<sdl_options &>(machine.options()).gl_lib();
#else
const char *stemp = NULL;
#endif
if (stemp != NULL && strcmp(stemp, OSDOPTVAL_AUTO) == 0)
stemp = NULL;

View File

@ -122,7 +122,9 @@ public:
const char *video_driver() const { return value(SDLOPTION_VIDEODRIVER); }
const char *render_driver() const { return value(SDLOPTION_RENDERDRIVER); }
const char *audio_driver() const { return value(SDLOPTION_AUDIODRIVER); }
#if USE_OPENGL
const char *gl_lib() const { return value(SDLOPTION_GL_LIB); }
#endif
private:
static const options_entry s_option_entries[];

View File

@ -164,7 +164,9 @@ const options_entry sdl_options::s_option_entries[] =
{ SDLOPTION_VIDEODRIVER ";vd", OSDOPTVAL_AUTO, OPTION_STRING, "sdl video driver to use ('x11', 'directfb', ... or 'auto' for SDL default" },
{ SDLOPTION_RENDERDRIVER ";rd", OSDOPTVAL_AUTO, OPTION_STRING, "sdl render driver to use ('software', 'opengl', 'directfb' ... or 'auto' for SDL default" },
{ SDLOPTION_AUDIODRIVER ";ad", OSDOPTVAL_AUTO, OPTION_STRING, "sdl audio driver to use ('alsa', 'arts', ... or 'auto' for SDL default" },
#if USE_OPENGL
{ SDLOPTION_GL_LIB, SDLOPTVAL_GLLIB, OPTION_STRING, "alternative libGL.so to use; 'auto' for system default" },
#endif
// End of list
{ NULL }
@ -343,6 +345,7 @@ static void defines_verbose(void)
osd_printf_verbose("\n");
osd_printf_verbose("SDL/OpenGL defines: ");
osd_printf_verbose("SDL_COMPILEDVERSION=%d ", SDL_COMPILEDVERSION);
MACRO_VERBOSE(USE_OPENGL);
MACRO_VERBOSE(USE_DISPATCH_GL);
osd_printf_verbose("\n");
osd_printf_verbose("Compiler defines A: ");
@ -484,6 +487,7 @@ void sdl_osd_interface::init(running_machine &machine)
/* Set the SDL environment variable for drivers wanting to load the
* lib at startup.
*/
#if USE_OPENGL
/* FIXME: move lib loading code from drawogl.c here */
stemp = options().gl_lib();
@ -492,6 +496,7 @@ void sdl_osd_interface::init(running_machine &machine)
osd_setenv("SDL_VIDEO_GL_DRIVER", stemp, 1);
osd_printf_verbose("Setting SDL_VIDEO_GL_DRIVER = '%s' ...\n", stemp);
}
#endif
/* get number of processors */
stemp = options().numprocessors();

View File

@ -313,12 +313,14 @@ static void check_osd_inputs(running_machine &machine)
machine.ui().popup_time(1, "Keepaspect %s", video_config.keepaspect? "enabled":"disabled");
}
//FIXME: on a per window basis
if (machine.ui_input().pressed(IPT_OSD_5))
{
video_config.filter = !video_config.filter;
machine.ui().popup_time(1, "Filter %s", video_config.filter? "enabled":"disabled");
}
#if (USE_OPENGL)
//FIXME: on a per window basis
if (machine.ui_input().pressed(IPT_OSD_5))
{
video_config.filter = !video_config.filter;
machine.ui().popup_time(1, "Filter %s", video_config.filter? "enabled":"disabled");
}
#endif
if (machine.ui_input().pressed(IPT_OSD_6))
window->modify_prescale(-1);
@ -375,7 +377,7 @@ void sdl_osd_interface::extract_video_config()
if (options().seconds_to_run() == 0)
osd_printf_warning("Warning: -video none doesn't make much sense without -seconds_to_run\n");
}
else if (strcmp(stemp, SDLOPTVAL_OPENGL) == 0)
else if (USE_OPENGL && (strcmp(stemp, SDLOPTVAL_OPENGL) == 0))
video_config.mode = VIDEO_MODE_OPENGL;
else if ((strcmp(stemp, SDLOPTVAL_SDL2ACCEL) == 0))
{
@ -407,62 +409,64 @@ void sdl_osd_interface::extract_video_config()
osd_printf_warning("Invalid prescale option, reverting to '1'\n");
video_config.prescale = 1;
}
// default to working video please
video_config.forcepow2texture = options().gl_force_pow2_texture();
video_config.allowtexturerect = !(options().gl_no_texture_rect());
video_config.vbo = options().gl_vbo();
video_config.pbo = options().gl_pbo();
video_config.glsl = options().gl_glsl();
if ( video_config.glsl )
{
int i;
video_config.glsl_filter = options().glsl_filter();
video_config.glsl_shader_mamebm_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
#if (USE_OPENGL)
// default to working video please
video_config.forcepow2texture = options().gl_force_pow2_texture();
video_config.allowtexturerect = !(options().gl_no_texture_rect());
video_config.vbo = options().gl_vbo();
video_config.pbo = options().gl_pbo();
video_config.glsl = options().gl_glsl();
if ( video_config.glsl )
{
stemp = options().shader_mame(i);
if (stemp && strcmp(stemp, OSDOPTVAL_NONE) != 0 && strlen(stemp)>0)
int i;
video_config.glsl_filter = options().glsl_filter();
video_config.glsl_shader_mamebm_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
stemp = options().shader_mame(i);
if (stemp && strcmp(stemp, OSDOPTVAL_NONE) != 0 && strlen(stemp)>0)
{
video_config.glsl_shader_mamebm[i] = (char *) malloc(strlen(stemp)+1);
strcpy(video_config.glsl_shader_mamebm[i], stemp);
video_config.glsl_shader_mamebm_num++;
} else {
video_config.glsl_shader_mamebm[i] = NULL;
}
}
video_config.glsl_shader_scrn_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
stemp = options().shader_screen(i);
if (stemp && strcmp(stemp, OSDOPTVAL_NONE) != 0 && strlen(stemp)>0)
{
video_config.glsl_shader_scrn[i] = (char *) malloc(strlen(stemp)+1);
strcpy(video_config.glsl_shader_scrn[i], stemp);
video_config.glsl_shader_scrn_num++;
} else {
video_config.glsl_shader_scrn[i] = NULL;
}
}
} else {
int i;
video_config.glsl_filter = 0;
video_config.glsl_shader_mamebm_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
video_config.glsl_shader_mamebm[i] = (char *) malloc(strlen(stemp)+1);
strcpy(video_config.glsl_shader_mamebm[i], stemp);
video_config.glsl_shader_mamebm_num++;
} else {
video_config.glsl_shader_mamebm[i] = NULL;
}
}
video_config.glsl_shader_scrn_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
stemp = options().shader_screen(i);
if (stemp && strcmp(stemp, OSDOPTVAL_NONE) != 0 && strlen(stemp)>0)
video_config.glsl_shader_scrn_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
video_config.glsl_shader_scrn[i] = (char *) malloc(strlen(stemp)+1);
strcpy(video_config.glsl_shader_scrn[i], stemp);
video_config.glsl_shader_scrn_num++;
} else {
video_config.glsl_shader_scrn[i] = NULL;
}
}
} else {
int i;
video_config.glsl_filter = 0;
video_config.glsl_shader_mamebm_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
video_config.glsl_shader_mamebm[i] = NULL;
}
video_config.glsl_shader_scrn_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
video_config.glsl_shader_scrn[i] = NULL;
}
}
#endif /* USE_OPENGL */
// misc options: sanity check values
// global options: sanity check values

View File

@ -223,11 +223,13 @@ bool sdl_osd_interface::window_init()
}
// initialize the drawers
#if USE_OPENGL
if (video_config.mode == VIDEO_MODE_OPENGL)
{
if (drawogl_init(machine(), &draw))
video_config.mode = VIDEO_MODE_SOFT;
}
#endif
if (video_config.mode == VIDEO_MODE_SDL2ACCEL)
{
if (drawsdl2_init(machine(), &draw))

View File

@ -385,8 +385,10 @@ void windows_osd_interface::extract_video_config()
if (options().seconds_to_run() == 0)
osd_printf_warning("Warning: -video none doesn't make much sense without -seconds_to_run\n");
}
#if (USE_OPENGL)
else if (strcmp(stemp, "opengl") == 0)
video_config.mode = VIDEO_MODE_OPENGL;
#endif
else
{
osd_printf_warning("Invalid video value %s; reverting to gdi\n", stemp);
@ -405,62 +407,64 @@ void windows_osd_interface::extract_video_config()
osd_printf_warning("Invalid prescale option, reverting to '1'\n");
video_config.prescale = 1;
}
// default to working video please
video_config.forcepow2texture = options().gl_force_pow2_texture();
video_config.allowtexturerect = !(options().gl_no_texture_rect());
video_config.vbo = options().gl_vbo();
video_config.pbo = options().gl_pbo();
video_config.glsl = options().gl_glsl();
if ( video_config.glsl )
{
int i;
video_config.glsl_filter = options().glsl_filter();
video_config.glsl_shader_mamebm_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
#if (USE_OPENGL)
// default to working video please
video_config.forcepow2texture = options().gl_force_pow2_texture();
video_config.allowtexturerect = !(options().gl_no_texture_rect());
video_config.vbo = options().gl_vbo();
video_config.pbo = options().gl_pbo();
video_config.glsl = options().gl_glsl();
if ( video_config.glsl )
{
stemp = options().shader_mame(i);
if (stemp && strcmp(stemp, OSDOPTVAL_NONE) != 0 && strlen(stemp)>0)
int i;
video_config.glsl_filter = options().glsl_filter();
video_config.glsl_shader_mamebm_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
stemp = options().shader_mame(i);
if (stemp && strcmp(stemp, OSDOPTVAL_NONE) != 0 && strlen(stemp)>0)
{
video_config.glsl_shader_mamebm[i] = (char *) malloc(strlen(stemp)+1);
strcpy(video_config.glsl_shader_mamebm[i], stemp);
video_config.glsl_shader_mamebm_num++;
} else {
video_config.glsl_shader_mamebm[i] = NULL;
}
}
video_config.glsl_shader_scrn_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
stemp = options().shader_screen(i);
if (stemp && strcmp(stemp, OSDOPTVAL_NONE) != 0 && strlen(stemp)>0)
{
video_config.glsl_shader_scrn[i] = (char *) malloc(strlen(stemp)+1);
strcpy(video_config.glsl_shader_scrn[i], stemp);
video_config.glsl_shader_scrn_num++;
} else {
video_config.glsl_shader_scrn[i] = NULL;
}
}
} else {
int i;
video_config.glsl_filter = 0;
video_config.glsl_shader_mamebm_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
video_config.glsl_shader_mamebm[i] = (char *) malloc(strlen(stemp)+1);
strcpy(video_config.glsl_shader_mamebm[i], stemp);
video_config.glsl_shader_mamebm_num++;
} else {
video_config.glsl_shader_mamebm[i] = NULL;
}
}
video_config.glsl_shader_scrn_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
stemp = options().shader_screen(i);
if (stemp && strcmp(stemp, OSDOPTVAL_NONE) != 0 && strlen(stemp)>0)
video_config.glsl_shader_scrn_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
video_config.glsl_shader_scrn[i] = (char *) malloc(strlen(stemp)+1);
strcpy(video_config.glsl_shader_scrn[i], stemp);
video_config.glsl_shader_scrn_num++;
} else {
video_config.glsl_shader_scrn[i] = NULL;
}
}
} else {
int i;
video_config.glsl_filter = 0;
video_config.glsl_shader_mamebm_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
video_config.glsl_shader_mamebm[i] = NULL;
}
video_config.glsl_shader_scrn_num=0;
for(i=0; i<GLSL_SHADER_MAX; i++)
{
video_config.glsl_shader_scrn[i] = NULL;
}
}
#endif /* USE_OPENGL */
}

View File

@ -23,7 +23,9 @@ enum {
VIDEO_MODE_GDI,
VIDEO_MODE_DDRAW,
VIDEO_MODE_BGFX,
#if (USE_OPENGL)
VIDEO_MODE_OPENGL,
#endif
VIDEO_MODE_D3D
};

View File

@ -39,7 +39,9 @@ extern int drawgdi_init(running_machine &machine, osd_draw_callbacks *callbacks)
extern int drawdd_init(running_machine &machine, osd_draw_callbacks *callbacks);
extern int drawd3d_init(running_machine &machine, osd_draw_callbacks *callbacks);
extern int drawbgfx_init(running_machine &machine, osd_draw_callbacks *callbacks);
#if (USE_OPENGL)
extern int drawogl_init(running_machine &machine, osd_draw_callbacks *callbacks);
#endif
//============================================================
// PARAMETERS
@ -228,8 +230,10 @@ bool windows_osd_interface::window_init()
drawbgfx_init(machine(), &draw);
if (video_config.mode == VIDEO_MODE_NONE)
drawnone_init(machine(), &draw);
#if (USE_OPENGL)
if (video_config.mode == VIDEO_MODE_OPENGL)
drawogl_init(machine(), &draw);
#endif
// set up the window list
last_window_ptr = &win_window_list;