Merged sdl_video_config and win_video_config

This commit is contained in:
couriersud 2015-02-28 13:28:23 +01:00
parent f87a0ee7a8
commit b414a032e6
5 changed files with 58 additions and 40 deletions

View File

@ -61,7 +61,7 @@
// GLOBAL VARIABLES // GLOBAL VARIABLES
//============================================================ //============================================================
sdl_video_config video_config; osd_video_config video_config;
sdl_monitor_info *sdl_monitor_info::primary_monitor = NULL; sdl_monitor_info *sdl_monitor_info::primary_monitor = NULL;
sdl_monitor_info *sdl_monitor_info::list = NULL; sdl_monitor_info *sdl_monitor_info::list = NULL;

View File

@ -53,12 +53,6 @@ enum {
// TYPE DEFINITIONS // TYPE DEFINITIONS
//============================================================ //============================================================
struct sdl_mode
{
int width;
int height;
};
class osd_dim class osd_dim
{ {
public: public:
@ -160,18 +154,13 @@ private:
float m_aspect; // computed/configured aspect ratio of the physical device float m_aspect; // computed/configured aspect ratio of the physical device
}; };
struct sdl_video_config struct osd_video_config
{ {
// performance options
int novideo; // don't draw, for pure CPU benchmarking
// global configuration // global configuration
int windowed; // start windowed? int windowed; // start windowed?
int prescale; // prescale factor int prescale; // prescale factor
int keepaspect; // keep aspect ratio int keepaspect; // keep aspect ratio
int numscreens; // number of screens int numscreens; // number of screens
int centerh;
int centerv;
// hardware options // hardware options
int mode; // output mode int mode; // output mode
@ -179,13 +168,16 @@ struct sdl_video_config
int syncrefresh; // sync only to refresh rate int syncrefresh; // sync only to refresh rate
int switchres; // switch resolutions int switchres; // switch resolutions
int fullstretch; int fullstretch; // FXIME: implement in windows!
// vector options // ddraw options
float beamwidth; // beam width int hwstretch; // stretch using the hardware
// d3d, accel, opengl
int filter; // enable filtering
//int filter; // enable filtering, disabled if glsl_filter>0
// OpenGL options // OpenGL options
int filter; // enable filtering, disabled if glsl_filter>0
int glsl; int glsl;
int glsl_filter; // glsl filtering, >0 disables filter int glsl_filter; // glsl filtering, >0 disables filter
char * glsl_shader_mamebm[GLSL_SHADER_MAX]; // custom glsl shader set, mame bitmap char * glsl_shader_mamebm[GLSL_SHADER_MAX]; // custom glsl shader set, mame bitmap
@ -197,6 +189,20 @@ struct sdl_video_config
int allowtexturerect; // allow GL_ARB_texture_rectangle, default: no int allowtexturerect; // allow GL_ARB_texture_rectangle, default: no
int forcepow2texture; // force power of two textures, default: no int forcepow2texture; // force power of two textures, default: no
// dd, d3d
int triplebuf; // triple buffer
//============================================================
// SDL - options
//============================================================
int novideo; // don't draw, for pure CPU benchmarking
int centerh;
int centerv;
// vector options
float beamwidth; // beam width
// perftest // perftest
int perftest; // print out real video fps int perftest; // print out real video fps
@ -211,6 +217,6 @@ struct sdl_video_config
// GLOBAL VARIABLES // GLOBAL VARIABLES
//============================================================ //============================================================
extern sdl_video_config video_config; extern osd_video_config video_config;
#endif #endif

View File

@ -32,7 +32,7 @@
// GLOBAL VARIABLES // GLOBAL VARIABLES
//============================================================ //============================================================
win_video_config video_config; osd_video_config video_config;
@ -170,7 +170,7 @@ float win_monitor_info::aspect()
// winvideo_monitor_from_handle // winvideo_monitor_from_handle
//============================================================ //============================================================
win_monitor_info *winvideo_monitor_from_handle(HMONITOR hmonitor) win_monitor_info *win_monitor_info::monitor_from_handle(HMONITOR hmonitor)
{ {
win_monitor_info *monitor; win_monitor_info *monitor;

View File

@ -111,6 +111,7 @@ public:
// static // static
static BOOL CALLBACK monitor_enum_callback(HMONITOR handle, HDC dc, LPRECT rect, LPARAM data); static BOOL CALLBACK monitor_enum_callback(HMONITOR handle, HDC dc, LPRECT rect, LPARAM data);
static win_monitor_info *monitor_from_handle(HMONITOR monitor);
private: private:
HMONITOR m_handle; // handle to the monitor HMONITOR m_handle; // handle to the monitor
@ -120,33 +121,30 @@ private:
char * m_name; char * m_name;
}; };
struct win_video_config struct osd_video_config
{ {
// global configuration // global configuration
int windowed; // start windowed? int windowed; // start windowed?
int prescale; // prescale factor int prescale; // prescale factor
int keepaspect; // keep aspect ratio int keepaspect; // keep aspect ratio
int numscreens; // number of screens int numscreens; // number of screens
render_layer_config layerconfig; // default configuration of layers
// per-window configuration
//osd_window_config window[MAX_WINDOWS]; // configuration data per-window
// hardware options // hardware options
int mode; // output mode int mode; // output mode
int waitvsync; // spin until vsync int waitvsync; // spin until vsync
int syncrefresh; // sync only to refresh rate int syncrefresh; // sync only to refresh rate
int triplebuf; // triple buffer
int switchres; // switch resolutions int switchres; // switch resolutions
int fullstretch; // FXIME: implement in windows!
// ddraw options // ddraw options
int hwstretch; // stretch using the hardware int hwstretch; // stretch using the hardware
// d3d options // d3d, accel, opengl
int filter; // enable filtering int filter; // enable filtering
//int filter; // enable filtering, disabled if glsl_filter>0
// OpenGL options // OpenGL options
//int filter; // enable filtering, disabled if glsl_filter>0
int glsl; int glsl;
int glsl_filter; // glsl filtering, >0 disables filter int glsl_filter; // glsl filtering, >0 disables filter
char * glsl_shader_mamebm[GLSL_SHADER_MAX]; // custom glsl shader set, mame bitmap char * glsl_shader_mamebm[GLSL_SHADER_MAX]; // custom glsl shader set, mame bitmap
@ -157,21 +155,35 @@ struct win_video_config
int vbo; int vbo;
int allowtexturerect; // allow GL_ARB_texture_rectangle, default: no int allowtexturerect; // allow GL_ARB_texture_rectangle, default: no
int forcepow2texture; // force power of two textures, default: no int forcepow2texture; // force power of two textures, default: no
// dd, d3d
int triplebuf; // triple buffer
//============================================================
// SDL - options
//============================================================
int novideo; // don't draw, for pure CPU benchmarking
int centerh;
int centerv;
// vector options
float beamwidth; // beam width
// perftest
int perftest; // print out real video fps
// X11 options
int restrictonemonitor; // in fullscreen, confine to Xinerama monitor 0
// YUV options
int scale_mode;
}; };
//============================================================ //============================================================
// GLOBAL VARIABLES // GLOBAL VARIABLES
//============================================================ //============================================================
extern win_video_config video_config; extern osd_video_config video_config;
//============================================================
// PROTOTYPES
//============================================================
win_monitor_info *winvideo_monitor_from_handle(HMONITOR monitor);
#endif #endif

View File

@ -847,10 +847,10 @@ win_monitor_info *win_window_info::winwindow_video_window_monitor(const osd_rect
p.left = proposed->left(); p.left = proposed->left();
p.bottom = proposed->bottom(); p.bottom = proposed->bottom();
p.right = proposed->right(); p.right = proposed->right();
monitor = winvideo_monitor_from_handle(MonitorFromRect(&p, MONITOR_DEFAULTTONEAREST)); monitor = win_monitor_info::monitor_from_handle(MonitorFromRect(&p, MONITOR_DEFAULTTONEAREST));
} }
else else
monitor = winvideo_monitor_from_handle(MonitorFromWindow(m_hwnd, MONITOR_DEFAULTTONEAREST)); monitor = win_monitor_info::monitor_from_handle(MonitorFromWindow(m_hwnd, MONITOR_DEFAULTTONEAREST));
} }
// in full screen, just use the configured monitor // in full screen, just use the configured monitor