diff options
author | 2015-02-26 01:40:18 +0100 | |
---|---|---|
committer | 2015-02-26 01:40:18 +0100 | |
commit | eb8144a3bb8f5d443b5062b13e3e18b6b8e8c43c (patch) | |
tree | 0dbb6487e5cc7db623f2d9acd9d2db3efa792aca /src | |
parent | 2c2994aeb52b700c206ca6c94513a92601097bdb (diff) |
Moved opengl related stuff to modules/opengl
Diffstat (limited to 'src')
-rw-r--r-- | src/osd/modules/opengl/SDL1211_opengl.h (renamed from src/osd/sdl/SDL1211_opengl.h) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/gl_shader_mgr.c (renamed from src/osd/sdl/gl_shader_mgr.c) | 4 | ||||
-rw-r--r-- | src/osd/modules/opengl/gl_shader_mgr.h (renamed from src/osd/sdl/gl_shader_mgr.h) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/gl_shader_tool.c (renamed from src/osd/sdl/gl_shader_tool.c) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/gl_shader_tool.h (renamed from src/osd/sdl/gl_shader_tool.h) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/osd_opengl.h (renamed from src/osd/sdl/osd_opengl.h) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/genc.sh (renamed from src/osd/sdl/shader/genc.sh) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_bilinear.vsh (renamed from src/osd/sdl/shader/glsl_bilinear.vsh) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_bilinear_idx16_lut.fsh (renamed from src/osd/sdl/shader/glsl_bilinear_idx16_lut.fsh) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_bilinear_idx16_lut.fsh.c (renamed from src/osd/sdl/shader/glsl_bilinear_idx16_lut.fsh.c) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_bilinear_rgb32_dir.fsh (renamed from src/osd/sdl/shader/glsl_bilinear_rgb32_dir.fsh) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_bilinear_rgb32_dir.fsh.c (renamed from src/osd/sdl/shader/glsl_bilinear_rgb32_dir.fsh.c) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_bilinear_rgb32_lut.fsh (renamed from src/osd/sdl/shader/glsl_bilinear_rgb32_lut.fsh) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_bilinear_rgb32_lut.fsh.c (renamed from src/osd/sdl/shader/glsl_bilinear_rgb32_lut.fsh.c) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_general.vsh (renamed from src/osd/sdl/shader/glsl_general.vsh) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_general.vsh.c (renamed from src/osd/sdl/shader/glsl_general.vsh.c) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_plain.vsh (renamed from src/osd/sdl/shader/glsl_plain.vsh) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_plain_idx16_lut.fsh (renamed from src/osd/sdl/shader/glsl_plain_idx16_lut.fsh) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_plain_idx16_lut.fsh.c (renamed from src/osd/sdl/shader/glsl_plain_idx16_lut.fsh.c) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_plain_rgb32_dir.fsh (renamed from src/osd/sdl/shader/glsl_plain_rgb32_dir.fsh) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_plain_rgb32_dir.fsh.c (renamed from src/osd/sdl/shader/glsl_plain_rgb32_dir.fsh.c) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh (renamed from src/osd/sdl/shader/glsl_plain_rgb32_lut.fsh) | 0 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh.c (renamed from src/osd/sdl/shader/glsl_plain_rgb32_lut.fsh.c) | 0 | ||||
-rw-r--r-- | src/osd/sdl/drawogl.c | 8 | ||||
-rw-r--r-- | src/osd/sdl/sdl.mak | 7 | ||||
-rw-r--r-- | src/osd/sdl/video.h | 13 | ||||
-rw-r--r-- | src/osd/sdl/window.h | 121 | ||||
-rw-r--r-- | src/osd/windows/video.c | 13 | ||||
-rw-r--r-- | src/osd/windows/video.h | 17 | ||||
-rw-r--r-- | src/osd/windows/window.h | 118 | ||||
-rw-r--r-- | src/osd/windows/windows.mak | 10 |
31 files changed, 31 insertions, 280 deletions
diff --git a/src/osd/sdl/SDL1211_opengl.h b/src/osd/modules/opengl/SDL1211_opengl.h index d4706f2d518..d4706f2d518 100644 --- a/src/osd/sdl/SDL1211_opengl.h +++ b/src/osd/modules/opengl/SDL1211_opengl.h diff --git a/src/osd/sdl/gl_shader_mgr.c b/src/osd/modules/opengl/gl_shader_mgr.c index 7b52f70fab7..75d4b777cca 100644 --- a/src/osd/sdl/gl_shader_mgr.c +++ b/src/osd/modules/opengl/gl_shader_mgr.c @@ -1,10 +1,6 @@ #include <stdio.h> /* snprintf */ #include <stdlib.h> /* malloc */ -#ifndef OSD_WINDOWS -#include "sdlinc.h" -#endif - #include "osd_opengl.h" #include "gl_shader_mgr.h" diff --git a/src/osd/sdl/gl_shader_mgr.h b/src/osd/modules/opengl/gl_shader_mgr.h index 9c3aef19815..9c3aef19815 100644 --- a/src/osd/sdl/gl_shader_mgr.h +++ b/src/osd/modules/opengl/gl_shader_mgr.h diff --git a/src/osd/sdl/gl_shader_tool.c b/src/osd/modules/opengl/gl_shader_tool.c index a6929a6fe2d..a6929a6fe2d 100644 --- a/src/osd/sdl/gl_shader_tool.c +++ b/src/osd/modules/opengl/gl_shader_tool.c diff --git a/src/osd/sdl/gl_shader_tool.h b/src/osd/modules/opengl/gl_shader_tool.h index 9e53148d7ae..9e53148d7ae 100644 --- a/src/osd/sdl/gl_shader_tool.h +++ b/src/osd/modules/opengl/gl_shader_tool.h diff --git a/src/osd/sdl/osd_opengl.h b/src/osd/modules/opengl/osd_opengl.h index e41911a4b3e..e41911a4b3e 100644 --- a/src/osd/sdl/osd_opengl.h +++ b/src/osd/modules/opengl/osd_opengl.h diff --git a/src/osd/sdl/shader/genc.sh b/src/osd/modules/opengl/shader/genc.sh index 2c676e62f9b..2c676e62f9b 100644 --- a/src/osd/sdl/shader/genc.sh +++ b/src/osd/modules/opengl/shader/genc.sh diff --git a/src/osd/sdl/shader/glsl_bilinear.vsh b/src/osd/modules/opengl/shader/glsl_bilinear.vsh index 22df6221997..22df6221997 100644 --- a/src/osd/sdl/shader/glsl_bilinear.vsh +++ b/src/osd/modules/opengl/shader/glsl_bilinear.vsh diff --git a/src/osd/sdl/shader/glsl_bilinear_idx16_lut.fsh b/src/osd/modules/opengl/shader/glsl_bilinear_idx16_lut.fsh index ef0030b7519..ef0030b7519 100644 --- a/src/osd/sdl/shader/glsl_bilinear_idx16_lut.fsh +++ b/src/osd/modules/opengl/shader/glsl_bilinear_idx16_lut.fsh diff --git a/src/osd/sdl/shader/glsl_bilinear_idx16_lut.fsh.c b/src/osd/modules/opengl/shader/glsl_bilinear_idx16_lut.fsh.c index 62844692cbe..62844692cbe 100644 --- a/src/osd/sdl/shader/glsl_bilinear_idx16_lut.fsh.c +++ b/src/osd/modules/opengl/shader/glsl_bilinear_idx16_lut.fsh.c diff --git a/src/osd/sdl/shader/glsl_bilinear_rgb32_dir.fsh b/src/osd/modules/opengl/shader/glsl_bilinear_rgb32_dir.fsh index c739c16934e..c739c16934e 100644 --- a/src/osd/sdl/shader/glsl_bilinear_rgb32_dir.fsh +++ b/src/osd/modules/opengl/shader/glsl_bilinear_rgb32_dir.fsh diff --git a/src/osd/sdl/shader/glsl_bilinear_rgb32_dir.fsh.c b/src/osd/modules/opengl/shader/glsl_bilinear_rgb32_dir.fsh.c index d6265b8905b..d6265b8905b 100644 --- a/src/osd/sdl/shader/glsl_bilinear_rgb32_dir.fsh.c +++ b/src/osd/modules/opengl/shader/glsl_bilinear_rgb32_dir.fsh.c diff --git a/src/osd/sdl/shader/glsl_bilinear_rgb32_lut.fsh b/src/osd/modules/opengl/shader/glsl_bilinear_rgb32_lut.fsh index d6c9f5e7f59..d6c9f5e7f59 100644 --- a/src/osd/sdl/shader/glsl_bilinear_rgb32_lut.fsh +++ b/src/osd/modules/opengl/shader/glsl_bilinear_rgb32_lut.fsh diff --git a/src/osd/sdl/shader/glsl_bilinear_rgb32_lut.fsh.c b/src/osd/modules/opengl/shader/glsl_bilinear_rgb32_lut.fsh.c index a5a67bdbf94..a5a67bdbf94 100644 --- a/src/osd/sdl/shader/glsl_bilinear_rgb32_lut.fsh.c +++ b/src/osd/modules/opengl/shader/glsl_bilinear_rgb32_lut.fsh.c diff --git a/src/osd/sdl/shader/glsl_general.vsh b/src/osd/modules/opengl/shader/glsl_general.vsh index 22df6221997..22df6221997 100644 --- a/src/osd/sdl/shader/glsl_general.vsh +++ b/src/osd/modules/opengl/shader/glsl_general.vsh diff --git a/src/osd/sdl/shader/glsl_general.vsh.c b/src/osd/modules/opengl/shader/glsl_general.vsh.c index d0bf6eb8a68..d0bf6eb8a68 100644 --- a/src/osd/sdl/shader/glsl_general.vsh.c +++ b/src/osd/modules/opengl/shader/glsl_general.vsh.c diff --git a/src/osd/sdl/shader/glsl_plain.vsh b/src/osd/modules/opengl/shader/glsl_plain.vsh index 22df6221997..22df6221997 100644 --- a/src/osd/sdl/shader/glsl_plain.vsh +++ b/src/osd/modules/opengl/shader/glsl_plain.vsh diff --git a/src/osd/sdl/shader/glsl_plain_idx16_lut.fsh b/src/osd/modules/opengl/shader/glsl_plain_idx16_lut.fsh index 465aa610d59..465aa610d59 100644 --- a/src/osd/sdl/shader/glsl_plain_idx16_lut.fsh +++ b/src/osd/modules/opengl/shader/glsl_plain_idx16_lut.fsh diff --git a/src/osd/sdl/shader/glsl_plain_idx16_lut.fsh.c b/src/osd/modules/opengl/shader/glsl_plain_idx16_lut.fsh.c index f9f18b615e6..f9f18b615e6 100644 --- a/src/osd/sdl/shader/glsl_plain_idx16_lut.fsh.c +++ b/src/osd/modules/opengl/shader/glsl_plain_idx16_lut.fsh.c diff --git a/src/osd/sdl/shader/glsl_plain_rgb32_dir.fsh b/src/osd/modules/opengl/shader/glsl_plain_rgb32_dir.fsh index 0e5a4605ac8..0e5a4605ac8 100644 --- a/src/osd/sdl/shader/glsl_plain_rgb32_dir.fsh +++ b/src/osd/modules/opengl/shader/glsl_plain_rgb32_dir.fsh diff --git a/src/osd/sdl/shader/glsl_plain_rgb32_dir.fsh.c b/src/osd/modules/opengl/shader/glsl_plain_rgb32_dir.fsh.c index 1e206d671cd..1e206d671cd 100644 --- a/src/osd/sdl/shader/glsl_plain_rgb32_dir.fsh.c +++ b/src/osd/modules/opengl/shader/glsl_plain_rgb32_dir.fsh.c diff --git a/src/osd/sdl/shader/glsl_plain_rgb32_lut.fsh b/src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh index 14c05aaa844..14c05aaa844 100644 --- a/src/osd/sdl/shader/glsl_plain_rgb32_lut.fsh +++ b/src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh diff --git a/src/osd/sdl/shader/glsl_plain_rgb32_lut.fsh.c b/src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh.c index d1263ea6864..d1263ea6864 100644 --- a/src/osd/sdl/shader/glsl_plain_rgb32_lut.fsh.c +++ b/src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh.c diff --git a/src/osd/sdl/drawogl.c b/src/osd/sdl/drawogl.c index 2af9f5df7cf..12fbe9891df 100644 --- a/src/osd/sdl/drawogl.c +++ b/src/osd/sdl/drawogl.c @@ -30,7 +30,7 @@ #endif // OpenGL headers -#include "osd_opengl.h" +#include "modules/opengl/osd_opengl.h" #ifdef OSD_WINDOWS #define SDLMAME_SDL2 1 @@ -43,8 +43,8 @@ #include "modules/lib/osdobj_common.h" -#include "gl_shader_tool.h" -#include "gl_shader_mgr.h" +#include "modules/opengl/gl_shader_tool.h" +#include "modules/opengl/gl_shader_mgr.h" #if defined(SDLMAME_MACOSX) #ifndef APIENTRY @@ -770,7 +770,7 @@ static void loadgl_functions(osd_gl_context *context) #define OSD_GL_UNUSED(ret,func,params) #define GET_GLFUNC 1 - #include "osd_opengl.h" + #include "modules/opengl/osd_opengl.h" #undef GET_GLFUNC if (err_count) diff --git a/src/osd/sdl/sdl.mak b/src/osd/sdl/sdl.mak index f3f6ca3d588..6bd41757065 100644 --- a/src/osd/sdl/sdl.mak +++ b/src/osd/sdl/sdl.mak @@ -427,6 +427,7 @@ OBJDIRS += $(SDLOBJ) \ $(OSDOBJ)/modules/midi \ $(OSDOBJ)/modules/font \ $(OSDOBJ)/modules/netdev \ + $(OSDOBJ)/modules/opengl \ #------------------------------------------------- # OSD core library @@ -821,7 +822,11 @@ endif ifeq ($(NO_OPENGL),1) DEFS += -DUSE_OPENGL=0 else -OSDOBJS += $(SDLOBJ)/drawogl.o $(SDLOBJ)/gl_shader_tool.o $(SDLOBJ)/gl_shader_mgr.o +OSDOBJS += \ + $(SDLOBJ)/drawogl.o \ + $(OSDOBJ)/modules/opengl/gl_shader_tool.o \ + $(OSDOBJ)/modules/opengl/gl_shader_mgr.o + DEFS += -DUSE_OPENGL=1 ifeq ($(USE_DISPATCH_GL),1) DEFS += -DUSE_DISPATCH_GL=1 diff --git a/src/osd/sdl/video.h b/src/osd/sdl/video.h index 8f3acb8460d..01a6caa9ee6 100644 --- a/src/osd/sdl/video.h +++ b/src/osd/sdl/video.h @@ -107,19 +107,6 @@ private: float m_aspect; // computed/configured aspect ratio of the physical device }; - -struct osd_window_config -{ - osd_window_config() : aspect(0.0f), width(0), height(0), depth(0), refresh(0) {} - - float aspect; // decoded aspect ratio FIXME: not used on windows - int width; // decoded width - int height; // decoded height - int depth; // decoded depth - only SDL - int refresh; // decoded refresh -}; - - struct sdl_video_config { // performance options diff --git a/src/osd/sdl/window.h b/src/osd/sdl/window.h index 3c0c7278210..33c06891d49 100644 --- a/src/osd/sdl/window.h +++ b/src/osd/sdl/window.h @@ -13,12 +13,10 @@ #define __SDLWINDOW__ #include "sdlinc.h" +#include "osdsdl.h" #include "video.h" -#include "render.h" -#include "modules/sync/osdsync.h" -#include "osd_opengl.h" -#include "osdsdl.h" +#include "modules/osdwindow.h" // I don't like this, but we're going to get spurious "cast to integer of different size" warnings on // at least one architecture without doing it this way. @@ -32,121 +30,6 @@ typedef UINT32 HashT; // TYPE DEFINITIONS //============================================================ -/* ------------------------------------------------------ - * - * All types named osd_* will ultimately be located in - * the modules tree. They are temporarily maintained in - * window.h until basic code simplification is finished. - * - */ - -class win_window_info; - -class osd_window -{ -public: - osd_window() - : -#ifdef OSD_SDL -#else - m_hwnd(0), m_dc(0), m_focus_hwnd(0), m_resize_state(0), -#endif - m_prescale(1), - m_primlist(NULL) - {} - virtual ~osd_window() { } - - virtual render_target *target() = 0; - virtual int fullscreen() const = 0; - virtual running_machine &machine() const = 0; - - int prescale() const { return m_prescale; }; - - float aspect() const { return monitor()->aspect(); } - - virtual void get_size(int &w, int &h) = 0; - -#ifdef OSD_SDL - virtual void blit_surface_size(int &blitwidth, int &blitheight) = 0; - virtual sdl_monitor_info *monitor() const = 0; -#if (SDLMAME_SDL2) - virtual SDL_Window *sdl_window() = 0; -#else - virtual SDL_Surface *sdl_surface() = 0; -#endif -#else - virtual win_monitor_info *monitor() const = 0; - virtual bool win_has_menu() = 0; - // FIXME: cann we replace winwindow_video_window_monitor(NULL) with monitor() ? - virtual win_monitor_info *winwindow_video_window_monitor(const RECT *proposed) = 0; - - // window handle and info - HWND m_hwnd; - HDC m_dc; // only used by GDI renderer! - // FIXME: this is the same as win_window_list->m_hwnd, i.e. first window. - // During modularization, this should be passed in differently - HWND m_focus_hwnd; - - int m_resize_state; -#endif - - osd_window_config m_win_config; - int m_prescale; - render_primitive_list *m_primlist; -}; - -class osd_renderer -{ -public: - - /* Generic flags */ - static const int FLAG_NONE = 0x0000; - static const int FLAG_NEEDS_OPENGL = 0x0001; - static const int FLAG_HAS_VECTOR_SCREEN = 0x0002; - - /* SDL 1.2 flags */ - static const int FLAG_NEEDS_DOUBLEBUF = 0x0100; - static const int FLAG_NEEDS_ASYNCBLIT = 0x0200; - - osd_renderer(osd_window *window, const int flags) - : m_window(window), m_flags(flags) { } - - virtual ~osd_renderer() { } - - osd_window &window() { return *m_window; } - bool has_flags(const int flag) { return ((m_flags & flag)) == flag; } - void set_flags(int aflag) { m_flags |= aflag; } - void clear_flags(int aflag) { m_flags &= ~aflag; } - - - void notify_changed() { set_flags(FI_CHANGED); } - - /* Interface to be implemented by render code */ - - virtual int create() = 0; - virtual render_primitive_list *get_primitives() = 0; - - virtual int draw(const int update) = 0; -#ifdef OSD_SDL - virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) = 0; -#else - virtual void save() = 0; - virtual void record() = 0; - virtual void toggle_fsfx() = 0; -#endif - - virtual void destroy() = 0; - -protected: - /* Internal flags */ - static const int FI_CHANGED = 0x010000; - -private: - - osd_window *m_window; - int m_flags; -}; - #define OSDWORK_CALLBACK(name) void *name(void *param, ATTR_UNUSED int threadid) class sdl_window_info : public osd_window diff --git a/src/osd/windows/video.c b/src/osd/windows/video.c index 5db095cff99..41fa7534e87 100644 --- a/src/osd/windows/video.c +++ b/src/osd/windows/video.c @@ -64,6 +64,9 @@ static void get_resolution(const char *defdata, const char *data, osd_window_con // video_init //============================================================ +// FIXME: Temporary workaround +static osd_window_config windows[MAX_WINDOWS]; // configuration data per-window + bool windows_osd_interface::video_init() { int index; @@ -80,7 +83,7 @@ bool windows_osd_interface::video_init() // create the windows windows_options &options = downcast<windows_options &>(machine().options()); for (index = 0; index < video_config.numscreens; index++) - winwindow_video_window_create(machine(), index, pick_monitor(options, index), &video_config.window[index]); + winwindow_video_window_create(machine(), index, pick_monitor(options, index), &windows[index]); if (video_config.mode != VIDEO_MODE_NONE) SetForegroundWindow(win_window_list->m_hwnd); @@ -371,10 +374,10 @@ void windows_osd_interface::extract_video_config() // per-window options: extract the data const char *default_resolution = options().resolution(); - get_resolution(default_resolution, options().resolution(0), &video_config.window[0], TRUE); - get_resolution(default_resolution, options().resolution(1), &video_config.window[1], TRUE); - get_resolution(default_resolution, options().resolution(2), &video_config.window[2], TRUE); - get_resolution(default_resolution, options().resolution(3), &video_config.window[3], TRUE); + get_resolution(default_resolution, options().resolution(0), &windows[0], TRUE); + get_resolution(default_resolution, options().resolution(1), &windows[1], TRUE); + get_resolution(default_resolution, options().resolution(2), &windows[2], TRUE); + get_resolution(default_resolution, options().resolution(3), &windows[3], TRUE); // video options: extract the data stemp = options().video(); diff --git a/src/osd/windows/video.h b/src/osd/windows/video.h index 79aca4d5b4d..f230bb203f2 100644 --- a/src/osd/windows/video.h +++ b/src/osd/windows/video.h @@ -10,7 +10,7 @@ #define __WIN_VIDEO__ #include "render.h" - +//#include "modules/osdwindow.h" //============================================================ // CONSTANTS @@ -67,19 +67,6 @@ private: char * m_name; }; - -struct osd_window_config -{ - osd_window_config() : aspect(0.0f), width(0), height(0), depth(0), refresh(0) {} - - float aspect; // decoded aspect ratio FIXME: not used on windows - int width; // decoded width - int height; // decoded height - int depth; // decoded depth - only SDL - int refresh; // decoded refresh -}; - - struct win_video_config { // global configuration @@ -90,7 +77,7 @@ struct win_video_config render_layer_config layerconfig; // default configuration of layers // per-window configuration - osd_window_config window[MAX_WINDOWS]; // configuration data per-window + //osd_window_config window[MAX_WINDOWS]; // configuration data per-window // hardware options int mode; // output mode diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h index 7e99ec04b38..d1486f755c5 100644 --- a/src/osd/windows/window.h +++ b/src/osd/windows/window.h @@ -12,6 +12,7 @@ #include "video.h" #include "render.h" +#include "modules/osdwindow.h" //============================================================ // PARAMETERS @@ -32,121 +33,6 @@ // TYPE DEFINITIONS //============================================================ -/* ------------------------------------------------------ - * - * All types named osd_* will ultimately be located in - * the modules tree. They are temporarily maintained in - * window.h until basic code simplification is finished. - * - */ - -class win_window_info; - -class osd_window -{ -public: - osd_window() - : -#ifdef OSD_SDL -#else - m_hwnd(0), m_dc(0), m_focus_hwnd(0), m_resize_state(0), -#endif - m_prescale(1), - m_primlist(NULL) - {} - virtual ~osd_window() { } - - virtual render_target *target() = 0; - virtual int fullscreen() const = 0; - virtual running_machine &machine() const = 0; - - int prescale() const { return m_prescale; }; - - float aspect() const { return monitor()->aspect(); } - - virtual void get_size(int &w, int &h) = 0; - -#ifdef OSD_SDL - virtual void blit_surface_size(int &blitwidth, int &blitheight) = 0; - virtual sdl_monitor_info *monitor() const = 0; -#if (SDLMAME_SDL2) - virtual SDL_Window *sdl_window() = 0; -#else - virtual SDL_Surface *sdl_surface() = 0; -#endif -#else - virtual win_monitor_info *monitor() const = 0; - virtual bool win_has_menu() = 0; - // FIXME: cann we replace winwindow_video_window_monitor(NULL) with monitor() ? - virtual win_monitor_info *winwindow_video_window_monitor(const RECT *proposed) = 0; - - // window handle and info - HWND m_hwnd; - HDC m_dc; // only used by GDI renderer! - // FIXME: this is the same as win_window_list->m_hwnd, i.e. first window. - // During modularization, this should be passed in differently - HWND m_focus_hwnd; - - int m_resize_state; -#endif - - osd_window_config m_win_config; - int m_prescale; - render_primitive_list * m_primlist; -}; - -class osd_renderer -{ -public: - - /* Generic flags */ - static const int FLAG_NONE = 0x0000; - static const int FLAG_NEEDS_OPENGL = 0x0001; - static const int FLAG_HAS_VECTOR_SCREEN = 0x0002; - - /* SDL 1.2 flags */ - static const int FLAG_NEEDS_DOUBLEBUF = 0x0100; - static const int FLAG_NEEDS_ASYNCBLIT = 0x0200; - - osd_renderer(osd_window *window, const int flags) - : m_window(window), m_flags(flags) { } - - virtual ~osd_renderer() { } - - osd_window &window() { return *m_window; } - bool has_flags(const int flag) { return ((m_flags & flag)) == flag; } - void set_flags(int aflag) { m_flags |= aflag; } - void clear_flags(int aflag) { m_flags &= ~aflag; } - - - void notify_changed() { set_flags(FI_CHANGED); } - - /* Interface to be implemented by render code */ - - virtual int create() = 0; - virtual render_primitive_list *get_primitives() = 0; - - virtual int draw(const int update) = 0; -#ifdef OSD_SDL - virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) = 0; -#else - virtual void save() = 0; - virtual void record() = 0; - virtual void toggle_fsfx() = 0; -#endif - - virtual void destroy() = 0; - -protected: - /* Internal flags */ - static const int FI_CHANGED = 0x010000; - -private: - - osd_window *m_window; - int m_flags; -}; - class win_window_info : public osd_window { public: @@ -226,8 +112,6 @@ struct osd_draw_callbacks void (*exit)(void); }; - - //============================================================ // GLOBAL VARIABLES //============================================================ diff --git a/src/osd/windows/windows.mak b/src/osd/windows/windows.mak index 5810f4e178a..d25c7d4e490 100644 --- a/src/osd/windows/windows.mak +++ b/src/osd/windows/windows.mak @@ -402,8 +402,14 @@ OSDOBJS = \ $(OSDOBJ)/modules/netdev/none.o \ ifdef USE_OPENGL -OSDOBJS += $(WINOBJ)/../sdl/drawogl.o $(WINOBJ)/../sdl/gl_shader_tool.o $(WINOBJ)/../sdl/gl_shader_mgr.o -OBJDIRS += $(WINOBJ)/../sdl +OSDOBJS += \ + $(WINOBJ)/../sdl/drawogl.o \ + $(OSDOBJ)/modules/opengl/gl_shader_tool.o \ + $(OSDOBJ)/modules/opengl/gl_shader_mgr.o + +OBJDIRS += \ + $(OSDOBJ)/modules/opengl \ + $(WINOBJ)/../sdl DEFS += -DUSE_OPENGL=1 |