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
6
namespace
yaze
{
7
namespace
app {
8
namespace
core {
9
13
struct
SDL_Deleter
{
14
void
operator()
(SDL_Window *p)
const
{ SDL_DestroyWindow(p); }
15
void
operator()
(SDL_Renderer *p)
const
{ SDL_DestroyRenderer(p); }
16
};
17
21
struct
SDL_Texture_Deleter
{
22
void
operator()
(SDL_Texture *p)
const
{
23
if
(p ==
nullptr
) SDL_DestroyTexture(p);
24
}
25
};
26
30
struct
SDL_Surface_Deleter
{
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_
yaze
Definition
common.cc:22
yaze::app::core::SDL_Deleter
Deleter for SDL_Window and SDL_Renderer.
Definition
sdl_deleter.h:13
yaze::app::core::SDL_Deleter::operator()
void operator()(SDL_Renderer *p) const
Definition
sdl_deleter.h:15
yaze::app::core::SDL_Deleter::operator()
void operator()(SDL_Window *p) const
Definition
sdl_deleter.h:14
yaze::app::core::SDL_Surface_Deleter
Deleter for SDL_Surface.
Definition
sdl_deleter.h:30
yaze::app::core::SDL_Surface_Deleter::operator()
void operator()(SDL_Surface *p) const
Definition
sdl_deleter.h:31
yaze::app::core::SDL_Texture_Deleter
Deleter for SDL_Texture.
Definition
sdl_deleter.h:21
yaze::app::core::SDL_Texture_Deleter::operator()
void operator()(SDL_Texture *p) const
Definition
sdl_deleter.h:22
src
app
core
utils
sdl_deleter.h
Generated by
1.12.0