mirror of
https://github.com/Maschell/libgui-sdl.git
synced 2024-11-16 21:19:19 +01:00
28 lines
542 B
C
28 lines
542 B
C
|
#pragma once
|
||
|
|
||
|
#include <SDL2/SDL_render.h>
|
||
|
|
||
|
class Renderer {
|
||
|
public:
|
||
|
Renderer(SDL_Renderer *renderer, uint32_t pixelFormat) : sdl_renderer(renderer), pixelFormat(pixelFormat){
|
||
|
|
||
|
}
|
||
|
|
||
|
virtual ~Renderer() {
|
||
|
if(sdl_renderer){
|
||
|
SDL_DestroyRenderer(sdl_renderer);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
SDL_Renderer *getRenderer(){
|
||
|
return sdl_renderer;
|
||
|
}
|
||
|
|
||
|
uint32_t getPixelFormat(){
|
||
|
return pixelFormat;
|
||
|
}
|
||
|
|
||
|
private:
|
||
|
SDL_Renderer *sdl_renderer = NULL;
|
||
|
uint32_t pixelFormat = SDL_PIXELFORMAT_RGBA8888;
|
||
|
};
|