CathodeRetro::IConstantBuffer

This is one of the interfaces that the user code needs to implement in order to use the CathodeRetro class. See Implementing the Required Interfaces for details.

This interface represents a texture that can be used as an input to IGraphicsDevice::RenderQuad.

Index

Interface Method

Helper Method

Interface Method

Update
                void Update(
                  const void *data, 
                  size_t dataByteCount)
              
Description

Copy the given bytes into the constant buffer for GPU use.

This may be called multiple times during rendering, and will only be called between calls to IGraphicsDevice::BeginRendering and IGraphicsDevice::EndRendering.

Every time this is called, the previous data in this constant buffer is no longer required, so if your API has discard semantics (or requires you to allocate a new buffer from a pool per update) you have a lot of leeway in how to implement this.

Parameters
data

Type: const void *

The source buffer from which the bytes will be copied.

dataByteCount

Type: size_t

The number of bytes to copy into the constant buffer.

Must not exceed the size of the constant buffer.

Helper Method

Update<T>
                template <typename T>
                void Update(
                  const T &data)
              
Description

Helper function to copy the bytes from the given object into the constant buffer for GPU use.

This calls directly into Update, and the same stated restrictions on when that function will be called apply to this function as well.

Parameters
data

Type: const typename T &

The object to copy into the data buffer.

The size of the object must not exceed the size of the constant buffer.