2
0

BsShaderEx.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsScriptEnginePrerequisites.h"
  5. #include "Wrappers/BsScriptResource.h"
  6. #include "Material/BsShader.h"
  7. namespace bs
  8. {
  9. /** @addtogroup ScriptInteropEngine
  10. * @{
  11. */
  12. /** @cond SCRIPT_EXTENSIONS */
  13. /** Type of parameters that can be defined by a shader. */
  14. enum class BS_SCRIPT_EXPORT(m:Rendering) ShaderParameterType
  15. {
  16. Float, Vector2, Vector3, Vector4, Color,
  17. Matrix3, Matrix4, Texture2D,
  18. Texture3D, TextureCube, Sampler
  19. };
  20. /** Contains information about a single shader parameter. */
  21. struct BS_SCRIPT_EXPORT(m:Rendering,pl:true) ShaderParameter
  22. {
  23. /** Name of the parameter variable. */
  24. String name;
  25. /** Data type of the parameter. */
  26. ShaderParameterType type;
  27. /** Determines is parameter managed internally be the renderer, or is it expected to be set by the user. */
  28. bool isInternal;
  29. };
  30. /** Extension class for Shader, for adding additional functionality for the script version of the class. */
  31. class BS_SCRIPT_EXPORT(e:Shader) ShaderEx
  32. {
  33. public:
  34. /** Returns information about all parameters available in the shader. */
  35. BS_SCRIPT_EXPORT(e:Shader,pr:getter,n:Parameters)
  36. static Vector<ShaderParameter> getParameters(const HShader& thisPtr);
  37. };
  38. /** @endcond */
  39. /** @} */
  40. }