CustomDX11API.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #include <Shader.h>
  2. #include "CustomDX11API.h"
  3. #include "CustomUIDX11PixelShader.h"
  4. #include "CustomUIDX11VertexShader.h"
  5. using namespace Framework;
  6. CustomDX11API::CustomDX11API()
  7. : DirectX11(),
  8. vertexShaderLightBufferIndex(-1)
  9. {}
  10. Framework::DX11VertexShader* CustomDX11API::initializeVertexShader(unsigned char* byteCode, int size)
  11. {
  12. DX11VertexShader* shader = DirectX11::initializeVertexShader((unsigned char*)CustomUIDX11VertexShader, sizeof(CustomUIDX11VertexShader));
  13. vertexShaderLightBufferIndex = shader->getFirstUninitializedBufferIndex();
  14. shader->erstelleConstBuffer(4, vertexShaderLightBufferIndex);
  15. shader->erstelleConstBuffer(4 * 24, vertexShaderLightBufferIndex + 1);
  16. int count = 0;
  17. shader->füllConstBuffer((char*)&count, vertexShaderLightBufferIndex, 4);
  18. return shader;
  19. }
  20. Framework::DX11PixelShader* CustomDX11API::initializePixelShader(unsigned char* byteCode, int size)
  21. {
  22. DX11PixelShader* shader = DirectX11::initializePixelShader((unsigned char*)CustomUIDX11PixelShader, sizeof(CustomUIDX11PixelShader));
  23. return shader;
  24. }
  25. int CustomDX11API::getVertexShaderLightBufferIndex() const
  26. {
  27. return vertexShaderLightBufferIndex;
  28. }