00001
00002 #ifndef RC_RENDER_TARGET_H
00003 #define RC_RENDER_TARGET_H
00004
00005
00006
00010 class RenderTarget : public Resource {
00011
00012 friend class SceneGraph;
00013
00014 friend class Renderer;
00015 #ifdef RC_OPENGL
00016 friend class RendererGL;
00017 #endif
00018
00019 friend class Uniform;
00020
00021
00022
00023 private:
00024 RenderTarget(
00025 const char *nidentifier,
00026
00027 u32 nwidth,
00028 u32 nheight,
00029
00030 u32 n_targets,
00031
00032 TextureFilter_t filter,
00033 TextureWrap_t wrap,
00034
00035 bool include_depth_buffer,
00036 bool include_stencil_buffer
00037 );
00038
00039 ~RenderTarget();
00040
00041 public:
00042
00043 Texture *getTexture(
00044 u32 target_index
00045 );
00046
00047 u32 getWidth() { return width; }
00048
00049 u32 getHeight() { return height; }
00050
00051 TextureFormat_t getFormat() { return format; }
00052
00053 void shareDepthBuffer(
00054 RenderTarget *target
00055 );
00056
00057 public:
00058
00059 void *getHandle();
00060
00061 void setHandle(
00062 void *nhandle
00063 );
00064
00065
00066
00067 private:
00068 Texture *textures[RC_MAX_RENDER_TARGET_TEXTURES];
00069 u32 n_textures;
00070
00071 TextureFormat_t format;
00072 u32 width;
00073 u32 height;
00074
00075 void *handle;
00076
00077
00078 };
00079
00080 #endif
00081