修改render_target接口,删除无用文件
This commit is contained in:
parent
6d7326b5bb
commit
162c660fb9
@ -70,10 +70,7 @@ GLint to_internal_format(texture_format format) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void render_target_opengl::init(int width, int height, texture_format format) {
|
void render_target_opengl::on_init(int width, int height, texture_format format) {
|
||||||
width_ = width;
|
|
||||||
height_ = height;
|
|
||||||
|
|
||||||
glGenFramebuffers(1, &fbo_);
|
glGenFramebuffers(1, &fbo_);
|
||||||
CHECK_GL_ERRORS
|
CHECK_GL_ERRORS
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, fbo_);
|
glBindFramebuffer(GL_FRAMEBUFFER, fbo_);
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
class render_target_opengl : public render_target {
|
class render_target_opengl : public render_target {
|
||||||
public:
|
public:
|
||||||
void init(int width, int height, texture_format format) override;
|
|
||||||
|
|
||||||
~render_target_opengl() override;
|
~render_target_opengl() override;
|
||||||
|
|
||||||
@ -18,6 +17,7 @@ public:
|
|||||||
void unlock() override;
|
void unlock() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void on_init(int width, int height, texture_format format) override;
|
||||||
void on_resize(int width, int height) override;
|
void on_resize(int width, int height) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1 +0,0 @@
|
|||||||
#include "render_resource.h"
|
|
@ -1 +0,0 @@
|
|||||||
#include "render_target.h"
|
|
@ -14,7 +14,11 @@ public:
|
|||||||
[[nodiscard]] int get_height() const override { return height_; }
|
[[nodiscard]] int get_height() const override { return height_; }
|
||||||
[[nodiscard]] int get_width() const override { return width_; }
|
[[nodiscard]] int get_width() const override { return width_; }
|
||||||
|
|
||||||
virtual void init(int width, int height, texture_format format) = 0;
|
void init(const int width, const int height, const texture_format format) {
|
||||||
|
width_ = width;
|
||||||
|
height_ = height;
|
||||||
|
on_init(width, height, format);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void resize(const int width, const int height) {
|
virtual void resize(const int width, const int height) {
|
||||||
if (width_ == width && height_ == height)
|
if (width_ == width && height_ == height)
|
||||||
@ -34,6 +38,7 @@ public:
|
|||||||
std::function<void(std::shared_ptr<render_resource>)> on_resize_callback;
|
std::function<void(std::shared_ptr<render_resource>)> on_resize_callback;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void on_init(int width, int height, texture_format format) = 0;
|
||||||
virtual void on_resize(int width, int height) = 0;
|
virtual void on_resize(int width, int height) = 0;
|
||||||
|
|
||||||
int width_ = 0;
|
int width_ = 0;
|
||||||
|
@ -1 +0,0 @@
|
|||||||
#include "shader.h"
|
|
@ -1 +0,0 @@
|
|||||||
#include "texture.h"
|
|
Loading…
x
Reference in New Issue
Block a user