Renamed "Tutorial" namespace to "ApiWithoutSecrets". Added ApiWithoutSecrets namescape to all files. Placed function pointers in an ApiWithoutSecrets namespace to fix errors on Linux.

This commit is contained in:
plapins
2016-04-13 09:27:27 +02:00
parent d34da4e8e0
commit 95675bd125
20 changed files with 423 additions and 399 deletions

View File

@@ -10,6 +10,8 @@
#include "OperatingSystem.h" #include "OperatingSystem.h"
namespace ApiWithoutSecrets {
namespace OS { namespace OS {
Window::Window() : Window::Window() :
@@ -347,3 +349,5 @@ namespace OS {
#endif #endif
} // namespace OS } // namespace OS
} // namespace ApiWithoutSecrets

View File

@@ -30,6 +30,8 @@
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
namespace ApiWithoutSecrets {
namespace OS { namespace OS {
// ************************************************************ // // ************************************************************ //
@@ -114,6 +116,8 @@ namespace OS {
WindowParameters Parameters; WindowParameters Parameters;
}; };
} } // namespace OS
} // namespace ApiWithoutSecrets
#endif // OPERATING_SYSTEM_HEADER #endif // OPERATING_SYSTEM_HEADER

View File

@@ -12,6 +12,8 @@
#include <iostream> #include <iostream>
#include "Tools.h" #include "Tools.h"
namespace ApiWithoutSecrets {
namespace Tools { namespace Tools {
std::vector<char> GetBinaryFileContents( std::string const &filename ) { std::vector<char> GetBinaryFileContents( std::string const &filename ) {
@@ -35,4 +37,6 @@ namespace Tools {
return result; return result;
} }
} } // namespace Tools
} // namespace ApiWithoutSecrets

View File

@@ -15,6 +15,8 @@
#include <vector> #include <vector>
#include "vulkan.h" #include "vulkan.h"
namespace ApiWithoutSecrets {
namespace Tools { namespace Tools {
// ************************************************************ // // ************************************************************ //
@@ -81,7 +83,9 @@ namespace Tools {
// ************************************************************ // // ************************************************************ //
std::vector<char> GetBinaryFileContents( std::string const &filename ); std::vector<char> GetBinaryFileContents( std::string const &filename );
} } // namespace Tools
} // namespace ApiWithoutSecrets
#endif // TOOLS_HEADER #endif // TOOLS_HEADER

View File

@@ -11,7 +11,7 @@
#include "VulkanCommon.h" #include "VulkanCommon.h"
#include "VulkanFunctions.h" #include "VulkanFunctions.h"
namespace Tutorial { namespace ApiWithoutSecrets {
VulkanCommon::VulkanCommon() : VulkanCommon::VulkanCommon() :
VulkanLibrary(), VulkanLibrary(),
@@ -707,4 +707,4 @@ namespace Tutorial {
} }
} }
} // namespace Tutorial } // namespace ApiWithoutSecrets

View File

@@ -15,7 +15,7 @@
#include "vulkan.h" #include "vulkan.h"
#include "OperatingSystem.h" #include "OperatingSystem.h"
namespace Tutorial { namespace ApiWithoutSecrets {
// ************************************************************ // // ************************************************************ //
// QueueParameters // // QueueParameters //
@@ -129,6 +129,6 @@ namespace Tutorial {
VkPresentModeKHR GetSwapChainPresentMode( std::vector<VkPresentModeKHR> &present_modes ); VkPresentModeKHR GetSwapChainPresentMode( std::vector<VkPresentModeKHR> &present_modes );
}; };
} // namespace Tutorial } // namespace ApiWithoutSecrets
#endif // VULKAN_COMMON_HEADER #endif // VULKAN_COMMON_HEADER

View File

@@ -10,9 +10,13 @@
#include "vulkan.h" #include "vulkan.h"
namespace ApiWithoutSecrets {
#define VK_EXPORTED_FUNCTION( fun ) PFN_##fun fun; #define VK_EXPORTED_FUNCTION( fun ) PFN_##fun fun;
#define VK_GLOBAL_LEVEL_FUNCTION( fun ) PFN_##fun fun; #define VK_GLOBAL_LEVEL_FUNCTION( fun ) PFN_##fun fun;
#define VK_INSTANCE_LEVEL_FUNCTION( fun ) PFN_##fun fun; #define VK_INSTANCE_LEVEL_FUNCTION( fun ) PFN_##fun fun;
#define VK_DEVICE_LEVEL_FUNCTION( fun ) PFN_##fun fun; #define VK_DEVICE_LEVEL_FUNCTION( fun ) PFN_##fun fun;
#include "ListOfFunctions.inl" #include "ListOfFunctions.inl"
} // namespace ApiWithoutSecrets

View File

@@ -13,6 +13,8 @@
#include "vulkan.h" #include "vulkan.h"
namespace ApiWithoutSecrets {
#define VK_EXPORTED_FUNCTION( fun ) extern PFN_##fun fun; #define VK_EXPORTED_FUNCTION( fun ) extern PFN_##fun fun;
#define VK_GLOBAL_LEVEL_FUNCTION( fun) extern PFN_##fun fun; #define VK_GLOBAL_LEVEL_FUNCTION( fun) extern PFN_##fun fun;
#define VK_INSTANCE_LEVEL_FUNCTION( fun ) extern PFN_##fun fun; #define VK_INSTANCE_LEVEL_FUNCTION( fun ) extern PFN_##fun fun;
@@ -20,4 +22,6 @@
#include "ListOfFunctions.inl" #include "ListOfFunctions.inl"
} // namespace ApiWithoutSecrets
#endif #endif

View File

@@ -12,7 +12,7 @@
#include "Tutorial01.h" #include "Tutorial01.h"
#include "VulkanFunctions.h" #include "VulkanFunctions.h"
namespace Tutorial { namespace ApiWithoutSecrets {
Tutorial01::Tutorial01() : Tutorial01::Tutorial01() :
VulkanLibrary(), VulkanLibrary(),

View File

@@ -14,7 +14,7 @@
#include "vulkan.h" #include "vulkan.h"
#include "OperatingSystem.h" #include "OperatingSystem.h"
namespace Tutorial { namespace ApiWithoutSecrets {
// ************************************************************ // // ************************************************************ //
// VulkanTutorial01Parameters // // VulkanTutorial01Parameters //
@@ -65,6 +65,6 @@ namespace Tutorial {
bool GetDeviceQueue(); bool GetDeviceQueue();
}; };
} // namespace Tutorial } // namespace ApiWithoutSecrets
#endif // TUTORIAL_01_HEADER #endif // TUTORIAL_01_HEADER

View File

@@ -11,8 +11,8 @@
#include "Tutorial01.h" #include "Tutorial01.h"
int main( int argc, char **argv ) { int main( int argc, char **argv ) {
OS::Window window; ApiWithoutSecrets::OS::Window window;
Tutorial::Tutorial01 tutorial01; ApiWithoutSecrets::Tutorial01 tutorial01;
// Window creation // Window creation
if( !window.Create( "01 - The Beginning" ) ) { if( !window.Create( "01 - The Beginning" ) ) {

View File

@@ -11,7 +11,7 @@
#include "Tutorial02.h" #include "Tutorial02.h"
#include "VulkanFunctions.h" #include "VulkanFunctions.h"
namespace Tutorial { namespace ApiWithoutSecrets {
Tutorial02::Tutorial02() : Tutorial02::Tutorial02() :
VulkanLibrary(), VulkanLibrary(),
@@ -851,4 +851,4 @@ namespace Tutorial {
} }
} }
} // namespace Tutorial } // namespace ApiWithoutSecrets

View File

@@ -15,7 +15,7 @@
#include "vulkan.h" #include "vulkan.h"
#include "OperatingSystem.h" #include "OperatingSystem.h"
namespace Tutorial { namespace ApiWithoutSecrets {
// ************************************************************ // // ************************************************************ //
// VulkanTutorial02Parameters // // VulkanTutorial02Parameters //
@@ -96,6 +96,6 @@ namespace Tutorial {
VkPresentModeKHR GetSwapChainPresentMode( std::vector<VkPresentModeKHR> &present_modes ); VkPresentModeKHR GetSwapChainPresentMode( std::vector<VkPresentModeKHR> &present_modes );
}; };
} // namespace Tutorial } // namespace ApiWithoutSecrets
#endif // TUTORIAL_02_HEADER #endif // TUTORIAL_02_HEADER

View File

@@ -11,8 +11,8 @@
#include "Tutorial02.h" #include "Tutorial02.h"
int main( int argc, char **argv ) { int main( int argc, char **argv ) {
OS::Window window; ApiWithoutSecrets::OS::Window window;
Tutorial::Tutorial02 tutorial02; ApiWithoutSecrets::Tutorial02 tutorial02;
// Window creation // Window creation
if( !window.Create( "02 - Swap chain" ) ) { if( !window.Create( "02 - Swap chain" ) ) {

View File

@@ -11,7 +11,7 @@
#include "Tutorial03.h" #include "Tutorial03.h"
#include "VulkanFunctions.h" #include "VulkanFunctions.h"
namespace Tutorial { namespace ApiWithoutSecrets {
Tutorial03::Tutorial03() : Tutorial03::Tutorial03() :
Vulkan() { Vulkan() {
@@ -593,4 +593,4 @@ namespace Tutorial {
ChildClear(); ChildClear();
} }
} // namespace Tutorial } // namespace ApiWithoutSecrets

View File

@@ -14,7 +14,7 @@
#include "VulkanCommon.h" #include "VulkanCommon.h"
#include "Tools.h" #include "Tools.h"
namespace Tutorial { namespace ApiWithoutSecrets {
// ************************************************************ // // ************************************************************ //
// FramebufferObject // // FramebufferObject //
@@ -77,6 +77,6 @@ namespace Tutorial {
bool ChildOnWindowSizeChanged() override; bool ChildOnWindowSizeChanged() override;
}; };
} // namespace Tutorial } // namespace ApiWithoutSecrets
#endif // TUTORIAL_03_HEADER #endif // TUTORIAL_03_HEADER

View File

@@ -11,8 +11,8 @@
#include "Tutorial03.h" #include "Tutorial03.h"
int main( int argc, char **argv ) { int main( int argc, char **argv ) {
OS::Window window; ApiWithoutSecrets::OS::Window window;
Tutorial::Tutorial03 tutorial03; ApiWithoutSecrets::Tutorial03 tutorial03;
// Window creation // Window creation
if( !window.Create( "03 - First Triangle" ) ) { if( !window.Create( "03 - First Triangle" ) ) {

View File

@@ -11,7 +11,7 @@
#include "Tutorial04.h" #include "Tutorial04.h"
#include "VulkanFunctions.h" #include "VulkanFunctions.h"
namespace Tutorial { namespace ApiWithoutSecrets {
Tutorial04::Tutorial04() : Tutorial04::Tutorial04() :
Vulkan() { Vulkan() {
@@ -915,4 +915,4 @@ namespace Tutorial {
} }
} }
} // namespace Tutorial } // namespace ApiWithoutSecrets

View File

@@ -14,7 +14,7 @@
#include "VulkanCommon.h" #include "VulkanCommon.h"
#include "Tools.h" #include "Tools.h"
namespace Tutorial { namespace ApiWithoutSecrets {
// ************************************************************ // // ************************************************************ //
// ImageParameters // // ImageParameters //
@@ -127,6 +127,6 @@ namespace Tutorial {
bool ChildOnWindowSizeChanged() override; bool ChildOnWindowSizeChanged() override;
}; };
} // namespace Tutorial } // namespace ApiWithoutSecrets
#endif // TUTORIAL_03_HEADER #endif // TUTORIAL_03_HEADER

View File

@@ -11,8 +11,8 @@
#include "Tutorial04.h" #include "Tutorial04.h"
int main( int argc, char **argv ) { int main( int argc, char **argv ) {
OS::Window window; ApiWithoutSecrets::OS::Window window;
Tutorial::Tutorial04 tutorial04; ApiWithoutSecrets::Tutorial04 tutorial04;
// Window creation // Window creation
if( !window.Create( "04 - Vertex Attributes" ) ) { if( !window.Create( "04 - Vertex Attributes" ) ) {