26
26
#include < geomTriangles.h>
27
27
#include < omniBoundingVolume.h>
28
28
#include < orthographicLens.h>
29
+ #include < graphicsOutput.h>
29
30
30
31
namespace rpcore {
31
32
32
- PostProcessRegion* PostProcessRegion::make (GraphicsOutput* internal_buffer)
33
+ std::unique_ptr< PostProcessRegion> PostProcessRegion::make (GraphicsOutput* internal_buffer)
33
34
{
34
- return new PostProcessRegion (internal_buffer);
35
+ return std::make_unique< PostProcessRegion> (internal_buffer);
35
36
}
36
37
37
- PostProcessRegion* PostProcessRegion::make (GraphicsOutput* internal_buffer, const LVecBase4f& dimensions)
38
+ std::unique_ptr< PostProcessRegion> PostProcessRegion::make (GraphicsOutput* internal_buffer, const LVecBase4f& dimensions)
38
39
{
39
- return new PostProcessRegion (internal_buffer, dimensions);
40
+ return std::make_unique< PostProcessRegion> (internal_buffer, dimensions);
40
41
}
41
42
42
43
PostProcessRegion::PostProcessRegion (GraphicsOutput* internal_buffer)
43
44
{
44
- _buffer = internal_buffer;
45
- region = _buffer->make_display_region ();
45
+ region_ = internal_buffer->make_display_region ();
46
46
node = NodePath (" RTRoot" );
47
47
48
48
make_fullscreen_tri ();
@@ -52,8 +52,7 @@ PostProcessRegion::PostProcessRegion(GraphicsOutput* internal_buffer)
52
52
53
53
PostProcessRegion::PostProcessRegion (GraphicsOutput* internal_buffer, const LVecBase4f& dimensions)
54
54
{
55
- _buffer = internal_buffer;
56
- region = _buffer->make_display_region (dimensions);
55
+ region_ = internal_buffer->make_display_region (dimensions);
57
56
node = NodePath (" RTRoot" );
58
57
59
58
make_fullscreen_tri ();
@@ -65,15 +64,15 @@ void PostProcessRegion::init_function_pointers()
65
64
{
66
65
using namespace std ::placeholders;
67
66
68
- set_sort = std::bind (&DisplayRegion::set_sort, region , _1);
69
- disable_clears = std::bind (&DisplayRegion::disable_clears, region );
70
- set_active = std::bind (&DisplayRegion::set_active, region , _1);
71
- set_clear_depth_active = std::bind (&DisplayRegion::set_clear_depth_active, region , _1);
72
- set_clear_depth = std::bind (&DisplayRegion::set_clear_depth, region , _1);
73
- set_camera = std::bind (&DisplayRegion::set_camera, region , _1);
74
- set_clear_color_active = std::bind (&DisplayRegion::set_clear_color_active, region , _1);
75
- set_clear_color = std::bind (&DisplayRegion::set_clear_color, region , _1);
76
- set_draw_callback = std::bind (&DisplayRegion::set_draw_callback, region , _1);
67
+ set_sort = std::bind (&DisplayRegion::set_sort, region_ , _1);
68
+ disable_clears = std::bind (&DisplayRegion::disable_clears, region_ );
69
+ set_active = std::bind (&DisplayRegion::set_active, region_ , _1);
70
+ set_clear_depth_active = std::bind (&DisplayRegion::set_clear_depth_active, region_ , _1);
71
+ set_clear_depth = std::bind (&DisplayRegion::set_clear_depth, region_ , _1);
72
+ set_camera = std::bind (&DisplayRegion::set_camera, region_ , _1);
73
+ set_clear_color_active = std::bind (&DisplayRegion::set_clear_color_active, region_ , _1);
74
+ set_clear_color = std::bind (&DisplayRegion::set_clear_color, region_ , _1);
75
+ set_draw_callback = std::bind (&DisplayRegion::set_draw_callback, region_ , _1);
77
76
78
77
set_instance_count = std::bind (&NodePath::set_instance_count, tri, _1);
79
78
set_shader = std::bind (&NodePath::set_shader, tri, _1, _2);
@@ -119,7 +118,7 @@ void PostProcessRegion::make_fullscreen_cam()
119
118
PT (OmniBoundingVolume) obv = new OmniBoundingVolume ();
120
119
buffer_cam->set_cull_bounds (obv);
121
120
camera = node.attach_new_node (buffer_cam);
122
- region ->set_camera (camera);
121
+ region_ ->set_camera (camera);
123
122
}
124
123
125
124
}
0 commit comments