mirror of
https://github.com/opus-tango/IntroductionToVulkan.git
synced 2026-03-20 03:55:26 +00:00
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:
@@ -10,7 +10,9 @@
|
||||
|
||||
#include "OperatingSystem.h"
|
||||
|
||||
namespace OS {
|
||||
namespace ApiWithoutSecrets {
|
||||
|
||||
namespace OS {
|
||||
|
||||
Window::Window() :
|
||||
Parameters() {
|
||||
@@ -346,4 +348,6 @@ namespace OS {
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace OS
|
||||
} // namespace OS
|
||||
|
||||
} // namespace ApiWithoutSecrets
|
||||
@@ -30,7 +30,9 @@
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
namespace OS {
|
||||
namespace ApiWithoutSecrets {
|
||||
|
||||
namespace OS {
|
||||
|
||||
// ************************************************************ //
|
||||
// LibraryHandle //
|
||||
@@ -56,7 +58,7 @@ namespace OS {
|
||||
virtual bool OnWindowSizeChanged() = 0;
|
||||
virtual bool Draw() = 0;
|
||||
|
||||
virtual ~TutorialBase( ) {
|
||||
virtual ~TutorialBase() {
|
||||
}
|
||||
};
|
||||
|
||||
@@ -114,6 +116,8 @@ namespace OS {
|
||||
WindowParameters Parameters;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace OS
|
||||
|
||||
} // namespace ApiWithoutSecrets
|
||||
|
||||
#endif // OPERATING_SYSTEM_HEADER
|
||||
@@ -12,7 +12,9 @@
|
||||
#include <iostream>
|
||||
#include "Tools.h"
|
||||
|
||||
namespace Tools {
|
||||
namespace ApiWithoutSecrets {
|
||||
|
||||
namespace Tools {
|
||||
|
||||
std::vector<char> GetBinaryFileContents( std::string const &filename ) {
|
||||
|
||||
@@ -35,4 +37,6 @@ namespace Tools {
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace Tools
|
||||
|
||||
} // namespace ApiWithoutSecrets
|
||||
@@ -15,7 +15,9 @@
|
||||
#include <vector>
|
||||
#include "vulkan.h"
|
||||
|
||||
namespace Tools {
|
||||
namespace ApiWithoutSecrets {
|
||||
|
||||
namespace Tools {
|
||||
|
||||
// ************************************************************ //
|
||||
// AutoDeleter //
|
||||
@@ -48,7 +50,7 @@ namespace Tools {
|
||||
}
|
||||
}
|
||||
|
||||
AutoDeleter& operator=( AutoDeleter&& other ) {
|
||||
AutoDeleter& operator=(AutoDeleter&& other) {
|
||||
if( this != &other ) {
|
||||
Object = other.Object;
|
||||
Deleter = other.Deleter;
|
||||
@@ -68,7 +70,7 @@ namespace Tools {
|
||||
|
||||
private:
|
||||
AutoDeleter( const AutoDeleter& );
|
||||
AutoDeleter& operator=( const AutoDeleter& );
|
||||
AutoDeleter& operator=(const AutoDeleter&);
|
||||
T Object;
|
||||
F Deleter;
|
||||
VkDevice Device;
|
||||
@@ -81,7 +83,9 @@ namespace Tools {
|
||||
// ************************************************************ //
|
||||
std::vector<char> GetBinaryFileContents( std::string const &filename );
|
||||
|
||||
}
|
||||
} // namespace Tools
|
||||
|
||||
} // namespace ApiWithoutSecrets
|
||||
|
||||
|
||||
#endif // TOOLS_HEADER
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "Tutorial01.h"
|
||||
#include "VulkanFunctions.h"
|
||||
|
||||
namespace Tutorial {
|
||||
namespace ApiWithoutSecrets {
|
||||
|
||||
Tutorial01::Tutorial01() :
|
||||
VulkanLibrary(),
|
||||
|
||||
@@ -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
|
||||
@@ -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" ) ) {
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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" ) ) {
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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" ) ) {
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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" ) ) {
|
||||
|
||||
Reference in New Issue
Block a user