| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- #ifndef RENDERTARGET_H_
- #define RENDERTARGET_H_
- #include "Base.h"
- #include "Texture.h"
- namespace gameplay
- {
- /**
- * Represents a linear area of display memory and usually reside
- * in the display memory of the display card.
- */
- class RenderTarget : public Ref
- {
- friend class FrameBuffer;
- public:
-
- /**
- * Create a RenderTarget and add it to the list of available RenderTargets.
- *
- * The created RenderTarget contains a 32-bit texture with a single/base mipmap level only.
- *
- * @param id The ID of the new RenderTarget.
- * @param width The width of the new RenderTarget.
- * @param height The height of the new RenderTarget.
- *
- * @return A newly created RenderTarget.
- * @script{create}
- */
- static RenderTarget* create(const char* id, unsigned int width, unsigned int height);
- /**
- * Create a RenderTarget from the given Texture and add it to the list of
- * available RenderTargets.
- *
- * Note that different hardware and OpenGL versions have different capabilities
- * and restrictions on what texture formats are supported as render targets.
- *
- * @param id The ID of the new RenderTarget.
- * @param texture The texture for the new RenderTarget.
- *
- * @return A newly created RenderTarget.
- * @script{create}
- */
- static RenderTarget* create(const char* id, Texture* texture);
- /**
- * Get a named RenderTarget from its ID.
- *
- * @param id The ID of the RenderTarget to search for.
- *
- * @return The RenderTarget with the specified ID, or NULL if one was not found.
- */
- static RenderTarget* getRenderTarget(const char* id);
- /**
- * Get the ID of this RenderTarget.
- *
- * @return The ID of this RenderTarget.
- */
- const char* getId() const;
- /**
- * Get the backing texture of this RenderTarget.
- *
- * @return The backing texture of this RenderTarget.
- */
- Texture* getTexture() const;
- /**
- * Returns the width of the RenderTarget.
- *
- * @return The width.
- */
- unsigned int getWidth() const;
- /**
- * Returns the height of the RenderTarget.
- *
- * @return The height.
- */
- unsigned int getHeight() const;
-
- private:
- /**
- * Constructor.
- */
- RenderTarget(const char* id);
- /**
- * Destructor.
- */
- ~RenderTarget();
- /**
- * Hidden copy assignment operator.
- */
- RenderTarget& operator=(const RenderTarget&);
- std::string _id;
- Texture* _texture;
- };
- }
- #endif
|