nomlib
Toggle main menu visibility
Loading...
Searching...
No Matches
include
nomlib
gui
Drawables.hpp
1
/******************************************************************************
2
3
nomlib - C++11 cross-platform game engine
4
5
Copyright (c) 2013, 2014 Jeffrey Carpenter <i8degrees@gmail.com>
6
All rights reserved.
7
8
Redistribution and use in source and binary forms, with or without
9
modification, are permitted provided that the following conditions are met:
10
11
1. Redistributions of source code must retain the above copyright notice, this
12
list of conditions and the following disclaimer.
13
2. Redistributions in binary form must reproduce the above copyright notice,
14
this list of conditions and the following disclaimer in the documentation
15
and/or other materials provided with the distribution.
16
17
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28
******************************************************************************/
29
#ifndef NOMLIB_GUI_DRAWABLES_HPP
30
#define NOMLIB_GUI_DRAWABLES_HPP
31
32
#include <vector>
33
#include <memory>
34
#include <iterator>
35
36
#include "export.hpp"
37
#include "nomlib/config.hpp"
38
#include "nomlib/graphics/IDrawable.hpp"
39
40
namespace
nom {
41
42
class
NOM_EXPORT
Drawables
43
{
44
public
:
45
typedef
Drawables
self_type;
46
47
typedef
self_type* raw_ptr;
48
typedef
std::unique_ptr<self_type> unique_ptr;
49
typedef
std::shared_ptr<self_type> shared_ptr;
50
51
typedef
IDrawable
value_type;
52
typedef
std::vector<value_type::shared_ptr> container;
53
54
typedef
container::iterator iterator;
55
typedef
container::const_iterator const_iterator;
56
58
Drawables
(
void
);
59
61
~Drawables
(
void
);
62
64
Drawables
(
const
Drawables::container&
object
);
65
66
const
container& drawables(
void
)
const
;
67
69
bool
updated
(
void
)
const
;
70
72
void
set_updated
(
bool
state );
73
74
void
assign(
const
container& objects );
75
76
void
insert( uint pos,
const
value_type::raw_ptr
object
);
77
78
void
push_back(
const
value_type::raw_ptr
object
);
79
80
const
value_type::shared_ptr
& at( uint pos );
81
82
Drawables::iterator erase( uint pos );
83
84
// bool erase( const value_type::raw_ptr object );
85
86
bool
empty(
void
)
const
;
87
uint size(
void
)
const
;
88
void
clear(
void
);
89
93
Drawables::const_iterator
begin
(
void
)
const
;
94
98
Drawables::const_iterator
end
(
void
)
const
;
99
103
Drawables::iterator
begin
(
void
);
104
108
Drawables::iterator
end
(
void
);
109
110
private
:
111
container drawables_;
112
115
bool
updated_
;
116
};
117
118
}
// namespace nom
119
120
#endif
// include guard defined
nom::Drawables::Drawables
Drawables(void)
Default constructor.
nom::Drawables::end
Drawables::const_iterator end(void) const
Iterator access to the end of the render list.
nom::Drawables::updated_
bool updated_
Internal object state; we re-create drawable objects every time the internal state changes in order t...
Definition
Drawables.hpp:115
nom::Drawables::updated
bool updated(void) const
Getter for internal updated status.
nom::Drawables::begin
Drawables::const_iterator begin(void) const
Iterator access to the beginning of the render list.
nom::Drawables::Drawables
Drawables(const Drawables::container &object)
Constructor to ...
nom::Drawables::set_updated
void set_updated(bool state)
Set the internal updated status.
nom::Drawables::begin
Drawables::iterator begin(void)
Iterator access to the beginning of the render list.
nom::Drawables::~Drawables
~Drawables(void)
Destructor.
nom::Drawables::end
Drawables::iterator end(void)
Iterator access to the end of the render list.
nom::IDrawable
Base interface class for grouping objects under a united front.
Definition
IDrawable.hpp:43
nom::IDrawable::shared_ptr
std::shared_ptr< self_type > shared_ptr
A type definition for a C++11 std::shared_ptr to an IDrawable object.
Definition
IDrawable.hpp:57
nom::IDrawable::raw_ptr
self_type * raw_ptr
A type definition for a C pointer – raw pointer – to an IDrawable object.
Definition
IDrawable.hpp:49
Generated on
for nomlib by
1.18.0