Skip to content

Commit 4893e56

Browse files
committed
store renderer ref in texture_cube
1 parent 83be507 commit 4893e56

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/ruis/render/opengl/factory.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,10 @@ utki::shared_ref<ruis::render::texture_cube> factory::create_texture_cube(
167167
++face;
168168
}
169169

170-
return utki::make_shared<texture_cube>(faces);
170+
return utki::make_shared<texture_cube>(
171+
this->get_renderer(), //
172+
faces
173+
);
171174
}
172175

173176
utki::shared_ref<ruis::render::vertex_buffer> factory::create_vertex_buffer(

src/ruis/render/opengl/texture_cube.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2525

2626
using namespace ruis::render::opengl;
2727

28-
texture_cube::texture_cube(const std::array<cube_face_image, num_cube_faces>& side_images)
28+
texture_cube::texture_cube(
29+
utki::shared_ref<ruis::render::renderer> renderer, //
30+
const std::array<cube_face_image, num_cube_faces>& side_images
31+
) :
32+
ruis::render::texture_cube(std::move(renderer))
2933
{
3034
this->bind(0);
3135

src/ruis/render/opengl/texture_cube.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ class texture_cube :
4141

4242
constexpr static const auto num_cube_faces = 6;
4343

44-
texture_cube(const std::array<cube_face_image, num_cube_faces>& side_images);
44+
texture_cube(
45+
utki::shared_ref<ruis::render::renderer> renderer, //
46+
const std::array<cube_face_image, num_cube_faces>& side_images
47+
);
4548

4649
texture_cube(const texture_cube&) = delete;
4750
texture_cube& operator=(const texture_cube&) = delete;

0 commit comments

Comments
 (0)