Previous 199869 Revisions Next

r45068 Sunday 21st February, 2016 at 02:03:29 UTC by Ryan Holtz
Final fixups, get sliders working again, nw
[src/emu/ui]ui.cpp ui.h
[src/osd/modules]osdwindow.cpp osdwindow.h
[src/osd/modules/lib]osdobj_common.cpp
[src/osd/modules/render]draw13.cpp draw13.h drawbgfx.h drawd3d.cpp drawd3d.h drawgdi.h drawnone.h drawogl.cpp drawogl.h drawsdl.cpp drawsdl.h
[src/osd/modules/render/d3d]d3dhlsl.cpp d3dhlsl.h
[src/osd/sdl]video.cpp video.h window.cpp
[src/osd/windows]video.cpp window.cpp winmain.h

trunk/src/emu/ui/ui.cpp
r253579r253580
19541954   state->incval = incval;
19551955   state->update = update;
19561956   state->arg = arg;
1957   state->hidden = false;
1958   state->id = -1;
19571959   strcpy(state->description, title);
19581960
19591961   return state;
trunk/src/emu/ui/ui.h
r253579r253580
104104   INT32           maxval;             /* maximum value */
105105   INT32           incval;             /* increment value */
106106   bool         hidden;            /* hidden or not */
107   INT32         id;               /* unique identifier */
107108   char          description[1];     /* textual description */
108109};
109110
trunk/src/osd/modules/lib/osdobj_common.cpp
r253579r253580
492492
493493slider_state* osd_common_t::get_slider_list()
494494{
495   printf("Core get_slider_list\n");
495496   return nullptr;
496497}
497498
trunk/src/osd/modules/osdwindow.cpp
r253579r253580
1616
1717#include "render/drawnone.h"
1818#include "render/drawbgfx.h"
19#if (USE_OPENGL)
1920#include "render/drawogl.h"
20#if OSD_WINDOWS
21#endif
22#ifdef OSD_WINDOWS
2123#include "render/drawgdi.h"
2224#include "render/drawd3d.h"
2325#else
r253579r253580
2931{
3032   switch(mode)
3133   {
34#ifdef OSD_WINDOWS
3235      case VIDEO_MODE_NONE:
3336         return new renderer_none(window);
37#endif
3438      case VIDEO_MODE_BGFX:
3539         return new renderer_bgfx(window);
3640#if (USE_OPENGL)
3741      case VIDEO_MODE_OPENGL:
3842         return new renderer_ogl(window);
3943#endif
40#if OSD_WINDOWS
44#ifdef OSD_WINDOWS
4145      case VIDEO_MODE_GDI:
4246         return new renderer_gdi(window);
4347      case VIDEO_MODE_D3D:
trunk/src/osd/modules/osdwindow.h
r253579r253580
1212#include "emu.h"
1313#include "ui/ui.h"
1414
15#ifdef OSD_SDL
16// standard SDL headers
17#include "sdlinc.h"
18#endif
19
1520//============================================================
1621//  TYPE DEFINITIONS
1722//============================================================
r253579r253580
2126
2227enum
2328{
24   VIDEO_MODE_NONE,
29   VIDEO_MODE_NONE = 0,
2530   VIDEO_MODE_GDI,
2631   VIDEO_MODE_BGFX,
2732#if (USE_OPENGL)
r253579r253580
2934#endif
3035   VIDEO_MODE_SDL2ACCEL,
3136   VIDEO_MODE_D3D,
32   VIDEO_MODE_SOFT
37   VIDEO_MODE_SOFT,
38
39   VIDEO_MODE_COUNT
3340};
3441
3542class osd_dim
r253579r253580
205212   static const int FLAG_NEEDS_ASYNCBLIT       = 0x0200;
206213
207214   osd_renderer(osd_window *window, const int flags)
208   : m_window(window), m_flags(flags) { }
215   : m_sliders_dirty(false), m_window(window), m_flags(flags) { }
209216
210217   virtual ~osd_renderer() { }
211218
r253579r253580
219226   /* Interface to be implemented by render code */
220227
221228   virtual int create() = 0;
222   virtual int init(running_machine &machine) = 0;
223229   virtual render_primitive_list *get_primitives() = 0;
224230
225231   virtual slider_state* get_slider_list() { return nullptr; }
r253579r253580
228234   virtual void save() { };
229235   virtual void record() { };
230236   virtual void toggle_fsfx() { };
237   virtual bool sliders_dirty() { return m_sliders_dirty; }
231238
232239   static osd_renderer* make_for_type(int mode, osd_window *window, int extra_flags = FLAG_NONE);
233240
234241protected:
235242   /* Internal flags */
236243   static const int FI_CHANGED                 = 0x010000;
244   bool      m_sliders_dirty;
237245
238246private:
239247   osd_window   *m_window;
trunk/src/osd/modules/render/d3d/d3dhlsl.cpp
r253579r253580
22062206//  be done in a more ideal way.
22072207//============================================================
22082208
2209static slider_state *slider_alloc(running_machine &machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg)
2209static slider_state *slider_alloc(running_machine &machine, int id, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg)
22102210{
22112211   int size = sizeof(slider_state) + strlen(title);
22122212   slider_state *state = (slider_state *)auto_alloc_array_clear(machine, UINT8, size);
r253579r253580
22182218   state->update = update;
22192219   state->arg = arg;
22202220   state->hidden = false;
2221   state->id = id;
22212222   strcpy(state->description, title);
22222223
22232224   return state;
r253579r253580
28452846
28462847hlsl_options shaders::last_options = { false };
28472848
2849enum slider_option
2850{
2851   SLIDER_VECTOR_ATTENUATION = 0,
2852   SLIDER_VECTOR_LENGTH_MAX,
2853   SLIDER_SHADOW_MASK_TILE_MODE,
2854   SLIDER_SHADOW_MASK_ALPHA,
2855   SLIDER_SHADOW_MASK_X_COUNT,
2856   SLIDER_SHADOW_MASK_Y_COUNT,
2857   SLIDER_SHADOW_MASK_U_SIZE,
2858   SLIDER_SHADOW_MASK_V_SIZE,
2859   SLIDER_SHADOW_MASK_U_OFFSET,
2860   SLIDER_SHADOW_MASK_V_OFFSET,
2861   SLIDER_CURVATURE,
2862   SLIDER_ROUND_CORNER,
2863   SLIDER_SMOOTH_BORDER,
2864   SLIDER_REFLECTION,
2865   SLIDER_VIGNETTING,
2866   SLIDER_SCANLINE_ALPHA,
2867   SLIDER_SCANLINE_SCALE,
2868   SLIDER_SCANLINE_HEIGHT,
2869   SLIDER_SCANLINE_BRIGHT_SCALE,
2870   SLIDER_SCANLINE_BRIGHT_OFFSET,
2871   SLIDER_SCANLINE_JITTER,
2872   SLIDER_HUM_BAR_ALPHA,
2873   SLIDER_DEFOCUS_X,
2874   SLIDER_DEFOCUS_Y,
2875   SLIDER_RED_CONVERGE_X,
2876   SLIDER_RED_CONVERGE_Y,
2877   SLIDER_GREEN_CONVERGE_X,
2878   SLIDER_GREEN_CONVERGE_Y,
2879   SLIDER_BLUE_CONVERGE_X,
2880   SLIDER_BLUE_CONVERGE_Y,
2881   SLIDER_RED_RADIAL_CONVERGE_X,
2882   SLIDER_RED_RADIAL_CONVERGE_Y,
2883   SLIDER_GREEN_RADIAL_CONVERGE_X,
2884   SLIDER_GREEN_RADIAL_CONVERGE_Y,
2885   SLIDER_BLUE_RADIAL_CONVERGE_X,
2886   SLIDER_BLUE_RADIAL_CONVERGE_Y,
2887   SLIDER_RED_FROM_R,
2888   SLIDER_RED_FROM_G,
2889   SLIDER_RED_FROM_B,
2890   SLIDER_GREEN_FROM_R,
2891   SLIDER_GREEN_FROM_G,
2892   SLIDER_GREEN_FROM_B,
2893   SLIDER_BLUE_FROM_R,
2894   SLIDER_BLUE_FROM_G,
2895   SLIDER_BLUE_FROM_B,
2896   SLIDER_SATURATION,
2897   SLIDER_RED_OFFSET,
2898   SLIDER_GREEN_OFFSET,
2899   SLIDER_BLUE_OFFSET,
2900   SLIDER_RED_SCALE,
2901   SLIDER_GREEN_SCALE,
2902   SLIDER_BLUE_SCALE,
2903   SLIDER_RED_POWER,
2904   SLIDER_GREEN_POWER,
2905   SLIDER_BLUE_POWER,
2906   SLIDER_RED_FLOOR,
2907   SLIDER_GREEN_FLOOR,
2908   SLIDER_BLUE_FLOOR,
2909   SLIDER_RED_PHOSPHOR,
2910   SLIDER_GREEN_PHOSPHOR,
2911   SLIDER_BLUE_PHOSPHOR,
2912   SLIDER_BLOOM_BLEND_MODE,
2913   SLIDER_BLOOM_SCALE,
2914   SLIDER_BLOOM_RED_OVERDRIVE,
2915   SLIDER_BLOOM_GREEN_OVERDRIVE,
2916   SLIDER_BLOOM_BLUE_OVERDRIVE,
2917   SLIDER_BLOOM_LVL0_SCALE,
2918   SLIDER_BLOOM_LVL1_SCALE,
2919   SLIDER_BLOOM_LVL2_SCALE,
2920   SLIDER_BLOOM_LVL3_SCALE,
2921   SLIDER_BLOOM_LVL4_SCALE,
2922   SLIDER_BLOOM_LVL5_SCALE,
2923   SLIDER_BLOOM_LVL6_SCALE,
2924   SLIDER_BLOOM_LVL7_SCALE,
2925   SLIDER_BLOOM_LVL8_SCALE,
2926   SLIDER_BLOOM_LVL9_SCALE,
2927   SLIDER_BLOOM_LVL10_SCALE,
2928   SLIDER_NTSC_ENABLE,
2929   SLIDER_NTSC_JITTER,
2930   SLIDER_NTSC_A_VALUE,
2931   SLIDER_NTSC_B_VALUE,
2932   SLIDER_NTSC_P_VALUE,
2933   SLIDER_NTSC_O_VALUE,
2934   SLIDER_NTSC_CC_VALUE,
2935   SLIDER_NTSC_N_VALUE,
2936   SLIDER_NTSC_Y_VALUE,
2937   SLIDER_NTSC_I_VALUE,
2938   SLIDER_NTSC_Q_VALUE,
2939   SLIDER_NTSC_SCAN_TIME
2940};
2941
28482942shaders::slider_desc shaders::s_sliders[] =
28492943{
2850   { "Vector Length Attenuation",           0,    50,   100, 1, 2, slider_vector_attenuation },
2851   { "Vector Attenuation Length Limit",     1,   500,  1000, 1, 2, slider_vector_length_max },
2852   { "Shadow Mask Tile Mode",               0,     0,     1, 1, 7, slider_shadow_mask_tile_mode },
2853   { "Shadow Mask Darkness",                0,     0,   100, 1, 7, slider_shadow_mask_alpha },
2854   { "Shadow Mask X Count",                 1,     1,  1024, 1, 7, slider_shadow_mask_x_count },
2855   { "Shadow Mask Y Count",                 1,     1,  1024, 1, 7, slider_shadow_mask_y_count },
2856   { "Shadow Mask Pixel Count X",           1,     1,    64, 1, 7, slider_shadow_mask_usize },
2857   { "Shadow Mask Pixel Count Y",           1,     1,    64, 1, 7, slider_shadow_mask_vsize },
2858   { "Shadow Mask Offset X",             -100,     0,   100, 1, 7, slider_shadow_mask_uoffset },
2859   { "Shadow Mask Offset Y",             -100,     0,   100, 1, 7, slider_shadow_mask_voffset },
2860   { "Screen Curvature",                    0,     0,   100, 1, 7, slider_curvature },
2861   { "Screen Round Corner",                 0,     0,   100, 1, 7, slider_round_corner },
2862   { "Screen Smooth Border",                0,     0,   100, 1, 7, slider_smooth_border },
2863   { "Screen Reflection",                   0,     0,   100, 1, 7, slider_reflection },
2864   { "Image Vignetting",                    0,     0,   100, 1, 7, slider_vignetting },
2865   { "Scanline Darkness",                   0,     0,   100, 1, 5, slider_scanline_alpha },
2866   { "Scanline Screen Height",              1,    20,    80, 1, 5, slider_scanline_scale },
2867   { "Scanline Indiv. Height",              1,    20,    80, 1, 5, slider_scanline_height },
2868   { "Scanline Brightness",                 0,    20,    40, 1, 5, slider_scanline_bright_scale },
2869   { "Scanline Brightness Overdrive",       0,     0,    20, 1, 5, slider_scanline_bright_offset },
2870   { "Scanline Jitter",                     0,     0,   100, 1, 5, slider_scanline_jitter },
2871   { "Hum Bar Darkness",                    0,     0,   100, 1, 5, slider_hum_bar_alpha },
2872   { "Defocus X",                           0,     0,   100, 1, 7, slider_defocus_x },
2873   { "Defocus Y",                           0,     0,   100, 1, 7, slider_defocus_y },
2874   { "Red Position Offset X",            -100,     0,   100, 1, 7, slider_red_converge_x },
2875   { "Red Position Offset Y",            -100,     0,   100, 1, 7, slider_red_converge_y },
2876   { "Green Position Offset X",          -100,     0,   100, 1, 7, slider_green_converge_x },
2877   { "Green Position Offset Y",          -100,     0,   100, 1, 7, slider_green_converge_y },
2878   { "Blue Position Offset X",           -100,     0,   100, 1, 7, slider_blue_converge_x },
2879   { "Blue Position Offset Y",           -100,     0,   100, 1, 7, slider_blue_converge_y },
2880   { "Red Convergence X",                -100,     0,   100, 1, 7, slider_red_radial_converge_x },
2881   { "Red Convergence Y",                -100,     0,   100, 1, 7, slider_red_radial_converge_y },
2882   { "Green Convergence X",              -100,     0,   100, 1, 7, slider_green_radial_converge_x },
2883   { "Green Convergence Y",              -100,     0,   100, 1, 7, slider_green_radial_converge_y },
2884   { "Blue Convergence X",               -100,     0,   100, 1, 7, slider_blue_radial_converge_x },
2885   { "Blue Convergence Y",               -100,     0,   100, 1, 7, slider_blue_radial_converge_y },
2886   { "Red Output from Red Input",        -400,     0,   400, 5, 7, slider_red_from_r },
2887   { "Red Output from Green Input",      -400,     0,   400, 5, 7, slider_red_from_g },
2888   { "Red Output from Blue Input",       -400,     0,   400, 5, 7, slider_red_from_b },
2889   { "Green Output from Red Input",      -400,     0,   400, 5, 7, slider_green_from_r },
2890   { "Green Output from Green Input",    -400,     0,   400, 5, 7, slider_green_from_g },
2891   { "Green Output from Blue Input",     -400,     0,   400, 5, 7, slider_green_from_b },
2892   { "Blue Output from Red Input",       -400,     0,   400, 5, 7, slider_blue_from_r },
2893   { "Blue Output from Green Input",     -400,     0,   400, 5, 7, slider_blue_from_g },
2894   { "Blue Output from Blue Input",      -400,     0,   400, 5, 7, slider_blue_from_b },
2895   { "Saturation",                          0,   100,   400, 1, 7, slider_saturation },
2896   { "Red DC Offset",                    -100,     0,   100, 1, 7, slider_red_offset },
2897   { "Green DC Offset",                  -100,     0,   100, 1, 7, slider_green_offset },
2898   { "Blue DC Offset",                   -100,     0,   100, 1, 7, slider_blue_offset },
2899   { "Red Scale",                        -200,   100,   200, 1, 7, slider_red_scale },
2900   { "Green Scale",                      -200,   100,   200, 1, 7, slider_green_scale },
2901   { "Blue Scale",                       -200,   100,   200, 1, 7, slider_blue_scale },
2902   { "Red Gamma",                         -80,     0,    80, 1, 7, slider_red_power },
2903   { "Green Gamma",                       -80,     0,    80, 1, 7, slider_green_power },
2904   { "Blue Gamma",                        -80,     0,    80, 1, 7, slider_blue_power },
2905   { "Red Floor",                           0,     0,   100, 1, 7, slider_red_floor },
2906   { "Green Floor",                         0,     0,   100, 1, 7, slider_green_floor },
2907   { "Blue Floor",                          0,     0,   100, 1, 7, slider_blue_floor },
2908   { "Red Phosphor Life",                   0,     0,   100, 1, 7, slider_red_phosphor_life },
2909   { "Green Phosphor Life",                 0,     0,   100, 1, 7, slider_green_phosphor_life },
2910   { "Blue Phosphor Life",                  0,     0,   100, 1, 7, slider_blue_phosphor_life },
2911   { "Bloom Blend Mode",                    0,     0,     1, 1, 7, slider_bloom_blend_mode },
2912   { "Bloom Scale",                         0,     0,  2000, 5, 7, slider_bloom_scale },
2913   { "Bloom Red Overdrive",                 0,     0,  2000, 5, 7, slider_bloom_red_overdrive },
2914   { "Bloom Green Overdrive",               0,     0,  2000, 5, 7, slider_bloom_green_overdrive },
2915   { "Bloom Blue Overdrive",                0,     0,  2000, 5, 7, slider_bloom_blue_overdrive },
2916   { "Bloom Level 0 Scale",                 0,   100,   100, 1, 7, slider_bloom_lvl0_scale },
2917   { "Bloom Level 1 Scale",                 0,     0,   100, 1, 7, slider_bloom_lvl1_scale },
2918   { "Bloom Level 2 Scale",                 0,     0,   100, 1, 7, slider_bloom_lvl2_scale },
2919   { "Bloom Level 3 Scale",                 0,     0,   100, 1, 7, slider_bloom_lvl3_scale },
2920   { "Bloom Level 4 Scale",                 0,     0,   100, 1, 7, slider_bloom_lvl4_scale },
2921   { "Bloom Level 5 Scale",                 0,     0,   100, 1, 7, slider_bloom_lvl5_scale },
2922   { "Bloom Level 6 Scale",                 0,     0,   100, 1, 7, slider_bloom_lvl6_scale },
2923   { "Bloom Level 7 Scale",                 0,     0,   100, 1, 7, slider_bloom_lvl7_scale },
2924   { "Bloom Level 8 Scale",                 0,     0,   100, 1, 7, slider_bloom_lvl8_scale },
2925   { "Bloom Level 9 Scale",                 0,     0,   100, 1, 7, slider_bloom_lvl9_scale },
2926   { "Bloom Level 10 Scale",                0,     0,   100, 1, 7, slider_bloom_lvl10_scale },
2927   { "NTSC processing",                     0,     0,     1, 1, 5, slider_ntsc_enable },
2928   { "Signal Jitter",                       0,     0,   100, 1, 5, slider_ntsc_jitter },
2929   { "A Value",                          -100,    50,   100, 1, 5, slider_ntsc_a_value },
2930   { "B Value",                          -100,    50,   100, 1, 5, slider_ntsc_b_value },
2931   { "Incoming Pixel Clock Scaling",     -300,   100,   300, 1, 5, slider_ntsc_p_value },
2932   { "Outgoing Color Carrier Phase",     -300,     0,   300, 1, 5, slider_ntsc_o_value },
2933   { "Color Carrier Frequency",             0, 35795, 60000, 5, 5, slider_ntsc_cc_value },
2934   { "Y Notch",                             0,   100,   600, 5, 5, slider_ntsc_n_value },
2935   { "Y Frequency",                         0,   600,   600, 5, 5, slider_ntsc_y_value },
2936   { "I Frequency",                         0,   120,   600, 5, 5, slider_ntsc_i_value },
2937   { "Q Frequency",                         0,    60,   600, 5, 5, slider_ntsc_q_value },
2938   { "Scanline Duration",                   0,  5260, 10000, 1, 5, slider_ntsc_scan_time },
2939   // { "Phase Count",                         1,     2,     3, 1, 5, slider_ntsc_phase_count },
2940   { NULL, 0, 0, 0, 0, 0, NULL },
2944   { "Vector Length Attenuation",           0,    50,   100, 1, SLIDER_SCREEN_TYPE_VECTOR, slider_vector_attenuation, SLIDER_VECTOR_ATTENUATION },
2945   { "Vector Attenuation Length Limit",     1,   500,  1000, 1, SLIDER_SCREEN_TYPE_VECTOR, slider_vector_length_max, SLIDER_VECTOR_LENGTH_MAX },
2946   { "Shadow Mask Tile Mode",               0,     0,     1, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_tile_mode, SLIDER_SHADOW_MASK_TILE_MODE },
2947   { "Shadow Mask Darkness",                0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_alpha, SLIDER_SHADOW_MASK_ALPHA },
2948   { "Shadow Mask X Count",                 1,     1,  1024, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_x_count, SLIDER_SHADOW_MASK_X_COUNT },
2949   { "Shadow Mask Y Count",                 1,     1,  1024, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_y_count, SLIDER_SHADOW_MASK_Y_COUNT },
2950   { "Shadow Mask Pixel Count X",           1,     1,    64, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_usize, SLIDER_SHADOW_MASK_U_SIZE },
2951   { "Shadow Mask Pixel Count Y",           1,     1,    64, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_vsize, SLIDER_SHADOW_MASK_V_SIZE },
2952   { "Shadow Mask Offset X",             -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_uoffset, SLIDER_SHADOW_MASK_U_OFFSET },
2953   { "Shadow Mask Offset Y",             -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_voffset, SLIDER_SHADOW_MASK_V_OFFSET },
2954   { "Screen Curvature",                    0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_curvature, SLIDER_CURVATURE },
2955   { "Screen Round Corner",                 0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_round_corner, SLIDER_ROUND_CORNER },
2956   { "Screen Smooth Border",                0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_smooth_border, SLIDER_SMOOTH_BORDER },
2957   { "Screen Reflection",                   0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_reflection, SLIDER_REFLECTION },
2958   { "Image Vignetting",                    0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_vignetting, SLIDER_VIGNETTING },
2959   { "Scanline Darkness",                   0,     0,   100, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_scanline_alpha, SLIDER_SCANLINE_ALPHA },
2960   { "Scanline Screen Height",              1,    20,    80, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_scanline_scale, SLIDER_SCANLINE_SCALE },
2961   { "Scanline Indiv. Height",              1,    20,    80, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_scanline_height, SLIDER_SCANLINE_HEIGHT },
2962   { "Scanline Brightness",                 0,    20,    40, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_scanline_bright_scale, SLIDER_SCANLINE_BRIGHT_SCALE },
2963   { "Scanline Brightness Overdrive",       0,     0,    20, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_scanline_bright_offset, SLIDER_SCANLINE_BRIGHT_OFFSET },
2964   { "Scanline Jitter",                     0,     0,   100, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_scanline_jitter, SLIDER_SCANLINE_JITTER },
2965   { "Hum Bar Darkness",                    0,     0,   100, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_hum_bar_alpha, SLIDER_HUM_BAR_ALPHA },
2966   { "Defocus X",                           0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_defocus_x, SLIDER_DEFOCUS_X },
2967   { "Defocus Y",                           0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_defocus_y, SLIDER_DEFOCUS_Y },
2968   { "Red Position Offset X",            -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_converge_x, SLIDER_RED_CONVERGE_X },
2969   { "Red Position Offset Y",            -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_converge_y, SLIDER_RED_CONVERGE_Y },
2970   { "Green Position Offset X",          -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_converge_x, SLIDER_GREEN_CONVERGE_X },
2971   { "Green Position Offset Y",          -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_converge_y, SLIDER_GREEN_CONVERGE_Y },
2972   { "Blue Position Offset X",           -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_converge_x, SLIDER_BLUE_CONVERGE_X },
2973   { "Blue Position Offset Y",           -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_converge_y, SLIDER_BLUE_CONVERGE_Y },
2974   { "Red Convergence X",                -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_radial_converge_x, SLIDER_RED_RADIAL_CONVERGE_X },
2975   { "Red Convergence Y",                -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_radial_converge_y, SLIDER_RED_RADIAL_CONVERGE_Y },
2976   { "Green Convergence X",              -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_radial_converge_x, SLIDER_GREEN_RADIAL_CONVERGE_X },
2977   { "Green Convergence Y",              -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_radial_converge_y, SLIDER_GREEN_RADIAL_CONVERGE_Y },
2978   { "Blue Convergence X",               -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_radial_converge_x, SLIDER_BLUE_RADIAL_CONVERGE_X },
2979   { "Blue Convergence Y",               -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_radial_converge_y, SLIDER_BLUE_RADIAL_CONVERGE_Y },
2980   { "Red Output from Red Input",        -400,     0,   400, 5, SLIDER_SCREEN_TYPE_ANY, slider_red_from_r, SLIDER_RED_FROM_R },
2981   { "Red Output from Green Input",      -400,     0,   400, 5, SLIDER_SCREEN_TYPE_ANY, slider_red_from_g, SLIDER_RED_FROM_G },
2982   { "Red Output from Blue Input",       -400,     0,   400, 5, SLIDER_SCREEN_TYPE_ANY, slider_red_from_b, SLIDER_RED_FROM_B },
2983   { "Green Output from Red Input",      -400,     0,   400, 5, SLIDER_SCREEN_TYPE_ANY, slider_green_from_r, SLIDER_GREEN_FROM_R },
2984   { "Green Output from Green Input",    -400,     0,   400, 5, SLIDER_SCREEN_TYPE_ANY, slider_green_from_g, SLIDER_GREEN_FROM_G },
2985   { "Green Output from Blue Input",     -400,     0,   400, 5, SLIDER_SCREEN_TYPE_ANY, slider_green_from_b, SLIDER_GREEN_FROM_B },
2986   { "Blue Output from Red Input",       -400,     0,   400, 5, SLIDER_SCREEN_TYPE_ANY, slider_blue_from_r, SLIDER_BLUE_FROM_R },
2987   { "Blue Output from Green Input",     -400,     0,   400, 5, SLIDER_SCREEN_TYPE_ANY, slider_blue_from_g, SLIDER_BLUE_FROM_G },
2988   { "Blue Output from Blue Input",      -400,     0,   400, 5, SLIDER_SCREEN_TYPE_ANY, slider_blue_from_b, SLIDER_BLUE_FROM_B },
2989   { "Saturation",                          0,   100,   400, 1, SLIDER_SCREEN_TYPE_ANY, slider_saturation, SLIDER_SATURATION },
2990   { "Red DC Offset",                    -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_offset, SLIDER_RED_OFFSET },
2991   { "Green DC Offset",                  -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_offset, SLIDER_GREEN_OFFSET },
2992   { "Blue DC Offset",                   -100,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_offset, SLIDER_BLUE_OFFSET },
2993   { "Red Scale",                        -200,   100,   200, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_scale, SLIDER_RED_SCALE },
2994   { "Green Scale",                      -200,   100,   200, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_scale, SLIDER_GREEN_SCALE },
2995   { "Blue Scale",                       -200,   100,   200, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_scale, SLIDER_BLUE_SCALE },
2996   { "Red Gamma",                         -80,     0,    80, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_power, SLIDER_RED_POWER },
2997   { "Green Gamma",                       -80,     0,    80, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_power, SLIDER_GREEN_POWER },
2998   { "Blue Gamma",                        -80,     0,    80, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_power, SLIDER_BLUE_POWER },
2999   { "Red Floor",                           0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_floor, SLIDER_RED_FLOOR },
3000   { "Green Floor",                         0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_floor, SLIDER_GREEN_FLOOR },
3001   { "Blue Floor",                          0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_floor, SLIDER_BLUE_FLOOR },
3002   { "Red Phosphor Life",                   0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_phosphor_life, SLIDER_RED_PHOSPHOR },
3003   { "Green Phosphor Life",                 0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_phosphor_life, SLIDER_GREEN_PHOSPHOR },
3004   { "Blue Phosphor Life",                  0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_phosphor_life, SLIDER_BLUE_PHOSPHOR },
3005   { "Bloom Blend Mode",                    0,     0,     1, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_blend_mode, SLIDER_BLOOM_BLEND_MODE },
3006   { "Bloom Scale",                         0,     0,  2000, 5, SLIDER_SCREEN_TYPE_ANY, slider_bloom_scale, SLIDER_BLOOM_SCALE },
3007   { "Bloom Red Overdrive",                 0,     0,  2000, 5, SLIDER_SCREEN_TYPE_ANY, slider_bloom_red_overdrive, SLIDER_BLOOM_RED_OVERDRIVE },
3008   { "Bloom Green Overdrive",               0,     0,  2000, 5, SLIDER_SCREEN_TYPE_ANY, slider_bloom_green_overdrive, SLIDER_BLOOM_GREEN_OVERDRIVE },
3009   { "Bloom Blue Overdrive",                0,     0,  2000, 5, SLIDER_SCREEN_TYPE_ANY, slider_bloom_blue_overdrive, SLIDER_BLOOM_BLUE_OVERDRIVE },
3010   { "Bloom Level 0 Scale",                 0,   100,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl0_scale, SLIDER_BLOOM_LVL0_SCALE },
3011   { "Bloom Level 1 Scale",                 0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl1_scale, SLIDER_BLOOM_LVL1_SCALE },
3012   { "Bloom Level 2 Scale",                 0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl2_scale, SLIDER_BLOOM_LVL2_SCALE },
3013   { "Bloom Level 3 Scale",                 0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl3_scale, SLIDER_BLOOM_LVL3_SCALE },
3014   { "Bloom Level 4 Scale",                 0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl4_scale, SLIDER_BLOOM_LVL4_SCALE },
3015   { "Bloom Level 5 Scale",                 0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl5_scale, SLIDER_BLOOM_LVL5_SCALE },
3016   { "Bloom Level 6 Scale",                 0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl6_scale, SLIDER_BLOOM_LVL6_SCALE },
3017   { "Bloom Level 7 Scale",                 0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl7_scale, SLIDER_BLOOM_LVL7_SCALE },
3018   { "Bloom Level 8 Scale",                 0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl8_scale, SLIDER_BLOOM_LVL8_SCALE },
3019   { "Bloom Level 9 Scale",                 0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl9_scale, SLIDER_BLOOM_LVL9_SCALE },
3020   { "Bloom Level 10 Scale",                0,     0,   100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl10_scale, SLIDER_BLOOM_LVL10_SCALE },
3021   { "NTSC processing",                     0,     0,     1, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_enable, SLIDER_NTSC_ENABLE },
3022   { "Signal Jitter",                       0,     0,   100, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_jitter, SLIDER_NTSC_JITTER },
3023   { "A Value",                          -100,    50,   100, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_a_value, SLIDER_NTSC_A_VALUE },
3024   { "B Value",                          -100,    50,   100, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_b_value, SLIDER_NTSC_B_VALUE },
3025   { "Incoming Pixel Clock Scaling",     -300,   100,   300, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_p_value, SLIDER_NTSC_P_VALUE },
3026   { "Outgoing Color Carrier Phase",     -300,     0,   300, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_o_value, SLIDER_NTSC_O_VALUE },
3027   { "Color Carrier Frequency",             0, 35795, 60000, 5, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_cc_value, SLIDER_NTSC_CC_VALUE },
3028   { "Y Notch",                             0,   100,   600, 5, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_n_value, SLIDER_NTSC_N_VALUE },
3029   { "Y Frequency",                         0,   600,   600, 5, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_y_value, SLIDER_NTSC_Y_VALUE },
3030   { "I Frequency",                         0,   120,   600, 5, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_i_value, SLIDER_NTSC_I_VALUE },
3031   { "Q Frequency",                         0,    60,   600, 5, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_q_value, SLIDER_NTSC_Q_VALUE },
3032   { "Scanline Duration",                   0,  5260, 10000, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_scan_time, SLIDER_NTSC_SCAN_TIME },
3033   { NULL, 0, 0, 0, 0, 0, NULL, -1 },
29413034};
29423035
29433036
r253579r253580
29653058         (screen_type == SCREEN_TYPE_RASTER && (slider->screen_type & SLIDER_SCREEN_TYPE_RASTER) == SLIDER_SCREEN_TYPE_RASTER) ||
29663059         (screen_type == SCREEN_TYPE_LCD    && (slider->screen_type & SLIDER_SCREEN_TYPE_LCD)    == SLIDER_SCREEN_TYPE_LCD))
29673060      {
2968         *tailptr = slider_alloc(*machine, slider->name, slider->minval, slider->defval, slider->maxval, slider->step, slider->adjustor, (void*)options);
3061         *tailptr = slider_alloc(*machine, slider->id, slider->name, slider->minval, slider->defval, slider->maxval, slider->step, slider->adjustor, (void*)options);
29693062         tailptr = &(*tailptr)->next;
29703063      }
29713064   }
trunk/src/osd/modules/render/d3d/d3dhlsl.h
r253579r253580
320320      SLIDER_SCREEN_TYPE_NONE = 0,
321321      SLIDER_SCREEN_TYPE_RASTER = 1,
322322      SLIDER_SCREEN_TYPE_VECTOR = 2,
323      SLIDER_SCREEN_TYPE_LCD = 4
323      SLIDER_SCREEN_TYPE_LCD = 4,
324      SLIDER_SCREEN_TYPE_LCD_OR_RASTER = SLIDER_SCREEN_TYPE_RASTER | SLIDER_SCREEN_TYPE_LCD,
325      SLIDER_SCREEN_TYPE_ANY = SLIDER_SCREEN_TYPE_RASTER | SLIDER_SCREEN_TYPE_VECTOR | SLIDER_SCREEN_TYPE_LCD
324326   };
325327
326328   struct slider_desc
r253579r253580
332334      int                 step;
333335      int                 screen_type;
334336      INT32(*adjustor)(running_machine &, void *, std::string *, INT32);
337      int               id;
335338   };
336339
337340private:
trunk/src/osd/modules/render/draw13.cpp
r253579r253580
8484       * prohibit fullscreen toggling. It is than not possible
8585       * to toggle from fullscreen to window mode.
8686       */
87      expand_copy_info(blit_info_default);
87      expand_copy_info(s_blit_info_default);
8888      s_blit_info_initialized = true;
8989   }
9090}
r253579r253580
180180{ -1 },
181181};
182182
183copy_info_t* renderer_sdl::s_blit_info[SDL_TEXFORMAT_LAST+1] = { NULL };
183copy_info_t* renderer_sdl1::s_blit_info[SDL_TEXFORMAT_LAST+1] = { NULL };
184184bool renderer_sdl1::s_blit_info_initialized = false;
185185
186186//============================================================
r253579r253580
216216   return SDL_BLENDMODE_NONE;
217217}
218218
219void renderer_sdl1::set_coloralphamode(SDL_Texture *texture_id, const render_color *color)
219void texture_info::set_coloralphamode(SDL_Texture *texture_id, const render_color *color)
220220{
221221   UINT32 sr = (UINT32)(255.0f * color->r);
222222   UINT32 sg = (UINT32)(255.0f * color->g);
r253579r253580
333333//  drawsdl_init
334334//============================================================
335335
336static void add_list(copy_info_t **head, copy_info_t *element, Uint32 bm)
336void renderer_sdl1::add_list(copy_info_t **head, const copy_info_t *element, Uint32 bm)
337337{
338338   copy_info_t *newci = global_alloc(copy_info_t);
339339   *newci = *element;
r253579r253580
343343   *head = newci;
344344}
345345
346static void expand_copy_info(copy_info_t *list)
346void renderer_sdl1::expand_copy_info(const copy_info_t *list)
347347{
348   copy_info_t   *bi;
349
350   for (bi = list; bi->src_fmt != -1; bi++)
348   for (const copy_info_t *bi = list; bi->src_fmt != -1; bi++)
351349   {
352350      if (bi->bm_mask == BM_ALL)
353351      {
r253579r253580
357355         add_list(&s_blit_info[bi->src_fmt], bi, SDL_BLENDMODE_BLEND);
358356      }
359357      else
358      {
360359         add_list(&s_blit_info[bi->src_fmt], bi, bi->bm_mask);
360      }
361361   }
362362}
363363
364static osd_renderer *drawsdl2_create(osd_window *window)
365{
366   return global_alloc(renderer_sdl1(window, osd_renderer::FLAG_NONE));
367}
368
369364// FIXME: machine only used to access options.
370int renderer_sdl1::init(running_machine &machine)
365bool renderer_sdl1::init(running_machine &machine)
371366{
372367   osd_printf_verbose("Using SDL native texturing driver (SDL 2.0+)\n");
373368
r253579r253580
386381   else
387382      osd_printf_verbose("Loaded opengl shared library: %s\n", stemp ? stemp : "<default>");
388383
389   return 0;
384   return false;
390385}
391386
392387
r253579r253580
615610
616611copy_info_t *texture_info::compute_size_type()
617612{
618   copy_info_t *bi;
619613   copy_info_t *result = NULL;
620614   int maxperf = 0;
621615
622   for (bi = blit_info[m_format]; bi != NULL; bi = bi->next)
616   for (copy_info_t *bi = renderer_sdl1::s_blit_info[m_format]; bi != NULL; bi = bi->next)
623617   {
624618      if ((m_is_rotated == bi->blitter->m_is_rot)
625619            && (m_sdl_blendmode == bi->bm_mask))
r253579r253580
637631         }
638632      }
639633   }
634
640635   if (result)
641636      return result;
637
642638   /* try last resort handlers */
643   for (bi = blit_info[m_format]; bi != NULL; bi = bi->next)
639   for (copy_info_t *bi = renderer_sdl1::s_blit_info[m_format]; bi != NULL; bi = bi->next)
644640   {
645641      if ((m_is_rotated == bi->blitter->m_is_rot)
646642         && (m_sdl_blendmode == bi->bm_mask))
r253579r253580
906902//  texture_update
907903//============================================================
908904
909texture_info * renderer_sdl3::texture_update(const render_primitive &prim)
905texture_info * renderer_sdl1::texture_update(const render_primitive &prim)
910906{
911907   quad_setup_data setup;
912908   texture_info *texture;
r253579r253580
936932   return texture;
937933}
938934
939render_primitive_list *renderer_sdl13::get_primitives()
935render_primitive_list *renderer_sdl1::get_primitives()
940936{
941937   osd_dim nd = window().blit_surface_size();
942938   if (nd != m_blit_dim)
trunk/src/osd/modules/render/draw13.h
r253579r253580
8888   bool is_pixels_owned() const;
8989
9090private:
91   void set_coloralphamode(SDL_Texture *texture_id, const render_color *color);
92
9193   Uint32              m_sdl_access;
9294   renderer_sdl1 *     m_renderer;
9395   render_texinfo      m_texinfo;            // copy of the texture info
r253579r253580
176178   }
177179
178180   virtual int create() override;
179   virtual int init(running_machine &machine) override;
181   static bool init(running_machine &machine);
180182   virtual int draw(const int update) override;
181183   virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) override;
182184   virtual render_primitive_list *get_primitives() override;
r253579r253580
184186
185187   SDL_Renderer *  m_sdl_renderer;
186188
189   static copy_info_t* s_blit_info[SDL_TEXFORMAT_LAST+1];
190
187191private:
192   void expand_copy_info(const copy_info_t *list);
193   void add_list(copy_info_t **head, const copy_info_t *element, Uint32 bm);
194
188195   void render_quad(texture_info *texture, const render_primitive *prim, const int x, const int y);
189   void set_coloralphamode(SDL_Texture *texture_id, const render_color *color);
190196
191197   texture_info *texture_find(const render_primitive &prim, const quad_setup_data &setup);
192198   texture_info *texture_update(const render_primitive &prim);
r253579r253580
216222   INT64           m_last_blit_time;
217223   INT64           m_last_blit_pixels;
218224
219   static copy_info_t* s_blit_info[SDL_TEXFORMAT_LAST+1];
220225   static bool s_blit_info_initialized;
221226   static const copy_info_t s_blit_info_default[];
222227};
trunk/src/osd/modules/render/drawbgfx.h
r253579r253580
3131
3232   virtual int create() override;
3333   virtual slider_state* get_slider_list() override;
34   virtual int init(running_machine &machine) override { return 0; }
34   static bool init(running_machine &machine) { return false; }
3535   virtual int draw(const int update) override;
3636#ifdef OSD_SDL
3737   virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) override;
trunk/src/osd/modules/render/drawd3d.cpp
r253579r253580
219219//  drawnone_create
220220//============================================================
221221
222int renderer_d3d9::init(running_machine &machine)
222bool renderer_d3d9::init(running_machine &machine)
223223{
224224   // Use Direct3D9
225225   d3dintf = drawd3d9_init();
r253579r253580
228228   if (d3dintf == nullptr)
229229   {
230230      osd_printf_error("Unable to initialize Direct3D.\n");
231      return 1;
231      return true;
232232   }
233233
234   return 0;
234   return false;
235235}
236236
237237
r253579r253580
576576{
577577   // configure the adapter for the mode we want
578578   if (config_adapter_mode())
579   {
579580      return false;
581   }
580582
581583   // create the device immediately for the full screen case (defer for window mode)
582584   if (window().fullscreen() && device_create(window().m_focus_hwnd))
585   {
583586      return false;
587   }
584588
585589   return true;
586590}
r253579r253580
870874
871875   m_shaders = (shaders*)global_alloc_clear<shaders>();
872876   m_shaders->init(d3dintf, &window().machine(), this);
877   m_sliders_dirty = true;
873878
874879   int failed = m_shaders->create_resources(false);
875880   if (failed)
trunk/src/osd/modules/render/drawd3d.h
r253579r253580
4343
4444   virtual int create() override;
4545   virtual slider_state* get_slider_list() override;
46   virtual int init(running_machine &machine) override;
46   static bool init(running_machine &machine);
4747   virtual render_primitive_list *get_primitives() override;
4848   virtual int draw(const int update) override;
4949   virtual void save() override;
trunk/src/osd/modules/render/drawgdi.h
r253579r253580
3838   virtual ~renderer_gdi();
3939
4040   virtual int create() override;
41   virtual int init(running_machine &machine) override { return 0; }
41   static bool init(running_machine &machine) { return false; }
4242   virtual render_primitive_list *get_primitives() override;
4343   virtual int draw(const int update) override;
4444   virtual void save() override {};
trunk/src/osd/modules/render/drawnone.h
r253579r253580
2323   virtual ~renderer_none() { }
2424
2525   virtual int create() override { return 0; }
26   virtual int init(running_machine &machine) override { return 0; }
26   static bool init(running_machine &machine) { return false; }
2727   virtual render_primitive_list *get_primitives() override;
2828   virtual int draw(const int update) override { return 0; }
2929   virtual void save() override { }
trunk/src/osd/modules/render/drawogl.cpp
r253579r253580
277277bool renderer_ogl::s_shown_video_info = false;
278278bool renderer_ogl::s_dll_loaded = false;
279279
280int renderer_ogl::init(running_machine &machine)
280bool renderer_ogl::init(running_machine &machine)
281281{
282282   s_dll_loaded = false;
283283
r253579r253580
288288   osd_printf_verbose("Using SDL multi-window OpenGL driver (SDL 2.0+)\n");
289289#endif
290290
291   return 0;
291   return false;
292292}
293293
294294//============================================================
trunk/src/osd/modules/render/drawogl.h
r253579r253580
131131   virtual ~renderer_ogl();
132132
133133   virtual int create() override;
134   virtual int init(running_machine &machine) override;
134   static bool init(running_machine &machine);
135135   virtual int draw(const int update) override;
136136
137137#ifndef OSD_WINDOWS
r253579r253580
165165
166166   void destroy_all_textures();
167167
168   void load_gl_lib(running_machine &machine);
168   static void load_gl_lib(running_machine &machine);
169169   void loadGLExtensions();
170170   void initialize_gl();
171171   void set_blendmode(int blendmode);
trunk/src/osd/modules/render/drawsdl.cpp
r253579r253580
4444//  PROTOTYPES
4545//============================================================
4646
47// core functions
48static void drawsdl_exit(void);
49
5047// YUV overlays
5148
5249static void yuv_RGB_to_YV12(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \
r253579r253580
9390//  drawsdl_init
9491//============================================================
9592
96int renderer_sdl2::init(running_machine &machine)
93bool renderer_sdl2::init(running_machine &machine)
9794{
9895   osd_printf_verbose("Using SDL multi-window soft driver (SDL 2.0+)\n");
99   return 0;
96   return false;
10097}
10198
10299//============================================================
r253579r253580
154151//  drawsdl_show_info
155152//============================================================
156153
157void renderer_sdl::show_info(struct SDL_RendererInfo *render_info)
154void renderer_sdl2::show_info(struct SDL_RendererInfo *render_info)
158155{
159156#define RF_ENTRY(x) {x, #x }
160157   static struct
trunk/src/osd/modules/render/drawsdl.h
r253579r253580
3636   }
3737   virtual ~renderer_sdl2();
3838
39   /* virtual */ int create() override;
40   /* virtual */ int init(running_machine &machine) override;
41   /* virtual */ int draw(const int update) override;
42   /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt) override;
39   virtual int create() override;
40   virtual int draw(const int update) override;
41   virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) override;
4342   virtual render_primitive_list *get_primitives() override;
4443
44   static bool init(running_machine &machine);
45
4546private:
4647   void show_info(struct SDL_RendererInfo *render_info);
4748
trunk/src/osd/sdl/video.cpp
r253579r253580
8383      get_resolution(options().resolution(), options().resolution(index), &conf, TRUE);
8484
8585      // create window ...
86      sdl_window_info *win = global_alloc(sdl_window_info(machine(), index, sdl_monitor_info::pick_monitor(options(), index), &conf));
86      sdl_window_info *win = global_alloc(sdl_window_info(machine(), index, osd_monitor_info::pick_monitor(reinterpret_cast<osd_options &>(options()), index), &conf));
8787
8888      if (win->window_init())
8989         return false;
r253579r253580
229229//  pick_monitor
230230//============================================================
231231
232osd_monitor_info *osd_monitor_info::pick_monitor(sdl_options &options, int index)
232osd_monitor_info *osd_monitor_info::pick_monitor(osd_options &generic_options, int index)
233233{
234   sdl_options &options = reinterpret_cast<sdl_options &>(generic_options);
234235   osd_monitor_info *monitor;
235236   const char *scrname, *scrname2;
236237   int moncount = 0;
trunk/src/osd/sdl/video.h
r253579r253580
1212#define __SDLVIDEO__
1313
1414#include "osdsdl.h"
15#include "modules/osdwindow.h"
1516
1617//============================================================
1718//  CONSTANTS
trunk/src/osd/sdl/window.cpp
r253579r253580
3636#include "window.h"
3737#include "input.h"
3838#include "osdsdl.h"
39#include "modules/render/drawbgfx.h"
40#include "modules/render/drawsdl.h"
41#include "modules/render/draw13.h"
42#if (USE_OPENGL)
43#include "modules/render/drawogl.h"
44#endif
3945
4046//============================================================
4147//  PARAMETERS
r253579r253580
221227   }
222228
223229   // initialize the drawers
224   if (m_renderer->init(machine()))
225      video_config.mode = VIDEO_MODE_SOFT;
226
230   if (video_config.mode == VIDEO_MODE_BGFX)
231   {
232      if (renderer_bgfx::init(machine()))
233      {
234#if (USE_OPENGL)
235         video_config.mode = VIDEO_MODE_OPENGL;
236      }
237   }
238   if (video_config.mode == VIDEO_MODE_OPENGL)
239   {
240      if (renderer_ogl::init(machine()))
241      {
242         video_config.mode = VIDEO_MODE_SOFT;
243#else
244         video_config.mode = VIDEO_MODE_SOFT;
245#endif
246      }
247   }
248   if (video_config.mode == VIDEO_MODE_SDL2ACCEL)
249   {
250      if (renderer_sdl2::init(machine()))
251      {
252         video_config.mode = VIDEO_MODE_SOFT;
253      }
254   }
227255   if (video_config.mode == VIDEO_MODE_SOFT)
228256   {
229      if (m_renderer->init(machine()))
257      if (renderer_sdl1::init(machine()))
258      {
230259         return false;
260      }
231261   }
232262
233263   /* We may want to set a number of the hints SDL2 provides.
r253579r253580
327357      sdlwindow_sync();
328358   }
329359
330   // kill the drawers
331   delete render_module;
332
333360   execute_async_wait(&sdlwindow_exit_wt, wp_dummy);
334361
335362   if (multithreading_enabled)
r253579r253580
514541      window->m_windowed_dim = window->get_size();
515542   }
516543
517   global_free(window->m_renderer);
544   delete window->m_renderer;
518545   window->m_renderer = nullptr;
519546
520547   bool is_osx = false;
r253579r253580
531558   SDL_DestroyWindow(window->sdl_window());
532559   sdlinput_release_keys();
533560
534   osd_renderer *renderer = osd_renderer::make_for_type(video_config.mode, reinterpret_cast<osd_window *>(this));
535   renderer->init(window->machine());
536   window->set_renderer(renderer);
561   window->set_renderer(osd_renderer::make_for_type(video_config.mode, reinterpret_cast<osd_window *>(window)));
537562
538563   // toggle the window mode
539564   window->set_fullscreen(!window->fullscreen());
r253579r253580
659684   *last_window_ptr = this;
660685   last_window_ptr = &this->m_next;
661686
662   osd_renderer* renderer =
663   set_renderer(draw.create(this));
687   set_renderer(osd_renderer::make_for_type(video_config.mode, reinterpret_cast<osd_window *>(this)));
664688
665689   // create an event that we can use to skip blitting
666690   m_rendered_event = osd_event_alloc(FALSE, TRUE);
trunk/src/osd/windows/video.cpp
r253579r253580
8383      win_window_info::create(machine(), index, osd_monitor_info::pick_monitor(options, index), &windows[index]);
8484   }
8585
86   m_sliders = nullptr;
87   slider_state *curr = m_sliders;
88   for (win_window_info *info = win_window_list; info != nullptr; info = info->m_next)
89   {
90      slider_state *window_sliders = info->m_renderer->get_slider_list();
91      if (window_sliders != nullptr)
92      {
93         if (m_sliders == nullptr)
94         {
95            m_sliders = curr = window_sliders;
96         }
97         else
98         {
99            while (curr->next != nullptr)
100            {
101               curr = curr->next;
102            }
103            curr->next = window_sliders;
104         }
105      }
106   }
107
10886   if (video_config.mode != VIDEO_MODE_NONE)
10987      SetForegroundWindow(win_window_list->m_hwnd);
11088
r253579r253580
215193   // ping the watchdog on each update
216194   winmain_watchdog_ping();
217195
196   update_slider_list();
197
218198   // if we're not skipping this redraw, update all windows
219199   if (!skip_redraw)
220200   {
trunk/src/osd/windows/window.cpp
r253579r253580
2828
2929#include "winutil.h"
3030
31#include "modules/render/drawbgfx.h"
32#include "modules/render/drawnone.h"
33#include "modules/render/drawd3d.h"
34#include "modules/render/drawgdi.h"
35#if (USE_OPENGL)
36#include "modules/render/drawogl.h"
37#endif
38
3139//============================================================
3240//  PARAMETERS
3341//============================================================
r253579r253580
196204      window_threadid = main_threadid;
197205   }
198206
207   const int fallbacks[VIDEO_MODE_COUNT] = {
208      -1,               // NONE -> no fallback
209      VIDEO_MODE_NONE,   // GDI -> NONE
210      VIDEO_MODE_D3D,      // BGFX -> D3D
211#if (USE_OPENGL)
212      VIDEO_MODE_GDI,      // OPENGL -> GDI
213#endif
214      -1,               // No SDL2ACCEL on Windows OSD
215#if (USE_OPENGL)
216      VIDEO_MODE_OPENGL,   // D3D -> OPENGL
217#else
218      VIDEO_MODE_GDI,      // D3D -> GDI
219#endif
220      -1               // No SOFT on Windows OSD
221   };
222
223   int current_mode = video_config.mode;
224   while (current_mode != VIDEO_MODE_NONE)
225   {
226      bool error = false;
227      switch(current_mode)
228      {
229         case VIDEO_MODE_NONE:
230            error = renderer_none::init(machine());
231            break;
232         case VIDEO_MODE_GDI:
233            error = renderer_gdi::init(machine());
234            break;
235         case VIDEO_MODE_BGFX:
236            error = renderer_bgfx::init(machine());
237            break;
238#if (USE_OPENGL)
239         case VIDEO_MODE_OPENGL:
240            error = renderer_ogl::init(machine());
241            break;
242#endif
243         case VIDEO_MODE_SDL2ACCEL:
244            fatalerror("SDL2-Accel renderer unavailable on Windows OSD.");
245            break;
246         case VIDEO_MODE_D3D:
247            error = renderer_d3d9::init(machine());
248            break;
249         case VIDEO_MODE_SOFT:
250            fatalerror("SDL1 renderer unavailable on Windows OSD.");
251            break;
252         default:
253            fatalerror("Unknown video mode.");
254            break;
255      }
256      if (error)
257      {
258         current_mode = fallbacks[current_mode];
259      }
260      else
261      {
262         break;
263      }
264   }
265   video_config.mode = current_mode;
266
199267   // set up the window list
200268   last_window_ptr = &win_window_list;
201269
202270   return true;
203271}
204272
273void windows_osd_interface::update_slider_list()
274{
275   for (win_window_info *window = win_window_list; window != nullptr; window = window->m_next)
276   {
277      if (window->m_renderer->sliders_dirty())
278      {
279         build_slider_list();
280         return;
281      }
282   }
283}
205284
285void windows_osd_interface::build_slider_list()
286{
287   m_sliders = nullptr;
288   slider_state *curr = m_sliders;
289   for (win_window_info *info = win_window_list; info != nullptr; info = info->m_next)
290   {
291      slider_state *window_sliders = info->m_renderer->get_slider_list();
292      if (window_sliders != nullptr)
293      {
294         if (m_sliders == nullptr)
295         {
296            m_sliders = curr = window_sliders;
297         }
298         else
299         {
300            while (curr->next != nullptr)
301            {
302               curr = curr->next;
303            }
304            curr->next = window_sliders;
305         }
306      }
307   }
308}
206309
207310//============================================================
208311//  winwindow_exit
r253579r253580
300403
301404static BOOL is_mame_window(HWND hwnd)
302405{
303   win_window_info *window;
304
305   for (window = win_window_list; window != nullptr; window = window->m_next)
406   for (win_window_info *window = win_window_list; window != nullptr; window = window->m_next)
306407      if (window->m_hwnd == hwnd)
307408         return TRUE;
308409
r253579r253580
609710
610711   // allocate a new window object
611712   win_window_info *window = global_alloc(win_window_info(machine));
612   //printf("%d, %d\n", config->width, config->height);
613713   window->m_win_config = *config;
614714   window->m_monitor = monitor;
615715   window->m_fullscreen = !video_config.windowed;
616716   window->m_index = index;
617   window->m_renderer = reinterpret_cast<osd_renderer *>(osd_renderer::make_for_type(video_config.mode, reinterpret_cast<osd_window *>(window)));
618   window->m_renderer->init(machine);
619717
620718   // set main window
621719   if (index > 0)
r253579r253580
10191117   return rect_height(&temprect) - 100;
10201118}
10211119
1022
1023
10241120//============================================================
10251121//  thread_entry
10261122//  (window thread)
r253579r253580
11851281   if (!m_fullscreen || m_fullscreen_safe)
11861282   {
11871283      // finish off by trying to initialize DirectX; if we fail, ignore it
1284      if (m_renderer != nullptr)
1285      {
1286         global_free(m_renderer);
1287      }
1288      m_renderer = osd_renderer::make_for_type(video_config.mode, reinterpret_cast<osd_window *>(this));
11881289      if (m_renderer->create())
11891290         return 1;
1291
11901292      ShowWindow(m_hwnd, SW_SHOW);
11911293   }
11921294
r253579r253580
18921994   {
18931995      if (video_config.mode != VIDEO_MODE_NONE)
18941996         ShowWindow(m_hwnd, SW_SHOW);
1895      osd_renderer *renderer = reinterpret_cast<osd_renderer *>(osd_renderer::make_for_type(video_config.mode, reinterpret_cast<osd_window *>(this)));
1896      renderer->init(machine());
1897      m_renderer = renderer;
1997
1998      if (m_renderer != nullptr)
1999      {
2000         delete m_renderer;
2001      }
2002      m_renderer = reinterpret_cast<osd_renderer *>(osd_renderer::make_for_type(video_config.mode, reinterpret_cast<osd_window *>(this)));
18982003      if (m_renderer->create())
18992004         exit(1);
19002005   }
trunk/src/osd/windows/winmain.h
r253579r253580
275275
276276private:
277277   virtual void osd_exit() override;
278   windows_options &m_options;
279   slider_state *m_sliders;
278   void build_slider_list();
279   void update_slider_list();
280280
281   windows_options &   m_options;
282   slider_state *      m_sliders;
283
281284   static const int DEFAULT_FONT_HEIGHT = 200;
282285};
283286


Previous 199869 Revisions Next


© 1997-2024 The MAME Team