/* ZVertexParams.hpp Author: James Russell Created: 7/1/2012 Purpose: TODO License: TODO */ #pragma once #ifndef _ZVERTEXPARAMS_HPP #define _ZVERTEXPARAMS_HPP #include #include #include #include #ifndef ZVP_MAX_STREAMS #define ZVP_MAX_STREAMS (128) #endif class ZVertexParams : public ZDrawParams { private: //A binding for a vertex stream struct VertexStreamBinding { ZName Name; //Name of the stream attribute ZPair Binding; //Pair Binding }; //This is the bound vertex buffer and streams ZPtr VertexBuffer; VertexStreamBinding VertexStreams[ZVP_MAX_STREAMS]; //Our current set number of streams size_t CurrentStreamCount; protected: //Does this vertex parameter object need to be updated before rendered with? bool Dirty; public: /* Default Constructor. */ ZVertexParams(); /* public ZVertexParams::ClearStreams Clears the list of currently set streams. @return (void) @context (all) */ void ClearVertexStreams(); /* public ZVertexParams::SetStream Sets a vertex buffer stream. The vertex buffer provided to each call of 'SetVertexStream' must be the same. @param _name - the name of the stream binding @param _vertexBuffer - the vertex buffer to bind streams from @param _stream - the stream definition @return (void) @context (all) */ void SetVertexStream(const ZName& _name, ZPtr _vertexBuffer, const ZDataBufferStream* _stream); /* The following methods are used by the renderer to get the values needed when binding shader parameter values to pass to the shader program, to mark all bound resources as contended, and release contention. */ const ZPair* GetStreamByName(const ZName& _name); ZDataBuffer* GetVertexBuffer(); bool IsDirty() const { return Dirty; } size_t GetStreamCount() const { return CurrentStreamCount; } //Subclass Override virtual void MarkResourcesContended(); //Subclass Override virtual void ReleaseResourceContention(); }; #endif