Improve usability

- Enable enhanced mode by default, use VKCPP_DISABLE_ENHANCED_MODE to disable it
- Rename vk_cpp.h to vk_cpp.hpp to be more standard-conform with regards to naming
- Automatically use vk.xml from submodule if no other file has be specified
- Generate header in vulkand folder to avoid copying the file after generating it
- Catch exceptions in generator
This commit is contained in:
Markus Tavenrath 2016-04-12 11:36:14 +02:00
parent 8f8148bfd2
commit 3359b16c39
4 changed files with 3353 additions and 3330 deletions

View File

@ -28,6 +28,14 @@ cmake_minimum_required(VERSION 3.2)
project(VkCppGenerator) project(VkCppGenerator)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Docs/src/spec/vk.xml vk_spec)
string(REPLACE "\\" "\\\\" vk_spec ${vk_spec})
add_definitions(-DVK_SPEC="${vk_spec}")
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/vulkan/vk_cpp.hpp vk_cpp)
string(REPLACE "\\" "\\\\" vk_cpp ${vk_cpp})
add_definitions(-DVK_CPP="${vk_cpp}")
set(HEADERS set(HEADERS
) )

View File

@ -136,7 +136,7 @@ device.createImage(&ci, allocator, &image);
# Enhancements beyond native Vulkan # Enhancements beyond native Vulkan
To provide a more object oriented feeling we're providing classes for each handle which include all Vulkan functions where the first To provide a more object oriented feeling we're providing classes for each handle which include all Vulkan functions where the first
parameter matches the handle. In addition to this we made a few changes to the signatures of the member functions parameter matches the handle. In addition to this we made a few changes to the signatures of the member functions
* To enable the enhanced mode put ```#define VKCPP_ENHANCED_MODE``` before including ```vk_cpp.h``` * To disable the enhanced mode put ```#define VKCPP_DISABLE_ENHANCED_MODE``` before including ```vk_cpp.h```
* ```(count, T*)``` has been replaced by ```std::vector<T>``` * ```(count, T*)``` has been replaced by ```std::vector<T>```
* ```const char *``` has been replaced by ```std::string ``` * ```const char *``` has been replaced by ```std::string ```
* ```T const*``` has been replaced by ```T const &``` to allow temporary objects. This is useful to pass small structures like ```vk::ClearColorValue``` or ```vk::Extent*``` * ```T const*``` has been replaced by ```T const &``` to allow temporary objects. This is useful to pass small structures like ```vk::ClearColorValue``` or ```vk::Extent*```

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff