diff --git a/include/Nazara/OpenGLRenderer/Wrapper/ContextObject.hpp b/include/Nazara/OpenGLRenderer/Wrapper/ContextObject.hpp deleted file mode 100644 index 696427450..000000000 --- a/include/Nazara/OpenGLRenderer/Wrapper/ContextObject.hpp +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2020 Jérôme Leclercq -// This file is part of the "Nazara Engine - OpenGL Renderer" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#pragma once - -#ifndef NAZARA_OPENGLRENDERER_VKDEVICEOBJECT_HPP -#define NAZARA_OPENGLRENDERER_VKDEVICEOBJECT_HPP - -#include -#include -#include -#include -#include - -namespace Nz -{ - namespace Vk - { - template - class DeviceObject - { - public: - DeviceObject(); - DeviceObject(const DeviceObject&) = delete; - DeviceObject(DeviceObject&& object) noexcept; - ~DeviceObject(); - - bool Create(Device& device, const CreateInfo& createInfo, const VkAllocationCallbacks* allocator = nullptr); - void Destroy(); - - bool IsValid() const; - - Device* GetDevice() const; - VkResult GetLastErrorCode() const; - - void SetDebugName(const char* name); - void SetDebugName(const std::string& name); - - DeviceObject& operator=(const DeviceObject&) = delete; - DeviceObject& operator=(DeviceObject&& object) noexcept; - - operator VkType() const; - - protected: - MovablePtr m_device; - VkAllocationCallbacks m_allocator; - VkType m_handle; - mutable VkResult m_lastErrorCode; - }; - } -} - -#include - -#endif // NAZARA_OPENGLRENDERER_VKDEVICEOBJECT_HPP diff --git a/include/Nazara/OpenGLRenderer/Wrapper/DeviceObject.hpp b/include/Nazara/OpenGLRenderer/Wrapper/DeviceObject.hpp new file mode 100644 index 000000000..495297289 --- /dev/null +++ b/include/Nazara/OpenGLRenderer/Wrapper/DeviceObject.hpp @@ -0,0 +1,49 @@ +// Copyright (C) 2020 Jérôme Leclercq +// This file is part of the "Nazara Engine - OpenGL Renderer" +// For conditions of distribution and use, see copyright notice in Config.hpp + +#pragma once + +#ifndef NAZARA_OPENGLRENDERER_GLDEVICEOBJECT_HPP +#define NAZARA_OPENGLRENDERER_GLDEVICEOBJECT_HPP + +#include +#include +#include + +namespace Nz::GL +{ + template + class DeviceObject + { + public: + DeviceObject(); + DeviceObject(const DeviceObject&) = delete; + DeviceObject(DeviceObject&& object) noexcept; + ~DeviceObject(); + + bool Create(OpenGLDevice& device); + void Destroy(); + + bool IsValid() const; + + Device* GetDevice() const; + VkResult GetLastErrorCode() const; + + void SetDebugName(const char* name); + void SetDebugName(const std::string& name); + + DeviceObject& operator=(const DeviceObject&) = delete; + DeviceObject& operator=(DeviceObject&& object) noexcept; + + operator VkType() const; + + protected: + MovablePtr m_device; + GLuint m_handle; + }; +} + +#include + +#endif // NAZARA_OPENGLRENDERER_VKDEVICEOBJECT_HPP diff --git a/include/Nazara/OpenGLRenderer/Wrapper/ContextObject.inl b/include/Nazara/OpenGLRenderer/Wrapper/DeviceObject.inl similarity index 100% rename from include/Nazara/OpenGLRenderer/Wrapper/ContextObject.inl rename to include/Nazara/OpenGLRenderer/Wrapper/DeviceObject.inl diff --git a/src/Nazara/OpenGLRenderer/DummySurface.cpp b/src/Nazara/OpenGLRenderer/DummySurface.cpp new file mode 100644 index 000000000..ec74f480e --- /dev/null +++ b/src/Nazara/OpenGLRenderer/DummySurface.cpp @@ -0,0 +1,20 @@ +// Copyright (C) 2020 Jérôme Leclercq +// This file is part of the "Nazara Engine - OpenGL Renderer" +// For conditions of distribution and use, see copyright notice in Config.hpp + +#include +#include + +namespace Nz +{ + bool DummySurface::Create(WindowHandle handle) + { + m_handle = handle; + return true; + } + + void DummySurface::Destroy() + { + m_handle = nullptr; + } +}