OGLplus  (0.59.0) a C++ wrapper for rendering APIs

screen.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_SHAPES_SCREEN_HPP
10 #define EAGINE_SHAPES_SCREEN_HPP
11 
12 #include "gen_base.hpp"
13 #include <eagine/config/basic.hpp>
14 #include <cassert>
15 
16 namespace eagine {
17 namespace shapes {
18 //------------------------------------------------------------------------------
23 public:
24  unit_screen_gen(vertex_attrib_bits attr_bits) noexcept;
25 
26  auto vertex_count() -> span_size_t override;
27 
28  void positions(span<float> dest) noexcept;
29 
30  void normals(span<float> dest) noexcept;
31 
32  void tangentials(span<float> dest) noexcept;
33 
34  void bitangentials(span<float> dest) noexcept;
35 
36  void face_coords(span<float> dest) noexcept;
37 
38  void attrib_values(vertex_attrib_variant, span<float>) override;
39 
41 
42  void instructions(drawing_variant, span<draw_operation> ops) override;
43 
44  auto bounding_sphere() -> math::sphere<float, true> override;
45 
46 private:
48 
49  static auto _attr_mask() noexcept -> vertex_attrib_bits;
50 };
51 //------------------------------------------------------------------------------
61 static inline auto unit_screen(vertex_attrib_bits attr_bits) {
62  return std::make_unique<unit_screen_gen>(attr_bits);
63 }
64 //------------------------------------------------------------------------------
65 
66 } // namespace shapes
67 } // namespace eagine
68 
69 #if !EAGINE_LINK_LIBRARY || defined(EAGINE_IMPLEMENTING_LIBRARY)
70 #include <eagine/shapes/screen.inl>
71 #endif
72 
73 #endif // EAGINE_SHAPES_SCREEN_HPP
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
bitfield< vertex_attrib_kind > vertex_attrib_bits
Alias for vertex_attrib_kind bitfield type.
Definition: vertex_attrib.hpp:85
Basic template for spheres in N-dimensional space.
Definition: primitives.hpp:122
Common code is placed in this namespace.
Definition: eagine.hpp:21
auto operation_count()
Returns the number of drawing instructions for the default variant.
Definition: gen_base.hpp:179
auto bounding_sphere() -> math::sphere< float, true > override
Returns the bounding sphere for the generated shape.
Generator of centered flat 2d screen shape from (-1,-1,0) to (1,1,0)
Definition: screen.hpp:22
Class designating an vertex attribute variant in a shape generator.
Definition: vertex_attrib.hpp:104
void instructions(drawing_variant, span< draw_operation > ops) override
Fetches the drawing operations for the specified drawing variant.
auto vertex_count() -> span_size_t override
Returns the shaped vertex count.
void attrib_values(vertex_attrib_variant, span< float >) override
Fetches the vertex attribute data for the specified variant as floats.
span_size_t drawing_variant
Alias for shape drawing variant index type.
Definition: gen_base.hpp:31
Base class for shape generators re-calculating the center.
Definition: gen_base.hpp:320
static auto unit_screen(vertex_attrib_bits attr_bits)
Constructs instances of unit_screen_gen.
Definition: screen.hpp:61

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).