Go to the documentation of this file.
9 #ifndef OGLPLUS_SHAPES_DRAWING_HPP
10 #define OGLPLUS_SHAPES_DRAWING_HPP
12 #include "../config/basic.hpp"
13 #include "../gl_api.hpp"
17 namespace eagine::oglp {
84 return _idx_type != GL.
none;
105 bool _primitive_restart{
false};
106 bool _cw_face_winding{
false};
108 auto _idx_ptr() const noexcept -> gl_types::const_void_ptr_type;
110 template <typename A>
111 void _prepare(const basic_gl_api<A>& api) const noexcept;
128 template <
typename A>
131 span<const shape_draw_operation> ops) noexcept;
137 template <
typename A>
140 span<const shape_draw_operation> ops,
147 template <
typename A>
150 span<const shape_draw_operation> ops,
157 template <
typename A>
160 span<const shape_draw_operation> ops,
166 #include <oglplus/shapes/drawing.inl>
168 #endif // OGLPLUS_SHAPES_DRAWING_HPP
GLsizei sizei_type
Signed integer size type.
Definition: config.hpp:88
Draw operation parameters.
Definition: drawing.hpp:162
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
auto offset_first(span_size_t offs) noexcept -> auto &
Moves the first index by the specified offset.
Definition: drawing.hpp:70
primitive_type
The shape primitive type enumeration.
Definition: drawing.hpp:22
void draw_using_instructions(const basic_gl_api< A > &api, span< const shape_draw_operation > ops, const shape_draw_subset &subs) noexcept
Takes a sequence of draw operations from a shape generator and draws them.
GLint int_type
Signed integer type.
Definition: config.hpp:70
auto type_size(const basic_gl_api< A > &, shapes::index_data_type) noexcept -> span_size_t
Returns the byte size of a shape index data type.
Typed enumeration for GL primitive type constants.
Definition: enum_types.hpp:458
Shape draw operation parameters, translated to GL representation.
Definition: drawing.hpp:58
GLuint uint_type
Unsigned integer type.
Definition: config.hpp:73
constexpr shape_draw_operation() noexcept=default
Default constructor.
auto is_indexed(const basic_gl_api< A > &api) const noexcept -> bool
Indicates if indexed drawing is enabled.
Definition: drawing.hpp:82
auto translate(const basic_gl_api< A > &, shapes::index_data_type) noexcept -> index_data_type
Translates from shape index data type to GL data type.
void draw(const basic_gl_api< A > &api) const noexcept
Invokes the appropriate draw operation on the specified GL api.
void draw_instanced(const basic_gl_api< A > &api, gl_types::sizei_type inst_count) const noexcept
Invokes the appropriate instanced draw operation on the given GL api.
Class wrapping the constants from the GL API.
Definition: constants.hpp:26
opt_c_api_constant< mp_list< support_level, surface_buffer, sl_data_type, index_data_type, oglp::texture_compare_mode, oglp::context_release_behavior, oglp::path_join_style_nv, oglp::path_gen_mode_nv, oglp::path_transform_type_nv >, bitfield_type_i > none
Definition: constants.hpp:12810
attrib_data_type
Shape vertex attribute data type enumeration.
Definition: drawing.hpp:67
auto phase() const noexcept
Returns the drawing phase.
Definition: drawing.hpp:76
Combined wrapper for the GL API operations and constants.
Definition: basic_gl_api.hpp:27
Holds the first index and count of a subset of drawn shape elements.
Definition: drawing.hpp:117
Typed enumeration for GL index data type constants.
Definition: enum_types.hpp:574
index_data_type
Shape element index type enumeration.
Definition: drawing.hpp:111
void draw_instanced_using_instructions(const basic_gl_api< A > &api, span< const shape_draw_operation > ops, const shape_draw_subset &subs, gl_types::sizei_type inst_count) noexcept
Takes a sequence of draw operations from a shape generator and draws them.