Photon Editor Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
Opengl.h
Go to the documentation of this file.
1#pragma once
2
3#include "ThirdParty/glad2.h"
4
5#include <Common/utility.h>
6#include <Utility/IUninstantiable.h>
7
8#include <concepts>
9
10namespace ph::editor::ghi
11{
12
13class Opengl final : private IUninstantiable
14{
15public:
19 static GLboolean getBooleanv(GLenum pname);
20
21 bool getBoolean(GLenum pname);
23
27 static GLfloat getFloatv(GLenum pname);
28
29 template<std::floating_point T>
30 static T getFloat(GLenum pname);
32
36 static GLint getIntegerv(GLenum pname);
37
38 template<std::integral T>
39 static T getInteger(GLenum pname);
41};
42
43inline bool Opengl::getBoolean(const GLenum pname)
44{
45 return getBooleanv(pname) == GL_TRUE;
46}
47
48template<std::floating_point T>
49T Opengl::getFloat(const GLenum pname)
50{
51 return lossless_float_cast<T>(getFloatv(pname));
52}
53
54template<std::integral T>
55T Opengl::getInteger(const GLenum pname)
56{
57 return lossless_integer_cast<T>(getIntegerv(pname));
58}
59
60}// end namespace ph::editor::ghi
Definition Opengl.h:14
static GLboolean getBooleanv(GLenum pname)
glGetBooleanv() helpers.
Definition Opengl.cpp:6
static T getInteger(GLenum pname)
Definition Opengl.h:55
static GLint getIntegerv(GLenum pname)
glGetIntegerv() helpers.
Definition Opengl.cpp:20
bool getBoolean(GLenum pname)
Definition Opengl.h:43
static GLfloat getFloatv(GLenum pname)
glGetFloatv() helpers.
Definition Opengl.cpp:13
static T getFloat(GLenum pname)
Definition Opengl.h:49
Definition PlatformDisplay.h:13