build: move objects into cruft::vk namespace

This commit is contained in:
Danny Robson 2017-05-26 16:30:48 +10:00
parent 28249fa335
commit dbb8b7ee10
36 changed files with 83 additions and 76 deletions

View File

@ -17,7 +17,7 @@
#include "./buffer.hpp"
using vk::buffer;
using cruft::vk::buffer;
///////////////////////////////////////////////////////////////////////////////

View File

@ -15,13 +15,13 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_BUFFER_HPP
#define __VK_BUFFER_HPP
#ifndef CRUFT_VK_BUFFER_HPP
#define CRUFT_VK_BUFFER_HPP
#include "./object.hpp"
#include "./fwd.hpp"
namespace vk {
namespace cruft::vk {
struct buffer : public owned<buffer,device> {
};

View File

@ -22,7 +22,7 @@
#include <cruft/util/cast.hpp>
using vk::command_buffer;
using cruft::vk::command_buffer;
///////////////////////////////////////////////////////////////////////////////

View File

@ -15,14 +15,14 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_COMMAND_BUFFER_HPP
#define __VK_COMMAND_BUFFER_HPP
#ifndef CRUFT_VK_COMMAND_BUFFER_HPP
#define CRUFT_VK_COMMAND_BUFFER_HPP
#include "./object.hpp"
#include <cruft/util/view.hpp>
namespace vk {
namespace cruft::vk {
struct command_buffer : public owned<command_buffer,device> {
void reset (VkCommandBufferResetFlags);

View File

@ -19,7 +19,7 @@
#include "./device.hpp"
using vk::command_pool;
using cruft::vk::command_pool;
///////////////////////////////////////////////////////////////////////////////

View File

@ -15,12 +15,12 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_COMMAND_POOL_HPP
#define __VK_COMMAND_POOL_HPP
#ifndef CRUFT_VK_COMMAND_POOL_HPP
#define CRUFT_VK_COMMAND_POOL_HPP
#include "./object.hpp"
namespace vk {
namespace cruft::vk {
struct command_pool : public owned<command_pool,device> {
void reset (const device&, VkCommandPoolResetFlags);
};

View File

@ -22,7 +22,7 @@
#include <cruft/util/cast.hpp>
#include <cruft/util/debug.hpp>
using vk::device;
using cruft::vk::device;
///////////////////////////////////////////////////////////////////////////////

View File

@ -15,14 +15,14 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_DEVICE_HPP
#define __VK_DEVICE_HPP
#ifndef CRUFT_VK_DEVICE_HPP
#define CRUFT_VK_DEVICE_HPP
#include "./object.hpp"
#include "./fwd.hpp"
namespace vk {
namespace cruft::vk {
struct device : public instantiated<device> {
device (const physical_device&,
const VkDeviceCreateInfo&);

View File

@ -19,7 +19,7 @@
#include "./device.hpp"
using vk::device_memory;
using cruft::vk::device_memory;
///////////////////////////////////////////////////////////////////////////////

View File

@ -15,13 +15,13 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_DEVICE_MEMORY_HPP
#define __VK_DEVICE_MEMORY_HPP
#ifndef CRUFT_VK_DEVICE_MEMORY_HPP
#define CRUFT_VK_DEVICE_MEMORY_HPP
#include "./object.hpp"
#include "./fwd.hpp"
namespace vk {
namespace cruft::vk {
struct device_memory : public owned<device_memory,device> {
void* map (const device&,
VkDeviceSize offset,

View File

@ -19,7 +19,7 @@
#include "./device.hpp"
using vk::event;
using cruft::vk::event;
///////////////////////////////////////////////////////////////////////////////

View File

@ -15,13 +15,13 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_EVENT_HPP
#define __VK_EVENT_HPP
#ifndef CRUFT_VK_EVENT_HPP
#define CRUFT_VK_EVENT_HPP
#include "./object.hpp"
#include "./fwd.hpp"
namespace vk {
namespace cruft::vk {
struct event : public owned<event,device> {
bool is_set (const device&) const;

View File

@ -18,8 +18,10 @@
#include "./except.hpp"
#include <cruft/util/debug.hpp>
#include <cruft/util/preprocessor.hpp>
using vk::error;
using cruft::vk::error;
using cruft::vk::error_code;
///////////////////////////////////////////////////////////////////////////////

View File

@ -15,14 +15,14 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_EXCEPT_HPP
#define __VK_EXCEPT_HPP
#ifndef CRUFT_VK_EXCEPT_HPP
#define CRUFT_VK_EXCEPT_HPP
#include "./vk.hpp"
#include <exception>
namespace vk {
namespace cruft::vk {
class error : public std::exception {
public:
static void try_code (VkResult);

View File

@ -22,7 +22,7 @@
#include <cruft/util/cast.hpp>
#include <cruft/util/debug.hpp>
using vk::fence;
using cruft::vk::fence;
///////////////////////////////////////////////////////////////////////////////

View File

@ -15,12 +15,12 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_FENCE_HPP
#define __VK_FENCE_HPP
#ifndef CRUFT_VK_FENCE_HPP
#define CRUFT_VK_FENCE_HPP
#include "./object.hpp"
namespace vk {
namespace cruft::vk {
struct fence : owned<fence,device> {
bool is_ready (const device &dev);

View File

@ -19,7 +19,7 @@
#include "./device.hpp"
using vk::framebuffer;
using cruft::vk::framebuffer;
///////////////////////////////////////////////////////////////////////////////

View File

@ -15,12 +15,12 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_FRAMEBUFFER_HPP
#define __VK_FRAMEBUFFER_HPP
#ifndef CRUFT_VK_FRAMEBUFFER_HPP
#define CRUFT_VK_FRAMEBUFFER_HPP
#include "./object.hpp"
namespace vk {
namespace cruft::vk {
struct framebuffer : public owned<framebuffer,device> {
VkExtent2D area_granularity (const device&) const;
};

View File

@ -15,12 +15,12 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_FWD_HPP
#define __VK_FWD_HPP
#ifndef CRUFT_VK_FWD_HPP
#define CRUFT_VK_FWD_HPP
#include "./vk.hpp"
namespace vk {
namespace cruft::vk {
template <typename T> struct instantiated;
template <typename T> struct enumerated;
template <typename T, typename O> struct owned;

View File

@ -15,10 +15,10 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_IMAGE_HPP
#define __VK_IMAGE_HPP
#ifndef CRUFT_VK_IMAGE_HPP
#define CRUFT_VK_IMAGE_HPP
namespace vk {
namespace cruft::vk {
}

View File

@ -17,7 +17,7 @@
#include "./instance.hpp"
using vk::instance;
using cruft::vk::instance;
///////////////////////////////////////////////////////////////////////////////

View File

@ -15,15 +15,15 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_INSTANCE_HPP
#define __VK_INSTANCE_HPP
#ifndef CRUFT_VK_INSTANCE_HPP
#define CRUFT_VK_INSTANCE_HPP
#include "./object.hpp"
#include "./vk.hpp"
#include "./traits.hpp"
namespace vk {
namespace cruft::vk {
struct instance : public instantiated<instance> {
instance (const VkInstanceCreateInfo &info);
};

View File

@ -12,7 +12,10 @@
* limitations under the License.
*
* Copyright:
* 2016, Danny Robson <danny@nerdcruft.net>
* 2016-2017, Danny Robson <danny@nerdcruft.net>
*/
#include "./object.hpp"
using cruft::vk::object;
using cruft::vk::enumerated;

View File

@ -15,15 +15,15 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_OBJECT_HPP
#define __VK_OBJECT_HPP
#ifndef CRUFT_VK_OBJECT_HPP
#define CRUFT_VK_OBJECT_HPP
#include "./traits.hpp"
#include "./except.hpp"
#include <utility>
namespace vk {
namespace cruft::vk {
template <typename T>
struct object {
using id_t = typename id_traits<T>::id_t;

View File

@ -15,6 +15,8 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#include "physical_device.hpp"
#include "./physical_device.hpp"
#include "./except.hpp"
///////////////////////////////////////////////////////////////////////////////

View File

@ -15,14 +15,14 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_PHYSICAL_DEVICE_HPP
#define __VK_PHYSICAL_DEVICE_HPP
#ifndef CRUFT_VK_PHYSICAL_DEVICE_HPP
#define CRUFT_VK_PHYSICAL_DEVICE_HPP
#include "./object.hpp"
#include "./vk.hpp"
namespace vk {
namespace cruft::vk {
struct physical_device : public enumerated<physical_device> {
};
}

View File

@ -17,7 +17,7 @@
#include "./pipeline.hpp"
using vk::pipeline;
using cruft::vk::pipeline;
///////////////////////////////////////////////////////////////////////////////

View File

@ -15,13 +15,13 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_PIPELINE_HPP
#define __VK_PIPELINE_HPP
#ifndef CRUFT_VK_PIPELINE_HPP
#define CRUFT_VK_PIPELINE_HPP
#include "./object.hpp"
#include "./fwd.hpp"
namespace vk {
namespace cruft::vk {
struct pipeline : public owned<pipeline,device> {
};

View File

@ -21,7 +21,7 @@
#include "./object.hpp"
#include "./fwd.hpp"
namespace vk {
namespace cruft::vk {
struct pipeline_cache : public owned<pipeline_cache,device> {
void merge (const device&,
const pipeline_cache *first,

View File

@ -19,7 +19,7 @@
#include "./device.hpp"
using vk::pipeline_cache;
using cruft::vk::pipeline_cache;
///////////////////////////////////////////////////////////////////////////////

View File

@ -19,7 +19,7 @@
#include "./except.hpp"
using vk::queue;
using cruft::vk::queue;
///////////////////////////////////////////////////////////////////////////////

View File

@ -15,13 +15,13 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_QUEUE_HPP
#define __VK_QUEUE_HPP
#ifndef CRUFT_VK_QUEUE_HPP
#define CRUFT_VK_QUEUE_HPP
#include "./object.hpp"
#include "./fwd.hpp"
namespace vk {
namespace cruft::vk {
struct queue : public owned<queue,device> {
void wait_idle (void);

View File

@ -15,12 +15,12 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_RENDER_PASS_HPP
#define __VK_RENDER_PASS_HPP
#ifndef CRUFT_VK_RENDER_PASS_HPP
#define CRUFT_VK_RENDER_PASS_HPP
#include "./object.hpp"
namespace vk {
namespace cruft::vk {
struct render_pass : public owned<render_pass,device> {
};

View File

@ -15,13 +15,13 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_SEMAPHORE_HPP
#define __VK_SEMAPHORE_HPP
#ifndef CRUFT_VK_SEMAPHORE_HPP
#define CRUFT_VK_SEMAPHORE_HPP
#include "./object.hpp"
#include "./fwd.hpp"
namespace vk {
namespace cruft::vk {
struct semaphore : public owned<semaphore,device> {
};

View File

@ -15,13 +15,13 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_SHADER_MODULE_HPP
#define __VK_SHADER_MODULE_HPP
#ifndef CRUFT_VK_SHADER_MODULE_HPP
#define CRUFT_VK_SHADER_MODULE_HPP
#include "./object.hpp"
#include "./fwd.hpp"
namespace vk {
namespace cruft::vk {
struct shader_module : public owned<shader_module,device> {
};

View File

@ -15,13 +15,13 @@
* 2016, Danny Robson <danny@nerdcruft.net>
*/
#ifndef __VK_TRAITS_HPP
#define __VK_TRAITS_HPP
#ifndef CRUFT_VK_TRAITS_HPP
#define CRUFT_VK_TRAITS_HPP
#include "./fwd.hpp"
#include "./vk.hpp"
namespace vk {
namespace cruft::vk {
///////////////////////////////////////////////////////////////////////////
template <typename T> struct id_traits { };