Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
RoboGuide
scigl_render
Commits
01ce25bd
Commit
01ce25bd
authored
Nov 01, 2019
by
Tim Übelhör
Browse files
Fixed pendantic warnings
parent
e503b4c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/example/depth_offscreen_render.cpp
View file @
01ce25bd
#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
);
...
...
@@ -73,4 +65,4 @@ void DepthOffscreenRender::display_data(const void *data)
// update
glfwSwapBuffers
(
gl_context
->
get_window
());
}
}
// namespace scigl_render
\ No newline at end of file
}
// namespace scigl_render
\ No newline at end of file
src/render/rasterizer.cpp
View file @
01ce25bd
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment