1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00
GLideN64/src/Graphics/ObjectHandle.h

27 lines
673 B
C
Raw Normal View History

2017-01-01 14:59:54 +00:00
#pragma once
#include <Types.h>
namespace graphics {
class ObjectHandle
{
public:
ObjectHandle() : m_name(0) {}
explicit ObjectHandle(u32 _name) : m_name(_name) {}
explicit operator u32() const { return m_name; }
bool operator==(const ObjectHandle & _other) const { return m_name == _other.m_name; }
bool operator!=(const ObjectHandle & _other) const { return m_name != _other.m_name; }
bool operator<(const ObjectHandle & _other) const { return m_name < _other.m_name; }
2017-01-20 10:03:51 +00:00
bool isNotNull() const { return m_name != 0; }
void reset() { m_name = 0; }
static ObjectHandle null;
2018-04-03 15:08:06 +00:00
static ObjectHandle defaultFramebuffer;
2017-01-01 14:59:54 +00:00
private:
u32 m_name;
};
}