RenderTarget.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef RENDERTARGET_H_
  2. #define RENDERTARGET_H_
  3. #include "Base.h"
  4. #include "Texture.h"
  5. namespace gameplay
  6. {
  7. class RenderTarget : public Ref
  8. {
  9. public:
  10. /**
  11. * Create a RenderTarget and add it to the list of available RenderTargets.
  12. *
  13. * The created RenderTarget contains a 32-bit texture with a single/base mipmap level only.
  14. *
  15. * @param id The ID of the new RenderTarget.
  16. * @param width The width of the new RenderTarget.
  17. * @param height The height of the new RenderTarget.
  18. *
  19. * @return A newly created RenderTarget.
  20. */
  21. static RenderTarget* create(const char* id, unsigned int width, unsigned int height);
  22. /**
  23. * Get a named RenderTarget from its ID.
  24. *
  25. * @param id The ID of the RenderTarget to search for.
  26. *
  27. * @return The RenderTarget with the specified ID, or NULL if one was not found.
  28. */
  29. static RenderTarget* getRenderTarget(const char* id);
  30. /**
  31. * Get the ID of this RenderTarget.
  32. *
  33. * @return The ID of this RenderTarget.
  34. */
  35. const char* getID() const;
  36. /**
  37. * Get the backing texture of this RenderTarget.
  38. *
  39. * @return The backing texture of this RenderTarget.
  40. */
  41. Texture* getTexture() const;
  42. private:
  43. /**
  44. * Constructor.
  45. */
  46. RenderTarget(const char* id);
  47. /**
  48. * Destructor.
  49. */
  50. ~RenderTarget();
  51. std::string _id;
  52. Texture* _texture;
  53. };
  54. }
  55. #endif