]> git.tdb.fi Git - libs/gl.git/blobdiff - source/renderpass.cpp
Update .gitignore
[libs/gl.git] / source / renderpass.cpp
index b95bd4bcfe1977c9ce327c0e5189883efd97800a..fc2d37ed1a72d6a6a46335f50b46db09bd96bd6a 100644 (file)
@@ -1,13 +1,6 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007-2008, 2010-2011  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#include <msp/core/refptr.h>
 #include <msp/datafile/collection.h>
-#include <msp/strings/formatter.h>
+#include <msp/strings/format.h>
+#include "error.h"
 #include "material.h"
 #include "renderpass.h"
 #include "program.h"
@@ -80,8 +73,6 @@ RenderPass::Loader::Loader(RenderPass &p, Collection &c):
 
 void RenderPass::Loader::init()
 {
-       allow_pointer_reload = false;
-
        add("shader",   &RenderPass::shprog);
        add("material", &Loader::material_inline);
        add("material", &Loader::material);
@@ -99,7 +90,7 @@ void RenderPass::Loader::material_inline()
 
 void RenderPass::Loader::material(const string &name)
 {
-       obj.material = get_collection().get<Material>(name);
+       obj.material = &get_collection().get<Material>(name);
        obj.material.keep();
 }
 
@@ -120,7 +111,7 @@ void RenderPass::Loader::texunit_named(unsigned i, const string &n)
 void RenderPass::Loader::uniforms()
 {
        if(!obj.shprog)
-               throw InvalidState("Can't load uniforms without a shader program");
+               throw invalid_operation("RenderPass::Loader::uniforms");
        if(!obj.shdata)
                obj.shdata = new ProgramData(*obj.shprog);
        load_sub(*obj.shdata);
@@ -150,14 +141,14 @@ void RenderPass::TextureLoader::finish()
 
 void RenderPass::TextureLoader::texenv()
 {
-       throw Exception("TexEnvs can't be loaded yet");
+       throw runtime_error("TexEnvs can't be loaded yet");
        /*env = new TexEnv;
        load_sub(*env);*/
 }
 
 void RenderPass::TextureLoader::texture(const string &name)
 {
-       tex = get_collection().get<Texture>(name);
+       tex = &get_collection().get<Texture>(name);
        tex.keep();
 }