diff options
author | MarianoGNU <marianognu.easyrpg@gmail.com> | 2015-12-20 18:21:53 -0300 |
---|---|---|
committer | MarianoGNU <marianognu.easyrpg@gmail.com> | 2016-01-15 17:23:19 -0300 |
commit | 1f3d6824c8db30cd5636aaa3978a953bedff4ed8 (patch) | |
tree | 970e602191846d847029fbda46d54e08a02f4da5 /scene/resources/default_theme/default_theme.cpp | |
parent | dc7755ffcd1e275b065d3acfcc7696697097567b (diff) |
Move shaders to default theme and add shader_override related methods to Control class
Diffstat (limited to 'scene/resources/default_theme/default_theme.cpp')
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 842dbb154b..2d6039ca4d 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -80,6 +80,13 @@ static Ref<Texture> make_icon(T p_src) { return texture; } +static Ref<Shader> make_shader(const char*vertex_code,const char*fragment_code,const char*lighting_code) { + Ref<Shader> shader = (memnew( Shader(Shader::MODE_CANVAS_ITEM) )); + shader->set_code(vertex_code, fragment_code, lighting_code); + + return shader; +} + static Ref<Font> make_font(int p_height,int p_ascent, int p_valign, int p_charcount, const int *p_chars,const Ref<Texture> &p_texture) { @@ -768,7 +775,9 @@ void make_default_theme() { t->set_constant("hseparator","ColorPicker", 4); t->set_icon("screen_picker","ColorPicker", make_icon( icon_color_pick_png ) ); - + + t->set_shader("uv_editor", "ColorPicker", make_shader("", uv_editor_shader_code, "")); + t->set_shader("w_editor", "ColorPicker", make_shader("", w_editor_shader_code, "")); // TooltipPanel |