BsGLSLProgramFactory.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include "BsGLSLProgramFactory.h"
  4. #include "BsGLSLGpuProgram.h"
  5. namespace BansheeEngine
  6. {
  7. const String GLSLProgramFactory::LANGUAGE_NAME = "glsl";
  8. const String& GLSLProgramFactory::getLanguage() const
  9. {
  10. return LANGUAGE_NAME;
  11. }
  12. SPtr<GpuProgramCore> GLSLProgramFactory::create(const String& source, const String& entryPoint,
  13. GpuProgramType gptype, GpuProgramProfile profile, bool requireAdjacency)
  14. {
  15. GLSLGpuProgramCore* prog = new (bs_alloc<GLSLGpuProgramCore>()) GLSLGpuProgramCore(source, entryPoint, gptype, profile, requireAdjacency);
  16. SPtr<GLSLGpuProgramCore> gpuProg = bs_shared_ptr<GLSLGpuProgramCore>(prog);
  17. gpuProg->_setThisPtr(gpuProg);
  18. return gpuProg;
  19. }
  20. SPtr<GpuProgramCore> GLSLProgramFactory::create(GpuProgramType type)
  21. {
  22. GLSLGpuProgramCore* prog = new (bs_alloc<GLSLGpuProgramCore>()) GLSLGpuProgramCore("", "", type, GPP_NONE, false);
  23. SPtr<GLSLGpuProgramCore> gpuProg = bs_shared_ptr<GLSLGpuProgramCore>(prog);
  24. gpuProg->_setThisPtr(gpuProg);
  25. return gpuProg;
  26. }
  27. }