BsGLSLProgramFactory.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include "GLSL/BsGLSLProgramFactory.h"
  4. #include "GLSL/BsGLSLGpuProgram.h"
  5. namespace bs { namespace ct
  6. {
  7. const String GLSLProgramFactory::LANGUAGE_NAME = "glsl";
  8. const String& GLSLProgramFactory::getLanguage() const
  9. {
  10. return LANGUAGE_NAME;
  11. }
  12. SPtr<GpuProgram> GLSLProgramFactory::create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask)
  13. {
  14. GLSLGpuProgram* prog = new (bs_alloc<GLSLGpuProgram>()) GLSLGpuProgram(desc, deviceMask);
  15. SPtr<GLSLGpuProgram> gpuProg = bs_shared_ptr<GLSLGpuProgram>(prog);
  16. gpuProg->_setThisPtr(gpuProg);
  17. return gpuProg;
  18. }
  19. SPtr<GpuProgram> GLSLProgramFactory::create(GpuProgramType type, GpuDeviceFlags deviceMask)
  20. {
  21. GPU_PROGRAM_DESC desc;
  22. desc.type = type;
  23. GLSLGpuProgram* prog = new (bs_alloc<GLSLGpuProgram>()) GLSLGpuProgram(desc, deviceMask);
  24. SPtr<GLSLGpuProgram> gpuProg = bs_shared_ptr<GLSLGpuProgram>(prog);
  25. gpuProg->_setThisPtr(gpuProg);
  26. return gpuProg;
  27. }
  28. }}