24 #include "../../Exception.h" 28 #if defined(_WIN32) && defined(HR_ENGINE_SHARED) 30 # define MR_DllDeclare __declspec( dllexport ) 32 # define MR_DllDeclare __declspec( dllimport ) 35 # define MR_DllDeclare 66 if (surface) SDL_FreeSurface(surface);
90 SDL_UpdateTexture(texture,
nullptr,
91 surface->pixels, surface->pitch);
112 if (SDL_MUSTLOCK(surface)) SDL_LockSurface(surface);
114 retv =
static_cast<bool>(fn(surface));
117 if (SDL_MUSTLOCK(surface)) SDL_UnlockSurface(surface);
120 if (SDL_MUSTLOCK(surface)) SDL_UnlockSurface(surface);
142 SUPER(msg + sdlError) { }
DynamicTextureExn(const std::string &msg, const std::string &sdlError)
Definition: SdlDynamicTexture.h:141
virtual ~DynamicTextureExn() noexcept
Definition: SdlDynamicTexture.h:143
bool Update()
Updates the texture from the backing surface.
Definition: SdlDynamicTexture.h:87
#define MR_DllDeclare
Definition: SdlDynamicTexture.h:35
Thrown when the dynamic texture could not be created.
Definition: SdlDynamicTexture.h:133
void Update(Fn fn)
Updates the texture with new pixel data.
Definition: SdlDynamicTexture.h:107
SDL_Surface * surface
Definition: SdlDynamicTexture.h:125
Wrapper for an SDL texture that can be updated.
Definition: SdlDynamicTexture.h:54
virtual ~SdlDynamicTexture()
Definition: SdlDynamicTexture.h:64
bool dirty
Definition: SdlDynamicTexture.h:126
DynamicTextureExn(const char *msg)
Definition: SdlDynamicTexture.h:140
std::exception SUPER
Definition: Exception.h:44
Wrapper for SDL_Texture.
Definition: SdlTexture.h:54
Definition: Announcement.h:24
Base exception, providing constructors for setting the message.
Definition: Exception.h:42
DynamicTextureExn()
Definition: SdlDynamicTexture.h:138
DynamicTextureExn(const std::string &msg)
Definition: SdlDynamicTexture.h:139
bool IsDirty() const
Check if this texture has changes that haven't been updated yet.
Definition: SdlDynamicTexture.h:79
SDL-based software rendering.
Definition: SdlDisplay.h:60