SDL++
C++wrapperfortheSDLlibrary.
|
00001 00021 #ifndef SDL_VIDEO_OVERLAY_H 00022 #define SDL_VIDEO_OVERLAY_H 00023 00024 #include <SDL.h> 00025 00026 #include "sdlpp/misc/Rect.h" 00027 #include "sdlpp/video/Surface.h" 00028 00029 namespace sdl { 00030 namespace video { 00031 using namespace misc; 00032 00037 class Overlay { 00038 public: 00046 Overlay (const Rect& rect, Uint32 format, const Surface& display) 00047 : overlay_ (SDL_CreateYUVOverlay (rect.width (), rect.height (), format, display.to_c ())) {}; 00048 00052 ~Overlay () { SDL_FreeYUVOverlay (overlay_); }; 00053 00059 bool lock () { return SDL_LockYUVOverlay (overlay_) == 0; }; 00060 00064 void unlock () { SDL_UnlockYUVOverlay (overlay_); }; 00065 00073 bool display (Rect& dstRect) { return SDL_DisplayYUVOverlay (overlay_, *dstRect) == 0; }; 00074 00075 private: 00081 Overlay (const Overlay& rhs); 00082 00090 Overlay& operator= (const Overlay& rhs); 00091 00092 private: 00096 SDL_Overlay* overlay_; 00097 }; //Overlay 00098 }; //video 00099 }; //sdl 00100 00101 #endif //SDL_VIDEO_OVERLAY_H 00102