1#include "GPGPUQuadRenderer.h"
3#include "Rendering/IBuffers.h"
4#include "Rendering/IGraphicsDevice.h"
5#include "Rendering/IRenderTargets.h"
6#include "Rendering/ITextures.h"
8void Cogs::GPGPUQuadRenderer::initialize(IGraphicsDevice* device)
11 float vertexData[] = {
21 VertexElement elements[] = {
25 format = device->getBuffers()->createVertexFormat(elements, 2);
26 quadVertexBuffer = device->getBuffers()->loadVertexBuffer(vertexData, 6, format);
29 solidDepthStencilState = device->getRenderTargets()->loadDepthStencilState(depthStencilState);
34 solidRasterizerState = device->getRenderTargets()->loadRasterizerState(solid);
46void Cogs::GPGPUQuadRenderer::bind(IContext* context)
48 const uint32_t strides[] = { 4 *
sizeof(float) };
49 context->setVertexBuffers(&quadVertexBuffer, 1, strides,
nullptr);
50 context->setBlendState(solidBlendState);
51 context->setDepthStencilState(solidDepthStencilState);
52 context->setRasterizerState(solidRasterizerState);
@ VertexData
Per vertex data.
@ Position
Position semantic.
@ TextureCoordinate
Texture coordinate semantic.
static BlendState DefaultState()
Creates a blend state object initialized with the default settings.
@ Back
Cull back facing primitives.
@ Wrap
Texture coordinates automatically wrap around to [0, 1] range.
@ MinMagMipPoint
Point sampling for both minification and magnification.