#pragma region CPL License
/*
Nuclex Native Framework
Copyright (C) 2002-2013 Nuclex Development Labs
This library is free software; you can redistribute it and/or
modify it under the terms of the IBM Common Public License as
published by the IBM Corporation; either version 1.0 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
IBM Common Public License for more details.
You should have received a copy of the IBM Common Public
License along with this library
*/
#pragma endregion // CPL License
#ifndef NUCLEX_GRAPHICS_RASTERIZATION_GENERICCONSTANTBUFFER_H
#define NUCLEX_GRAPHICS_RASTERIZATION_GENERICCONSTANTBUFFER_H
#include "Buffer.h"
#include "../VertexElement.h"
namespace Nuclex { namespace Graphics { namespace Rasterization {
// ------------------------------------------------------------------------------------------- //
///Stores constants that are passed to a shader
class GenericConstantBuffer : public Buffer {
/// Initializes a new constant buffer with the specified capacity
/// Number of bytes to reserve for this buffer
protected: NUCLEX_GRAPHICS_API GenericConstantBuffer(std::size_t capacityInBytes) :
Buffer(capacityInBytes) {}
/// Initializes a new constant buffer by copying an existing buffer
/// Existing constant buffer that will be copied
protected: NUCLEX_GRAPHICS_API GenericConstantBuffer(const GenericConstantBuffer &other) :
Buffer(other) {}
/// Frees all resources owned by the instance
public: NUCLEX_GRAPHICS_API virtual ~GenericConstantBuffer() {}
/// Counts the number of elements stored in the constant buffer
/// The number of elements stored in the constant buffer
public: virtual std::size_t CountElements() const = 0;
///
/// Retrieves an array describing the elements stored in the constant buffer
///
/// An array describing the elements stored in the constant buffer
public: virtual const VertexElement *GetElements() const = 0;
/// Copies the contents of another buffer into this buffer
/// Other buffer whose contents will be copied
/// A reference to this buffer
protected: NUCLEX_GRAPHICS_API GenericConstantBuffer &operator =(
const GenericConstantBuffer &other
) {
Buffer::operator=(other);
return *this;
}
};
// ------------------------------------------------------------------------------------------- //
}}} // namespace Nuclex::Graphics::Rasterization
#endif // NUCLEX_GRAPHICS_RASTERIZATION_GENERICCONSTANTBUFFER_H