]> git.tdb.fi Git - libs/gl.git/blobdiff - source/programsyntax.h
Add a module for builtin interface variables
[libs/gl.git] / source / programsyntax.h
index 86cb6b906181e7686d4230dbbe1b6fbeb9cb1556..88f333ac1559d2e662dbaeca7903aecfbdbfa1ed 100644 (file)
@@ -33,6 +33,10 @@ public:
        NodePtr(T *n = 0): node(n) { }
        NodePtr(const NodePtr &p): node(clone(p.node)) { }
        NodePtr &operator=(const NodePtr &p) { delete node; node = clone(p.node); return *this; }
+#if __cplusplus>=201103L
+       NodePtr(NodePtr &&p): node(p.node) { p.node = 0; }
+       NodePtr &operator=(NodePtr &&p) { delete node; node = p.node; p.node = 0; return *this; }
+#endif
        ~NodePtr() { delete node; }
 
 private:
@@ -200,6 +204,8 @@ struct InterfaceBlock: Node
        std::string interface;
        std::string name;
        Block members;
+       std::string instance_name;
+       bool array;
 
        InterfaceBlock();
 
@@ -223,7 +229,7 @@ struct FunctionDeclaration: Node
 
 struct Conditional: Node
 {
-       Expression *condition;
+       NodePtr<Expression> condition;
        Block body;
        Block else_body;
 
@@ -312,7 +318,6 @@ enum StageType
 struct Stage
 {
        StageType type;
-       bool present;
        Stage *previous;
        ProgramSyntax::Block content;
        std::map<std::string, VariableDeclaration *> in_variables;
@@ -324,9 +329,7 @@ struct Stage
 struct Module
 {
        Stage shared;
-       Stage vertex_stage;
-       Stage geometry_stage;
-       Stage fragment_stage;
+       std::list<Stage> stages;
 
        Module();
 };