BsGLSLProgramFactory.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. #include "BsGLSLProgramFactory.h"
  2. #include "BsGLSLGpuProgram.h"
  3. namespace BansheeEngine
  4. {
  5. const String GLSLProgramFactory::LANGUAGE_NAME = "glsl";
  6. const String& GLSLProgramFactory::getLanguage() const
  7. {
  8. return LANGUAGE_NAME;
  9. }
  10. SPtr<GpuProgramCore> GLSLProgramFactory::create(const String& source, const String& entryPoint,
  11. GpuProgramType gptype, GpuProgramProfile profile, bool requireAdjacency)
  12. {
  13. GLSLGpuProgramCore* prog = new (bs_alloc<GLSLGpuProgramCore>()) GLSLGpuProgramCore(source, entryPoint, gptype, profile, requireAdjacency);
  14. SPtr<GLSLGpuProgramCore> gpuProg = bs_shared_ptr<GLSLGpuProgramCore>(prog);
  15. gpuProg->_setThisPtr(gpuProg);
  16. return gpuProg;
  17. }
  18. SPtr<GpuProgramCore> GLSLProgramFactory::create(GpuProgramType type)
  19. {
  20. GLSLGpuProgramCore* prog = new (bs_alloc<GLSLGpuProgramCore>()) GLSLGpuProgramCore("", "", type, GPP_NONE, false);
  21. SPtr<GLSLGpuProgramCore> gpuProg = bs_shared_ptr<GLSLGpuProgramCore>(prog);
  22. gpuProg->_setThisPtr(gpuProg);
  23. return gpuProg;
  24. }
  25. }