FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
C_vector.hpp
1/*
2 * Copyright 2024 Guillaume Guillet
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _FGE_GRAPHIC_C_VECTOR_HPP_INCLUDED
18#define _FGE_GRAPHIC_C_VECTOR_HPP_INCLUDED
19
20#include <cstdint>
21#define GLM_FORCE_CTOR_INIT
22#define GLM_FORCE_DEPTH_ZERO_TO_ONE
23#define GLM_FORCE_LEFT_HANDED
24#include "glm/glm.hpp"
25
26#define FGE_NUMERIC_LIMITS_VECTOR_MAX(_vecType) (_vecType{std::numeric_limits<_vecType::value_type>::max()})
27
28namespace fge
29{
30
31template<class T>
32using Vector2 = glm::vec<2, T>;
33template<class T>
34using Vector3 = glm::vec<3, T>;
35
36using Vector2i = Vector2<int32_t>;
37using Vector2u = Vector2<uint32_t>;
38using Vector2f = Vector2<float>;
39
40using Vector3i = Vector3<int32_t>;
41using Vector3u = Vector3<uint32_t>;
42using Vector3f = Vector3<float>;
43
44} // namespace fge
45
46namespace glm
47{
48
49inline glm::vec2 operator*(glm::mat4 const& left, glm::vec2 const& right)
50{
51 return left * glm::vec4(right, 0.0f, 1.0f);
52}
53
54} // namespace glm
55
56#endif //_FGE_GRAPHIC_C_VECTOR_HPP_INCLUDED