Add OpenGLSwapChain
This commit is contained in:
32
engine/src/RHI/OpenGL/OpenGLSwapChain.cpp
Normal file
32
engine/src/RHI/OpenGL/OpenGLSwapChain.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include "XCEngine/RHI/OpenGL/OpenGLSwapChain.h"
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace RHI {
|
||||
|
||||
OpenGLSwapChain::OpenGLSwapChain() : m_window(nullptr) {
|
||||
}
|
||||
|
||||
OpenGLSwapChain::~OpenGLSwapChain() {
|
||||
}
|
||||
|
||||
bool OpenGLSwapChain::Initialize(GLFWwindow* window) {
|
||||
m_window = window;
|
||||
return true;
|
||||
}
|
||||
|
||||
void OpenGLSwapChain::Shutdown() {
|
||||
m_window = nullptr;
|
||||
}
|
||||
|
||||
void OpenGLSwapChain::Present() {
|
||||
glfwSwapBuffers(m_window);
|
||||
}
|
||||
|
||||
void OpenGLSwapChain::SwapBuffers() {
|
||||
glfwSwapBuffers(m_window);
|
||||
}
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user