yaze 0.2.2
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 core {
8
13 void operator()(SDL_Window* p) const { SDL_DestroyWindow(p); }
14 void operator()(SDL_Renderer* p) const { SDL_DestroyRenderer(p); }
15};
16
17// Custom deleter for SDL_Surface
19 void operator()(SDL_Surface* p) const {
20 if (p) {
21 SDL_FreeSurface(p);
22 }
23 }
24};
25
26// Custom deleter for SDL_Texture
28 void operator()(SDL_Texture* p) const {
29 if (p) {
30 SDL_DestroyTexture(p);
31 }
32 }
33};
34
35} // namespace core
36} // namespace yaze
37
38#endif // YAZE_APP_CORE_UTILS_SDL_DELETER_H_
Main namespace for the application.
Definition controller.cc:18
Deleter for SDL_Window and SDL_Renderer.
Definition sdl_deleter.h:12
void operator()(SDL_Renderer *p) const
Definition sdl_deleter.h:14
void operator()(SDL_Window *p) const
Definition sdl_deleter.h:13
void operator()(SDL_Surface *p) const
Definition sdl_deleter.h:19
void operator()(SDL_Texture *p) const
Definition sdl_deleter.h:28