mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-14 05:55:13 +01:00
gl_resource_manager: add OGLPipeline
This commit is contained in:
parent
4f9b9c4b80
commit
bdab18d2d9
@ -158,6 +158,38 @@ public:
|
|||||||
GLuint handle = 0;
|
GLuint handle = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class OGLPipeline : private NonCopyable {
|
||||||
|
public:
|
||||||
|
OGLPipeline() = default;
|
||||||
|
OGLPipeline(OGLPipeline&& o) {
|
||||||
|
handle = std::exchange<GLuint>(o.handle, 0);
|
||||||
|
}
|
||||||
|
~OGLPipeline() {
|
||||||
|
Release();
|
||||||
|
}
|
||||||
|
OGLPipeline& operator=(OGLPipeline&& o) {
|
||||||
|
Release();
|
||||||
|
handle = std::exchange<GLuint>(o.handle, 0);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Create() {
|
||||||
|
if (handle != 0)
|
||||||
|
return;
|
||||||
|
glGenProgramPipelines(1, &handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Release() {
|
||||||
|
if (handle == 0)
|
||||||
|
return;
|
||||||
|
glDeleteProgramPipelines(1, &handle);
|
||||||
|
OpenGLState::GetCurState().ResetPipeline(handle).Apply();
|
||||||
|
handle = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
GLuint handle = 0;
|
||||||
|
};
|
||||||
|
|
||||||
class OGLBuffer : private NonCopyable {
|
class OGLBuffer : private NonCopyable {
|
||||||
public:
|
public:
|
||||||
OGLBuffer() = default;
|
OGLBuffer() = default;
|
||||||
|
Loading…
Reference in New Issue
Block a user