diff --git a/example/Vulkan/Atomsphere.cpp b/example/Vulkan/Atomsphere.cpp index 43f504ea..0dc31b33 100644 --- a/example/Vulkan/Atomsphere.cpp +++ b/example/Vulkan/Atomsphere.cpp @@ -87,7 +87,7 @@ private: bool InitPipeline() { - SharedPtr + AutoDelete pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent()); pipeline_creater->SetDepthTest(true); pipeline_creater->SetDepthWrite(true); diff --git a/example/Vulkan/Deferred.cpp b/example/Vulkan/Deferred.cpp index edf4ec12..664bc039 100644 --- a/example/Vulkan/Deferred.cpp +++ b/example/Vulkan/Deferred.cpp @@ -142,7 +142,7 @@ private: bool InitGBufferPipeline(SubpassParam *sp) { - SharedPtr pipeline_creater=new vulkan::PipelineCreater(device,sp->material,gbuffer.renderpass,device->GetExtent()); + AutoDelete pipeline_creater=new vulkan::PipelineCreater(device,sp->material,gbuffer.renderpass,device->GetExtent()); pipeline_creater->SetDepthTest(true); pipeline_creater->SetDepthWrite(true); pipeline_creater->SetCullMode(VK_CULL_MODE_BACK_BIT); @@ -159,7 +159,7 @@ private: bool InitCompositionPipeline(SubpassParam *sp) { - SharedPtr pipeline_creater=new vulkan::PipelineCreater(device,sp->material,device->GetMainRenderPass(),device->GetExtent()); + AutoDelete pipeline_creater=new vulkan::PipelineCreater(device,sp->material,device->GetMainRenderPass(),device->GetExtent()); pipeline_creater->SetDepthTest(false); pipeline_creater->SetDepthWrite(false); pipeline_creater->SetCullMode(VK_CULL_MODE_NONE); diff --git a/example/Vulkan/Geometry2D.cpp b/example/Vulkan/Geometry2D.cpp index 3c0d7dad..6a5e18f2 100644 --- a/example/Vulkan/Geometry2D.cpp +++ b/example/Vulkan/Geometry2D.cpp @@ -114,7 +114,7 @@ private: bool InitPipeline() { - SharedPtr + AutoDelete pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent()); pipeline_creater->SetDepthTest(false); pipeline_creater->SetDepthWrite(false); diff --git a/example/Vulkan/Geometry3D.cpp b/example/Vulkan/Geometry3D.cpp index e6ea5930..6221466f 100644 --- a/example/Vulkan/Geometry3D.cpp +++ b/example/Vulkan/Geometry3D.cpp @@ -84,7 +84,7 @@ private: bool InitPipeline() { - SharedPtr + AutoDelete pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent()); pipeline_creater->SetDepthTest(true); pipeline_creater->SetDepthWrite(true); diff --git a/example/Vulkan/InlineGeometryScene.cpp b/example/Vulkan/InlineGeometryScene.cpp index 5826d3b8..782277fc 100644 --- a/example/Vulkan/InlineGeometryScene.cpp +++ b/example/Vulkan/InlineGeometryScene.cpp @@ -137,7 +137,7 @@ private: bool InitPipeline() { - SharedPtr + AutoDelete pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent()); pipeline_creater->SetDepthTest(true); pipeline_creater->SetDepthWrite(true); diff --git a/example/Vulkan/LoadModel.cpp b/example/Vulkan/LoadModel.cpp index 5fe2cf17..eb9c7978 100644 --- a/example/Vulkan/LoadModel.cpp +++ b/example/Vulkan/LoadModel.cpp @@ -162,7 +162,7 @@ private: bool InitPipeline() { - SharedPtr + AutoDelete pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent()); pipeline_creater->SetDepthTest(false); pipeline_creater->SetDepthWrite(false); diff --git a/example/Vulkan/SceneTree.cpp b/example/Vulkan/SceneTree.cpp index c504f7a2..53ee88bd 100644 --- a/example/Vulkan/SceneTree.cpp +++ b/example/Vulkan/SceneTree.cpp @@ -74,7 +74,7 @@ private: bool InitPipeline() { - SharedPtr + AutoDelete pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent()); pipeline_creater->SetDepthTest(true); pipeline_creater->SetDepthWrite(true); diff --git a/example/Vulkan/indices_rect.cpp b/example/Vulkan/indices_rect.cpp index df04b67a..3a0b97c3 100644 --- a/example/Vulkan/indices_rect.cpp +++ b/example/Vulkan/indices_rect.cpp @@ -103,7 +103,7 @@ private: bool InitPipeline() { - SharedPtr + AutoDelete pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent()); pipeline_creater->SetDepthTest(false); pipeline_creater->SetDepthWrite(false); diff --git a/example/Vulkan/main.cpp b/example/Vulkan/main.cpp index 188f547f..a4961e6b 100644 --- a/example/Vulkan/main.cpp +++ b/example/Vulkan/main.cpp @@ -107,7 +107,7 @@ private: constexpr os_char PIPELINE_FILENAME[]=OS_TEXT("2DSolid.pipeline"); { - SharedPtr + AutoDelete pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent()); pipeline_creater->SetDepthTest(false); pipeline_creater->SetDepthWrite(false); @@ -121,7 +121,7 @@ private: void *data; uint size=filesystem::LoadFileToMemory(PIPELINE_FILENAME,(void **)&data); - SharedPtr pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent(),(uchar *)data,size); + AutoDelete pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent(),(uchar *)data,size); pipeline=pipeline_creater->Create(); } diff --git a/example/Vulkan/texture_rect.cpp b/example/Vulkan/texture_rect.cpp index 3e9ad671..c8bcd2ea 100644 --- a/example/Vulkan/texture_rect.cpp +++ b/example/Vulkan/texture_rect.cpp @@ -148,7 +148,7 @@ private: bool InitPipeline() { - SharedPtr + AutoDelete pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent()); pipeline_creater->SetDepthTest(false); pipeline_creater->SetDepthWrite(false); diff --git a/inc/hgl/type/Smart.h b/inc/hgl/type/Smart.h index dcdec534..85d3ee9e 100644 --- a/inc/hgl/type/Smart.h +++ b/inc/hgl/type/Smart.h @@ -480,6 +480,9 @@ namespace hgl T *operator -> (){return obj;} + operator T *(){return obj;} + operator const T *()const{return obj;} + void Clear() { obj=nullptr;