Skip to content
Snippets Groups Projects
Commit 01ce25bd authored by Tim Übelhör's avatar Tim Übelhör
Browse files

Fixed pendantic warnings

parent e503b4c9
Branches
No related tags found
No related merge requests found
#include <scigl_render/check_gl_error.hpp>
#include <scigl_render/example/depth_offscreen_render.hpp>
namespace scigl_render
{
namespace scigl_render {
// I know there is a lot of configuration but it is intendet to be flexible
DepthOffscreenRender::DepthOffscreenRender(std::shared_ptr<GLContext> context,
std::shared_ptr<Texture2D> texture,
size_t pixel_size)
: rasterizer(context->get_width() / 2, context->get_height() / 2,
2, 2),
image_buffer(context->get_width() * context->get_height() *
pixel_size),
gl_context(context),
fbo_texture(texture)
{
: gl_context(context),
fbo_texture(texture),
rasterizer(context->get_width() / 2, context->get_height() / 2, 2, 2),
image_buffer(context->get_width() * context->get_height() * pixel_size) {
framebuffer = std::make_shared<FrameBuffer>(fbo_texture);
tex_reader.reset(new TextureReader(fbo_texture, pixel_size));
// create second texture to copy the data to
......@@ -25,9 +21,7 @@ DepthOffscreenRender::DepthOffscreenRender(std::shared_ptr<GLContext> context,
void DepthOffscreenRender::next_frame(
std::shared_ptr<DepthSimulator> depth_simulator,
const CartesianPose &model_pose,
const CartesianPose &camera_pose)
{
const CartesianPose &model_pose, const CartesianPose &camera_pose) {
using namespace std::placeholders;
check_gl_error("next frame begin");
// render to cleared fbo
......@@ -35,8 +29,7 @@ void DepthOffscreenRender::next_frame(
framebuffer->activate();
check_gl_error("activated fbo");
// render 4 poses via rasterization
for (int i = 0; i < 4; i++)
{
for (int i = 0; i < 4; i++) {
auto m_pose = model_pose;
m_pose.orientation.x += i * M_PI_2;
rasterizer.activate_view(i);
......@@ -60,8 +53,7 @@ void DepthOffscreenRender::next_frame(
check_gl_error("end synchronous reading");
}
void DepthOffscreenRender::display_data(const void *data)
{
void DepthOffscreenRender::display_data(const void *data) {
// Test copying the data, buffer_size is in bytes
memcpy(image_buffer.data(), data, image_buffer.size());
quad_texture->store_image(data);
......
......@@ -23,7 +23,7 @@ void Rasterizer::activate_view(size_t view) const {
auto position = view_row_column(view);
size_t row = position.first;
size_t column = position.second;
activate_view(position.first, position.second);
activate_view(row, column);
}
void Rasterizer::activate_all() const {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment