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

application/040_metaballs/resources.hpp

Copyright Matus Chochlik. Distributed under the Boost Software License, Version 1.0. See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt

#ifndef OGLPLUS_EXAMPLE_RESOURCES_HPP // NOLINT(llvm-header-guard)
#define OGLPLUS_EXAMPLE_RESOURCES_HPP
#include <oglplus/gl.hpp>
class example;
//------------------------------------------------------------------------------
// volume_domain
//------------------------------------------------------------------------------
class volume_domain {
public:
void init(example&);
void compute(example&);
void draw(example&);
constexpr auto plane_count() const noexcept -> int {
return 64;
}
constexpr auto div_count() const noexcept -> int {
return plane_count() - 1;
}
constexpr auto cube_count() const noexcept -> int {
return div_count() * div_count() * div_count();
}
constexpr auto vertex_count() const noexcept -> int {
return plane_count() * plane_count() * plane_count();
}
static auto corner_loc() noexcept {
}
static auto field_binding() noexcept {
return 0U;
}
static auto metaballs_binding() noexcept {
return 1U;
}
static auto configs_binding() noexcept {
return 2U;
}
private:
oglp::owned_buffer_name _corners;
oglp::owned_buffer_name _indices;
oglp::owned_buffer_name _field;
oglp::owned_buffer_name _metaballs;
oglp::owned_buffer_name _configs;
};
//------------------------------------------------------------------------------
// programs
//------------------------------------------------------------------------------
class metaball_program {
public:
void init(example&);
void prepare_frame(example&);
void use(example&);
void bind_metaballs(example&, oglp::gl_types::uint_type);
private:
};
//------------------------------------------------------------------------------
class field_program {
public:
void init(example&);
void prepare_frame(example&);
void use(example&);
void bind_field(example&, oglp::gl_types::uint_type);
void bind_metaballs(example&, oglp::gl_types::uint_type);
void set_plane_count(example&, oglp::gl_types::int_type);
private:
oglp::uniform_location _plane_count_loc;
};
//------------------------------------------------------------------------------
class surface_program {
public:
void init(example&);
void prepare_frame(example&);
void bind_corner_location(example&, oglp::vertex_attrib_location);
void use(example&);
void bind_field(example&, oglp::gl_types::uint_type);
void bind_configs(example&, oglp::gl_types::uint_type);
void set_plane_count(example&, oglp::gl_types::int_type);
void set_div_count(example&, oglp::gl_types::int_type);
private:
oglp::uniform_location _camera_mat_loc;
oglp::uniform_location _perspective_mat_loc;
oglp::uniform_location _plane_count_loc;
oglp::uniform_location _div_count_loc;
};
//------------------------------------------------------------------------------
} // namespace eagine::application
#endif
Application harness / wrapper code is placed in this namespace.
Definition: eagine.hpp:72
prog_var_location< EAGINE_ID_V(Uniform)> uniform_location
Alias for shader program uniform location wrapper.
Definition: prog_var_loc.hpp:115
GLint int_type
Signed integer type.
Definition: config.hpp:70
GLuint uint_type
Unsigned integer type.
Definition: config.hpp:73
gl_owned_object_name< vertex_array_tag > owned_vertex_array_name
Alias for owned GL vertex array object handle.
Definition: object_name.hpp:224
prog_var_location< EAGINE_ID_V(VertexAttr)> vertex_attrib_location
Alias for program vertex attribute location wrapper.
Definition: prog_var_loc.hpp:104
gl_owned_object_name< program_tag > owned_program_name
Alias for owned GL program object handle.
Definition: object_name.hpp:188

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