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
6
namespace
yaze
{
7
namespace
core
{
8
12
struct
SDL_Deleter
{
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
18
struct
SDL_Surface_Deleter
{
19
void
operator()
(SDL_Surface* p)
const
{
20
if
(p) {
21
SDL_FreeSurface(p);
22
}
23
}
24
};
25
26
// Custom deleter for SDL_Texture
27
struct
SDL_Texture_Deleter
{
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_
yaze::core
Definition
controller.cc:19
yaze
Main namespace for the application.
Definition
controller.cc:18
yaze::core::SDL_Deleter
Deleter for SDL_Window and SDL_Renderer.
Definition
sdl_deleter.h:12
yaze::core::SDL_Deleter::operator()
void operator()(SDL_Renderer *p) const
Definition
sdl_deleter.h:14
yaze::core::SDL_Deleter::operator()
void operator()(SDL_Window *p) const
Definition
sdl_deleter.h:13
yaze::core::SDL_Surface_Deleter
Definition
sdl_deleter.h:18
yaze::core::SDL_Surface_Deleter::operator()
void operator()(SDL_Surface *p) const
Definition
sdl_deleter.h:19
yaze::core::SDL_Texture_Deleter
Definition
sdl_deleter.h:27
yaze::core::SDL_Texture_Deleter::operator()
void operator()(SDL_Texture *p) const
Definition
sdl_deleter.h:28
src
app
core
platform
sdl_deleter.h
Generated by
1.13.2