diff options
Diffstat (limited to 'src/osd/modules/opengl/gl_shader_mgr.h')
-rw-r--r-- | src/osd/modules/opengl/gl_shader_mgr.h | 84 |
1 files changed, 45 insertions, 39 deletions
diff --git a/src/osd/modules/opengl/gl_shader_mgr.h b/src/osd/modules/opengl/gl_shader_mgr.h index f95ec8c2244..ad9e248ac5f 100644 --- a/src/osd/modules/opengl/gl_shader_mgr.h +++ b/src/osd/modules/opengl/gl_shader_mgr.h @@ -1,51 +1,57 @@ // license:BSD-3-Clause // copyright-holders:Sven Gothel +#ifndef MAME_OSD_OPENGL_GL_SHADER_MGR_H +#define MAME_OSD_OPENGL_GL_SHADER_MGR_H -#ifndef GL_SHADER_MGR_H -#define GL_SHADER_MGR_H +#pragma once +#include "gl_shader_tool.h" #include "osd_opengl.h" +#include <memory> + + // #define GLSL_SOURCE_ON_DISK 1 -enum GLSL_SHADER_FEATURE { - GLSL_SHADER_FEAT_PLAIN, - GLSL_SHADER_FEAT_BILINEAR, - GLSL_SHADER_FEAT_BICUBIC, - GLSL_SHADER_FEAT_INT_NUMBER, - GLSL_SHADER_FEAT_CUSTOM = GLSL_SHADER_FEAT_INT_NUMBER, - GLSL_SHADER_FEAT_MAX_NUMBER -}; -// old code passed sdl_info * to functions here -// however the parameter was not used -// changed interface to more generic one. -struct glsl_shader_info +class glsl_shader_info : public gl_shader_tool { - int dummy; // avoid compiler breakage +public: + enum FEATURE + { + FEAT_PLAIN, + FEAT_BILINEAR, + FEAT_BICUBIC, + FEAT_INT_NUMBER, + FEAT_CUSTOM = FEAT_INT_NUMBER, + FEAT_MAX_NUMBER + }; + + using gl_shader_tool::gl_shader_tool; + + virtual ~glsl_shader_info() = default; + + /** + * returns the GLSL program if ok/available, otherwise 0 + */ + virtual GLhandleARB get_program_mamebm(int glslShaderFeature, int idx) = 0; + + virtual const char *get_filter_name_mamebm(int glslShaderFeature) = 0; + + virtual int add_mamebm(const char *custShaderPrefix, int idx) = 0; + + virtual GLhandleARB get_program_scrn(int idx) = 0; + virtual int add_scrn(const char *custShaderPrefix, int idx) = 0; + + /** + * returns pointer if OK, otherwise nullptr + */ + static std::unique_ptr<glsl_shader_info> init( + osd_gl_context &gl_ctx +#if defined(USE_DISPATCH_GL) + , osd_gl_dispatch *gld +#endif + ); }; - -/** - * returns pointer if ok, otherwise nullptr - */ -glsl_shader_info *glsl_shader_init(osd_gl_context *gl_ctx); - -/** - * returns 0 if ok, otherwise an error value - */ -int glsl_shader_free(glsl_shader_info *shinfo); - -/** - * returns the GLSL program if ok/available, otherwise 0 - */ -GLhandleARB glsl_shader_get_program_mamebm(int glslShaderFeature, int idx); - -const char * glsl_shader_get_filter_name_mamebm(int glslShaderFeature); - -int glsl_shader_add_mamebm(glsl_shader_info *shinfo, const char * custShaderPrefix, int idx); - -GLhandleARB glsl_shader_get_program_scrn(int idx); -int glsl_shader_add_scrn(glsl_shader_info *shinfo, const char * custShaderPrefix, int idx); - -#endif // GL_SHADER_MGR_H +#endif // MAME_OSD_OPENGL_GL_SHADER_MGR_H |