yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
sdl_deleter.h
Go to the documentation of this file.
1#ifndef YAZE_APP_CORE_UTILS_SDL_DELETER_H_
2#define YAZE_APP_CORE_UTILS_SDL_DELETER_H_
3
4#include <SDL.h>
5
6namespace yaze {
7namespace app {
8namespace core {
9
14 void operator()(SDL_Window *p) const { SDL_DestroyWindow(p); }
15 void operator()(SDL_Renderer *p) const { SDL_DestroyRenderer(p); }
16};
17
22 void operator()(SDL_Texture *p) const {
23 if (p == nullptr) SDL_DestroyTexture(p);
24 }
25};
26
31 void operator()(SDL_Surface *p) const {
32 // Check if the surface is not null
33 if (p == nullptr) SDL_FreeSurface(p);
34 }
35};
36
37} // namespace core
38} // namespace app
39} // namespace yaze
40
41#endif // YAZE_APP_CORE_UTILS_SDL_DELETER_H_
Definition common.cc:21
Deleter for SDL_Window and SDL_Renderer.
Definition sdl_deleter.h:13
void operator()(SDL_Renderer *p) const
Definition sdl_deleter.h:15
void operator()(SDL_Window *p) const
Definition sdl_deleter.h:14
Deleter for SDL_Surface.
Definition sdl_deleter.h:30
void operator()(SDL_Surface *p) const
Definition sdl_deleter.h:31
Deleter for SDL_Texture.
Definition sdl_deleter.h:21
void operator()(SDL_Texture *p) const
Definition sdl_deleter.h:22