mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 18:24:35 +00:00
506a487d24
- specializes for 1, 2, 3 and 4-dimensional vector types which are then aliased as tvec1, tvec2, tvec3 and tvec4 - requires C++11 aliases; breaks compatability with C++03 - tested on: - clang-3.5.2, clang-3.8.0 - gcc 4.8.5, gcc 5.4.1, gcc 6.2.0 TODO: - still uses template template parameters - most can probably be removed - some definitions might now be de-duplicated
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
/// @brief Include to compute the number of mipmaps levels necessary to create a mipmap complete texture.
|
|
/// @file gli/levels.hpp
|
|
|
|
#pragma once
|
|
|
|
#include "type.hpp"
|
|
|
|
namespace gli
|
|
{
|
|
/// Compute the number of mipmaps levels necessary to create a mipmap complete texture
|
|
///
|
|
/// @param Extent Extent of the texture base level mipmap
|
|
/// @tparam vecType Vector type used to express the dimensions of a texture of any kind.
|
|
/// @code
|
|
/// #include <gli/texture2d.hpp>
|
|
/// #include <gli/levels.hpp>
|
|
/// ...
|
|
/// gli::texture2d::extent_type Extent(32, 10);
|
|
/// gli::texture2d Texture(gli::levels(Extent));
|
|
/// @endcode
|
|
template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
T levels(vecType<D, T, P> const& Extent);
|
|
/*
|
|
/// Compute the number of mipmaps levels necessary to create a mipmap complete texture
|
|
///
|
|
/// @param Extent Extent of the texture base level mipmap
|
|
/// @code
|
|
/// #include <gli/texture2d.hpp>
|
|
/// #include <gli/levels.hpp>
|
|
/// ...
|
|
/// gli::texture2d Texture(32);
|
|
/// @endcode
|
|
size_t levels(size_t Extent);
|
|
|
|
/// Compute the number of mipmaps levels necessary to create a mipmap complete texture
|
|
///
|
|
/// @param Extent Extent of the texture base level mipmap
|
|
/// @code
|
|
/// #include <gli/texture2d.hpp>
|
|
/// #include <gli/levels.hpp>
|
|
/// ...
|
|
/// gli::texture2d Texture(32);
|
|
/// @endcode
|
|
int levels(int Extent);
|
|
*/
|
|
}//namespace gli
|
|
|
|
#include "./core/levels.inl"
|