Commit e0224256 authored by Jonathan Kunstwald's avatar Jonathan Kunstwald
Browse files

Alias perspective_reverse_z to OGL, add deprecation to non-explicit aliases

parent 4be69af5
......@@ -89,17 +89,23 @@ template <class ScalarT>
}
template <class ScalarT>
[[nodiscard]] constexpr mat<4, 4, ScalarT> look_at(pos<3, ScalarT> const& eye, dir<3, ScalarT> const& fwd, vec<3, ScalarT> const& ref_up)
[[deprecated("use explicit _opengl or _directx version")]] [[nodiscard]] constexpr mat<4, 4, ScalarT> look_at(pos<3, ScalarT> const& eye,
dir<3, ScalarT> const& fwd,
vec<3, ScalarT> const& ref_up)
{
return look_at_opengl(eye, fwd, ref_up);
}
template <class ScalarT>
[[nodiscard]] constexpr mat<4, 4, ScalarT> look_at(pos<3, ScalarT> const& eye, pos<3, ScalarT> const& target, vec<3, ScalarT> const& ref_up)
[[deprecated("use explicit _opengl or _directx version")]] [[nodiscard]] constexpr mat<4, 4, ScalarT> look_at(pos<3, ScalarT> const& eye,
pos<3, ScalarT> const& target,
vec<3, ScalarT> const& ref_up)
{
return look_at_opengl(eye, normalize(target - eye), ref_up);
}
template <class ScalarT>
[[nodiscard]] constexpr mat<4, 4, ScalarT> look_at(pos<3, ScalarT> const& eye, vec<3, ScalarT> const& fwd, vec<3, ScalarT> const& ref_up)
[[deprecated("use explicit _opengl or _directx version")]] [[nodiscard]] constexpr mat<4, 4, ScalarT> look_at(pos<3, ScalarT> const& eye,
vec<3, ScalarT> const& fwd,
vec<3, ScalarT> const& ref_up)
{
return look_at_opengl(eye, normalize(fwd), ref_up);
}
......
......@@ -10,7 +10,7 @@ namespace tg
{
/// aspect ratio is width / height
template <class ScalarT>
[[nodiscard]] mat<4, 4, ScalarT> perspective_reverse_z(angle_t<ScalarT> horizontal_fov, ScalarT aspect_ratio, ScalarT near_plane)
[[nodiscard]] mat<4, 4, ScalarT> perspective_reverse_z_opengl(angle_t<ScalarT> horizontal_fov, ScalarT aspect_ratio, ScalarT near_plane)
{
TG_CONTRACT(near_plane > 0);
TG_CONTRACT(aspect_ratio > 0);
......@@ -104,8 +104,19 @@ template <class ScalarT>
}
template <class ScalarT>
[[nodiscard]] mat<4, 4, ScalarT> perspective(angle_t<ScalarT> horizontal_fov, ScalarT aspect_ratio, ScalarT near_plane, ScalarT far_plane)
[[deprecated("use explicit _opengl or _directx version")]] [[nodiscard]] mat<4, 4, ScalarT> perspective(angle_t<ScalarT> horizontal_fov,
ScalarT aspect_ratio,
ScalarT near_plane,
ScalarT far_plane)
{
return perspective_opengl(horizontal_fov, aspect_ratio, near_plane, far_plane);
}
template <class ScalarT>
[[deprecated("use explicit _opengl or _directx version")]] [[nodiscard]] mat<4, 4, ScalarT> perspective_reverse_z(angle_t<ScalarT> horizontal_fov,
ScalarT aspect_ratio,
ScalarT near_plane)
{
return perspective_reverse_z_opengl(horizontal_fov, aspect_ratio, near_plane);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment