Sfoglia il codice sorgente

RenderPath clone now returns a pointer instead of shared ptr, clear backbuffer, choose XMLFile overload on SetRenderPath

Josh Engebretson 10 anni fa
parent
commit
1e08b39b57

+ 2 - 2
Source/Atomic/Graphics/RenderPath.cpp

@@ -264,9 +264,9 @@ RenderPath::~RenderPath()
 {
 }
 
-SharedPtr<RenderPath> RenderPath::Clone()
+RenderPath *RenderPath::Clone()
 {
-    SharedPtr<RenderPath> newRenderPath(new RenderPath());
+    RenderPath* newRenderPath = new RenderPath();
     newRenderPath->renderTargets_ = renderTargets_;
     newRenderPath->commands_ = commands_;
     return newRenderPath;

+ 1 - 1
Source/Atomic/Graphics/RenderPath.h

@@ -194,7 +194,7 @@ public:
     ~RenderPath();
     
     /// Clone the rendering path.
-    SharedPtr<RenderPath> Clone();
+    RenderPath* Clone();
     /// Clear existing data and load from an XML file. Return true if successful.
     bool Load(XMLFile* file);
     /// Append data from an XML file. Return true if successful.

+ 1 - 2
Source/Atomic/Graphics/Renderer.cpp

@@ -674,8 +674,7 @@ void Renderer::Render()
         graphics_->SetStencilTest(false);
         graphics_->ResetRenderTargets();
 
-        // ATOMIC: Do not clear, as this will clear the UI backbuffer
-        //graphics_->Clear(CLEAR_COLOR | CLEAR_DEPTH | CLEAR_STENCIL, defaultZone_->GetFogColor());
+        graphics_->Clear(CLEAR_COLOR | CLEAR_DEPTH | CLEAR_STENCIL, defaultZone_->GetFogColor());
         
         numPrimitives_ = 0;
         numBatches_ = 0;

+ 7 - 6
Source/AtomicJS/JSBind/modules/Graphics.json

@@ -2,15 +2,16 @@
 	"name" : "Graphics",
 	"sources" : ["Graphics"],
 	"includes" : ["<Atomic/Scene/Scene.h>", "<Atomic/Graphics/OcclusionBuffer.h>", "<Atomic/Scene/ValueAnimation.h>"],
-	"classes" : ["Graphics", "Texture", "Texture2D", "Material", "Drawable", 
-				 "Viewport", "Renderer", "Octree", "Zone", "Camera", "Light", "RenderPath",				 
-				 "DebugRenderer", 
-				 "RenderSurface", "Shader", "ShaderPrecache", "ShaderVariation", 
-				 "Pass", "Technique", 
+	"classes" : ["Graphics", "Texture", "Texture2D", "Material", "Drawable",
+				 "Viewport", "Renderer", "Octree", "Zone", "Camera", "Light", "RenderPath",
+				 "DebugRenderer",
+				 "RenderSurface", "Shader", "ShaderPrecache", "ShaderVariation",
+				 "Pass", "Technique",
 				 "Texture3D", "TextureCube", "View"],
 	"overloads" : {
 		"Viewport" : {
-			"Viewport" : ["Context", "Scene", "Camera", "RenderPath"]
+			"Viewport" : ["Context", "Scene", "Camera", "RenderPath"],
+			"SetRenderPath" : ["XMLFile"]
 		},
 		"Camera" : {
 			"SetOrthoSize" : ["float"]