Files
NazaraEngine/include/Nazara/Vulkan/VkBuffer.hpp
Lynix a5690a0aef I can now render meshes !
Former-commit-id: 5f292c0f81730f8fa26d7c930130671da6c8a26d [formerly 2145d599592770fe9a6cf65c46e10400417c4726]
Former-commit-id: c0740828e97fcb2a704d55f9d769a371f8d6a4d3
2016-07-13 18:08:56 +02:00

47 lines
1.4 KiB
C++

// Copyright (C) 2016 Jérôme Leclercq
// This file is part of the "Nazara Engine - Vulkan"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_VULKAN_VKBUFFER_HPP
#define NAZARA_VULKAN_VKBUFFER_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Vulkan/VkDeviceObject.hpp>
namespace Nz
{
namespace Vk
{
class Buffer : public DeviceObject<Buffer, VkBuffer, VkBufferCreateInfo>
{
friend DeviceObject;
public:
Buffer() = default;
Buffer(const Buffer&) = delete;
Buffer(Buffer&&) = default;
~Buffer() = default;
bool BindBufferMemory(VkDeviceMemory memory, VkDeviceSize offset = 0);
using DeviceObject::Create;
inline bool Create(const DeviceHandle& device, VkBufferCreateFlags flags, VkDeviceSize size, VkBufferUsageFlags usage, const VkAllocationCallbacks* allocator = nullptr);
VkMemoryRequirements GetMemoryRequirements() const;
Buffer& operator=(const Buffer&) = delete;
Buffer& operator=(Buffer&&) = delete;
private:
static inline VkResult CreateHelper(const DeviceHandle& device, const VkBufferCreateInfo* createInfo, const VkAllocationCallbacks* allocator, VkBuffer* handle);
static inline void DestroyHelper(const DeviceHandle& device, VkBuffer handle, const VkAllocationCallbacks* allocator);
};
}
}
#include <Nazara/Vulkan/VkBuffer.inl>
#endif // NAZARA_VULKAN_VKBUFFER_HPP