globjects  2.0.0.630135941c42
Strict OpenGL objects wrapper.
Loading...
Searching...
No Matches
Instantiator.h
Go to the documentation of this file.
1
2#pragma once
3
4
5#include <memory>
6
7#include <glbinding/gl/types.h>
8
9#include <globjects/globjects_api.h>
10
11
12namespace globjects
13{
14
15
20template <typename Subclass>
21class GLOBJECTS_TEMPLATE_API Instantiator
22{
23public:
24 template <typename... Args>
25 static std::unique_ptr<Subclass> create(Args && ... args);
26
27 template <typename... Args>
28 static std::unique_ptr<Subclass> fromId(gl::GLuint id, Args && ... args);
29};
30
31
32} // namespace globjects
33
34
35#include <globjects/base/Instantiator.inl>
CRTP for creating objects similar to std::make_unique.
Definition Instantiator.h:22
static std::unique_ptr< Subclass > create(Args &&... args)
static std::unique_ptr< Subclass > fromId(gl::GLuint id, Args &&... args)
Contains all the classes that wrap OpenGL functionality.