trunk/src/osd/sdl/drawogl.c
| r243489 | r243490 | |
| 285 | 285 | texture_info *texture_find(const render_primitive *prim); |
| 286 | 286 | void texture_coord_update(texture_info *texture, const render_primitive *prim, int shaderIdx); |
| 287 | 287 | void texture_mpass_flip(texture_info *texture, int shaderIdx); |
| 288 | | void texture_shader_update(texture_info *texture, int shaderIdx); |
| 288 | void texture_shader_update(texture_info *texture, render_container *container, int shaderIdx); |
| 289 | 289 | texture_info * texture_update(const render_primitive *prim, int shaderIdx); |
| 290 | 290 | void texture_disable(texture_info * texture); |
| 291 | 291 | void texture_all_disable(); |
| r243489 | r243490 | |
| 2852 | 2852 | } |
| 2853 | 2853 | } |
| 2854 | 2854 | |
| 2855 | | void sdl_info_ogl::texture_shader_update(texture_info *texture, int shaderIdx) |
| 2855 | void sdl_info_ogl::texture_shader_update(texture_info *texture, render_container *container, int shaderIdx) |
| 2856 | 2856 | { |
| 2857 | | int uniform_location, scrnum; |
| 2858 | | render_container *container; |
| 2857 | int uniform_location; |
| 2859 | 2858 | GLfloat vid_attributes[4]; |
| 2860 | 2859 | |
| 2861 | | scrnum = 0; |
| 2862 | | container = (render_container *)NULL; |
| 2863 | | screen_device_iterator iter(window().machine().root_device()); |
| 2864 | | for (screen_device *screen = iter.first(); screen != NULL; screen = iter.next()) |
| 2865 | | { |
| 2866 | | if (scrnum == window().m_start_viewscreen) |
| 2867 | | { |
| 2868 | | container = &screen->container(); |
| 2869 | | } |
| 2870 | | |
| 2871 | | scrnum++; |
| 2872 | | } |
| 2873 | | |
| 2874 | 2860 | if (container!=NULL) |
| 2875 | 2861 | { |
| 2876 | 2862 | render_container::user_settings settings; |
| 2877 | 2863 | container->get_user_settings(settings); |
| 2878 | | //FIXME: Intended behaviour |
| 2864 | /* FIXME: the code below is in just for illustration issue on |
| 2865 | * how to set shader variables. gamma, contrast and brightness are |
| 2866 | * handled already by the core |
| 2867 | */ |
| 2879 | 2868 | #if 1 |
| 2880 | 2869 | vid_attributes[0] = window().machine().options().gamma(); |
| 2881 | 2870 | vid_attributes[1] = window().machine().options().contrast(); |
| r243489 | r243490 | |
| 2892 | 2881 | osd_printf_verbose("GLSL: could not set 'vid_attributes' for shader prog idx %d\n", shaderIdx); |
| 2893 | 2882 | } |
| 2894 | 2883 | } |
| 2895 | | else |
| 2896 | | { |
| 2897 | | osd_printf_verbose("GLSL: could not get render container for screen %d\n", window().m_start_viewscreen); |
| 2898 | | } |
| 2899 | 2884 | } |
| 2900 | 2885 | |
| 2901 | 2886 | texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, int shaderIdx) |
| r243489 | r243490 | |
| 2930 | 2915 | { |
| 2931 | 2916 | if ( texture->type == TEXTURE_TYPE_SHADER ) |
| 2932 | 2917 | { |
| 2933 | | texture_shader_update(texture, shaderIdx); |
| 2918 | texture_shader_update(texture, prim->container, shaderIdx); |
| 2934 | 2919 | if ( m_glsl_program_num>1 ) |
| 2935 | 2920 | { |
| 2936 | 2921 | texture_mpass_flip(texture, shaderIdx); |