BsGLSLProgramFactory.cpp 1.0 KB

123456789101112131415161718192021222324252627282930
  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. SPtr<GpuProgram> GLSLProgramFactory::create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask)
  8. {
  9. GLSLGpuProgram* prog = new (bs_alloc<GLSLGpuProgram>()) GLSLGpuProgram(desc, deviceMask);
  10. SPtr<GLSLGpuProgram> gpuProg = bs_shared_ptr<GLSLGpuProgram>(prog);
  11. gpuProg->_setThisPtr(gpuProg);
  12. return gpuProg;
  13. }
  14. SPtr<GpuProgram> GLSLProgramFactory::create(GpuProgramType type, GpuDeviceFlags deviceMask)
  15. {
  16. GPU_PROGRAM_DESC desc;
  17. desc.type = type;
  18. GLSLGpuProgram* prog = new (bs_alloc<GLSLGpuProgram>()) GLSLGpuProgram(desc, deviceMask);
  19. SPtr<GLSLGpuProgram> gpuProg = bs_shared_ptr<GLSLGpuProgram>(prog);
  20. gpuProg->_setThisPtr(gpuProg);
  21. return gpuProg;
  22. }
  23. }}