port from perforce
This commit is contained in:
53
aiwaz/Aiwaz/Interfaces/IRenderCommandNode.h
Normal file
53
aiwaz/Aiwaz/Interfaces/IRenderCommandNode.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#pragma once
|
||||
|
||||
#include "ICommandUser.h"
|
||||
|
||||
struct __declspec(novtable) IRenderCommandNode
|
||||
{
|
||||
virtual ~IRenderCommandNode() {}
|
||||
|
||||
virtual const std::vector<ICommandUser*> get_CommandUsers() const = 0;
|
||||
|
||||
virtual void set_Parent(IRenderCommandNode* ar_Node_) = 0;
|
||||
virtual IRenderCommandNode* get_Parent() const = 0;
|
||||
|
||||
virtual bool IsDirty() const = 0;
|
||||
virtual void MarkDirty() = 0;
|
||||
|
||||
virtual void AddCommandUser(ICommandUser& argCommandUser) = 0;
|
||||
virtual void RemoveCommandUser(ICommandUser& argCommandUser) = 0;
|
||||
virtual void ReplaceCommandUser(ICommandUser& argWhatCommandUser, ICommandUser& argWhithCommandUser) = 0;
|
||||
|
||||
virtual void ProcessCommands() = 0;
|
||||
};
|
||||
|
||||
struct ICommandBuffer;
|
||||
struct __declspec(novtable) IRenderCommandNodeInternal
|
||||
{
|
||||
virtual ~IRenderCommandNodeInternal() {}
|
||||
|
||||
virtual void GenerateDeviceCommands() = 0;
|
||||
virtual ICommandBuffer* get_CommandBuffer() const = 0;
|
||||
};
|
||||
|
||||
|
||||
// Helper functions
|
||||
template<typename T> void AddToNode(IRenderCommandNode& commandNode, T& commandUser)
|
||||
{
|
||||
commandNode.AddCommandUser(dynamic_cast<ICommandUser&>(commandUser));
|
||||
}
|
||||
|
||||
template<typename T> void AddToNode(IRenderCommandNode& commandNode, T* commandUser)
|
||||
{
|
||||
commandNode.AddCommandUser(dynamic_cast<ICommandUser&>(*commandUser));
|
||||
}
|
||||
|
||||
template<typename T> void RemoveFromNode(IRenderCommandNode& commandNode, T& commandUser)
|
||||
{
|
||||
commandNode.RemoveCommandUser(dynamic_cast<ICommandUser&>(commandUser));
|
||||
}
|
||||
|
||||
template<typename T> void RemoveFromNode(IRenderCommandNode& commandNode, T* commandUser)
|
||||
{
|
||||
commandNode.RemoveCommandUser(dynamic_cast<ICommandUser&>(*commandUser));
|
||||
}
|
||||
Reference in New Issue
Block a user