BsScriptTexture.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 "BsScriptResource.h"
  6. #include "BsPixelData.h"
  7. #include "BsTexture.h"
  8. namespace bs
  9. {
  10. /** @addtogroup ScriptInteropEngine
  11. * @{
  12. */
  13. /** Interop class between C++ & CLR for Texture. */
  14. class BS_SCR_BE_EXPORT ScriptTexture : public TScriptResource <ScriptTexture, Texture>
  15. {
  16. public:
  17. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "Texture")
  18. /** Creates an empty, uninitialized managed instance of the resource interop object. */
  19. static MonoObject* createInstance();
  20. private:
  21. friend class ScriptResourceManager;
  22. ScriptTexture(MonoObject* instance, const HTexture& texture);
  23. /************************************************************************/
  24. /* CLR HOOKS */
  25. /************************************************************************/
  26. static void internal_createInstance(MonoObject* instance, PixelFormat format, UINT32 width,
  27. UINT32 height, UINT32 depth, TextureType texType, TextureUsage usage, UINT32 numSamples, bool hasMipmaps,
  28. bool gammaCorrection);
  29. static void internal_getPixelFormat(ScriptTexture* thisPtr, PixelFormat* value);
  30. static void internal_getUsage(ScriptTexture* thisPtr, TextureUsage* value);
  31. static void internal_getWidth(ScriptTexture* thisPtr, int* value);
  32. static void internal_getHeight(ScriptTexture* thisPtr, int* value);
  33. static void internal_getGammaCorrection(ScriptTexture* thisPtr, bool* value);
  34. static void internal_getSampleCount(ScriptTexture* thisPtr, int* value);
  35. static void internal_getMipmapCount(ScriptTexture* thisPtr, int* value);
  36. static MonoObject* internal_getPixels(ScriptTexture* thisPtr, UINT32 face, UINT32 mipLevel);
  37. static MonoObject* internal_getGPUPixels(ScriptTexture* thisPtr, UINT32 face, UINT32 mipLevel);
  38. static void internal_setPixels(ScriptTexture* thisPtr, MonoObject* data, UINT32 face, UINT32 mipLevel);
  39. static void internal_setPixelsArray(ScriptTexture* thisPtr, MonoArray* colors, UINT32 face, UINT32 mipLevel);
  40. };
  41. /** @} */
  42. }