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"
namespace ApiWithoutSecrets {
namespace OS {
Window::Window() :
@@ -347,3 +349,5 @@ namespace OS {
#endif
} // namespace OS
} // namespace ApiWithoutSecrets

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -10,9 +10,13 @@
#include "vulkan.h"
namespace ApiWithoutSecrets {
#define VK_EXPORTED_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_DEVICE_LEVEL_FUNCTION( fun ) PFN_##fun fun;
#include "ListOfFunctions.inl"
} // namespace ApiWithoutSecrets

View File

@@ -13,6 +13,8 @@
#include "vulkan.h"
namespace ApiWithoutSecrets {
#define VK_EXPORTED_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;
@@ -20,4 +22,6 @@
#include "ListOfFunctions.inl"
} // namespace ApiWithoutSecrets
#endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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