修改render_target接口,删除无用文件

This commit is contained in:
daiqingshuang 2024-02-19 16:55:48 +08:00
parent 6d7326b5bb
commit 162c660fb9
7 changed files with 8 additions and 10 deletions

@ -70,10 +70,7 @@ GLint to_internal_format(texture_format format) {
return 0;
}
void render_target_opengl::init(int width, int height, texture_format format) {
width_ = width;
height_ = height;
void render_target_opengl::on_init(int width, int height, texture_format format) {
glGenFramebuffers(1, &fbo_);
CHECK_GL_ERRORS
glBindFramebuffer(GL_FRAMEBUFFER, fbo_);

@ -4,7 +4,6 @@
class render_target_opengl : public render_target {
public:
void init(int width, int height, texture_format format) override;
~render_target_opengl() override;
@ -18,6 +17,7 @@ public:
void unlock() override;
protected:
void on_init(int width, int height, texture_format format) override;
void on_resize(int width, int height) override;
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_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) {
if (width_ == width && height_ == height)
@ -34,6 +38,7 @@ public:
std::function<void(std::shared_ptr<render_resource>)> on_resize_callback;
protected:
virtual void on_init(int width, int height, texture_format format) = 0;
virtual void on_resize(int width, int height) = 0;
int width_ = 0;

@ -1 +0,0 @@
#include "shader.h"

@ -1 +0,0 @@
#include "texture.h"