handy invalid handle macro
This commit is contained in:
@@ -24,6 +24,15 @@ struct Handle {
|
||||
[[nodiscard]] auto operator<=>(const Handle&) const = default;
|
||||
};
|
||||
|
||||
struct InvalidHandle {
|
||||
template <typename T>
|
||||
[[nodiscard]] constexpr operator Handle<T>() const {
|
||||
return Handle<T>::invalid();
|
||||
}
|
||||
};
|
||||
|
||||
inline constexpr InvalidHandle INVALID_HANDLE{};
|
||||
|
||||
class Mesh;
|
||||
class Panel;
|
||||
class RenderTarget;
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/constants.hpp>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
#include <sophia/application.hpp>
|
||||
@@ -10,12 +13,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#define GLM_FORCE_RADIANS
|
||||
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/constants.hpp>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
|
||||
struct Boid {
|
||||
glm::vec2 position;
|
||||
glm::vec2 velocity;
|
||||
|
||||
Reference in New Issue
Block a user