Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 #ifndef RVE_RENDER_CLIENT_SCREEN_RECT_H
00031 #define RVE_RENDER_CLIENT_SCREEN_RECT_H
00032 
00033 #include "forwards.h"
00034 #include "color.h"
00035 
00036 #include <rve_common/uuid.h>
00037 
00038 namespace rve_interfaces
00039 {
00040 class ScreenRectProxy;
00041 }
00042 
00043 namespace rve_render_client
00044 {
00045 
00046 struct Rect
00047 {
00048   Rect() {}
00049   Rect(float x0, float y0, float x1, float y1)
00050   : x0(x0)
00051   , y0(y0)
00052   , x1(x1)
00053   , y1(y1)
00054   {}
00055 
00056   float x0;
00057   float y0;
00058   float x1;
00059   float y1;
00060 };
00061 
00062 class ScreenRect
00063 {
00064 public:
00065   const rve_common::UUID& getID() { return id_; }
00066 
00067   void setZOrder(uint32_t zorder);
00068   uint32_t getZOrder() { return zorder_; }
00069 
00070   void setCorners(float x0, float y0, float x1, float y1);
00071   const Rect& getCorners() { return rect_; }
00072 
00073   void setTexture(const TexturePtr& tex);
00074   void setTexture(const std::string& resource_path);
00075   void setColor(Color c);
00076   void setOpacity(float opacity);
00077 
00078 private:
00079   ScreenRect(const rve_common::UUID& render_target_id, uint32_t zorder, float x0, float y0, float x1, float y1);
00080   ~ScreenRect();
00081 
00082   void create(ClientContext* context);
00083   void destroy(ClientContext* context);
00084 
00085   rve_interfaces::ScreenRectProxy* getProxy();
00086 
00087   rve_common::UUID id_;
00088   rve_common::UUID render_target_id_;
00089 
00090   uint32_t zorder_;
00091   Rect rect_;
00092 
00093   ClientContext* context_;
00094   InterfaceHandle proxy_handle_;
00095 
00096   Color color_;
00097   TexturePtr texture_;
00098   std::string texture_resource_;
00099   float opacity_;
00100 
00101   friend class RenderTarget;
00102 };
00103 
00104 }
00105 
00106 #endif // RVE_RENDER_CLIENT_SCREEN_RECT_H