26 lines
676 B
C++
26 lines
676 B
C++
#pragma once
|
|
#include <SDL_video.h>
|
|
|
|
class render_target;
|
|
class texture;
|
|
|
|
class renderer
|
|
{
|
|
public:
|
|
virtual ~renderer() = default;
|
|
virtual bool init(SDL_Window* window_handle) = 0;
|
|
virtual void shutdown() = 0;
|
|
|
|
virtual void new_frame() = 0;
|
|
virtual void end_frame() = 0;
|
|
|
|
virtual void resize(int width, int height) = 0;
|
|
virtual texture* create_texture(const unsigned char* data, int width, int height) = 0;
|
|
virtual render_target* create_render_target(int width, int height, texture_format format) = 0;
|
|
virtual bool compile_shader() = 0;
|
|
|
|
void set_vsync(const bool vsync) { vsync_ = vsync; }
|
|
protected:
|
|
bool vsync_ = true;
|
|
};
|