diff options
Diffstat (limited to 'servers/visual')
-rw-r--r-- | servers/visual/rasterizer.h | 4 | ||||
-rw-r--r-- | servers/visual/rasterizer_dummy.cpp | 10 | ||||
-rw-r--r-- | servers/visual/rasterizer_dummy.h | 4 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.cpp | 10 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.h | 4 | ||||
-rw-r--r-- | servers/visual/visual_server_wrap_mt.h | 4 |
6 files changed, 36 insertions, 0 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 55625a2218..8731095425 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -187,6 +187,7 @@ public: virtual bool texture_has_alpha(RID p_texture) const=0; virtual void texture_set_size_override(RID p_texture,int p_width, int p_height)=0; + virtual void texture_set_reload_hook(RID p_texture,ObjectID p_owner,const StringName& p_function) const=0; /* SHADER API */ @@ -203,6 +204,9 @@ public: virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const=0; + virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture)=0; + virtual RID shader_get_default_texture_param(RID p_shader, const StringName& p_name) const=0; + /* COMMON MATERIAL API */ virtual RID material_create()=0; diff --git a/servers/visual/rasterizer_dummy.cpp b/servers/visual/rasterizer_dummy.cpp index a671821e25..a399960014 100644 --- a/servers/visual/rasterizer_dummy.cpp +++ b/servers/visual/rasterizer_dummy.cpp @@ -221,6 +221,16 @@ void RasterizerDummy::shader_get_param_list(RID p_shader, List<PropertyInfo> *p_ } + +void RasterizerDummy::shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture) { + +} + +RID RasterizerDummy::shader_get_default_texture_param(RID p_shader, const StringName& p_name) const { + + return RID(); +} + /* COMMON MATERIAL API */ diff --git a/servers/visual/rasterizer_dummy.h b/servers/visual/rasterizer_dummy.h index 44bca423a4..d879fcafeb 100644 --- a/servers/visual/rasterizer_dummy.h +++ b/servers/visual/rasterizer_dummy.h @@ -429,6 +429,10 @@ public: virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const; + + virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture); + virtual RID shader_get_default_texture_param(RID p_shader, const StringName& p_name) const; + /* COMMON MATERIAL API */ virtual RID material_create(); diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index af50b9b592..7cfa6dbb32 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -157,6 +157,16 @@ void VisualServerRaster::shader_get_param_list(RID p_shader, List<PropertyInfo> } +void VisualServerRaster::shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture) { + + rasterizer->shader_set_default_texture_param(p_shader,p_name,p_texture); +} + +RID VisualServerRaster::shader_get_default_texture_param(RID p_shader, const StringName& p_name) const{ + + return rasterizer->shader_get_default_texture_param(p_shader,p_name); +} + /* Material */ diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 3064f9ceb0..ce52077550 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -756,6 +756,10 @@ public: virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const; + virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture); + virtual RID shader_get_default_texture_param(RID p_shader, const StringName& p_name) const; + + /* COMMON MATERIAL API */ virtual RID material_create(); diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index a4653b1013..7d2b8a3767 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -653,6 +653,10 @@ public: FUNC1RC(String,shader_get_light_code,RID); FUNC2SC(shader_get_param_list,RID,List<PropertyInfo>*); + FUNC3(shader_set_default_texture_param,RID,const StringName&,RID); + FUNC2RC(RID,shader_get_default_texture_param,RID,const StringName&); + + /*virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) { if (Thread::get_caller_ID()!=server_thread) { command_queue.push_and_sync( visual_server, &VisualServer::shader_get_param_list,p_shader,p_param_list); |