Add OpenGLFence
This commit is contained in:
43
engine/src/RHI/OpenGL/OpenGLFence.cpp
Normal file
43
engine/src/RHI/OpenGL/OpenGLFence.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include "XCEngine/RHI/OpenGL/OpenGLFence.h"
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace RHI {
|
||||
|
||||
OpenGLFence::OpenGLFence() : m_fence(0), m_fenceValue(0), m_signaled(false) {
|
||||
}
|
||||
|
||||
OpenGLFence::~OpenGLFence() {
|
||||
}
|
||||
|
||||
bool OpenGLFence::Initialize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void OpenGLFence::Shutdown() {
|
||||
}
|
||||
|
||||
void OpenGLFence::Signal() {
|
||||
glFinish();
|
||||
m_signaled = true;
|
||||
m_fenceValue++;
|
||||
}
|
||||
|
||||
void OpenGLFence::Wait() {
|
||||
glFinish();
|
||||
}
|
||||
|
||||
void OpenGLFence::Reset() {
|
||||
m_signaled = false;
|
||||
}
|
||||
|
||||
bool OpenGLFence::IsSignaled() const {
|
||||
return m_signaled;
|
||||
}
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user