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"
|
#include "OperatingSystem.h"
|
||||||
|
|
||||||
namespace OS {
|
namespace ApiWithoutSecrets {
|
||||||
|
|
||||||
|
namespace OS {
|
||||||
|
|
||||||
Window::Window() :
|
Window::Window() :
|
||||||
Parameters() {
|
Parameters() {
|
||||||
@@ -346,4 +348,6 @@ namespace OS {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace OS
|
} // namespace OS
|
||||||
|
|
||||||
|
} // namespace ApiWithoutSecrets
|
||||||
@@ -30,7 +30,9 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace OS {
|
namespace ApiWithoutSecrets {
|
||||||
|
|
||||||
|
namespace OS {
|
||||||
|
|
||||||
// ************************************************************ //
|
// ************************************************************ //
|
||||||
// LibraryHandle //
|
// LibraryHandle //
|
||||||
@@ -56,7 +58,7 @@ namespace OS {
|
|||||||
virtual bool OnWindowSizeChanged() = 0;
|
virtual bool OnWindowSizeChanged() = 0;
|
||||||
virtual bool Draw() = 0;
|
virtual bool Draw() = 0;
|
||||||
|
|
||||||
virtual ~TutorialBase( ) {
|
virtual ~TutorialBase() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -114,6 +116,8 @@ namespace OS {
|
|||||||
WindowParameters Parameters;
|
WindowParameters Parameters;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace OS
|
||||||
|
|
||||||
|
} // namespace ApiWithoutSecrets
|
||||||
|
|
||||||
#endif // OPERATING_SYSTEM_HEADER
|
#endif // OPERATING_SYSTEM_HEADER
|
||||||
@@ -12,7 +12,9 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "Tools.h"
|
#include "Tools.h"
|
||||||
|
|
||||||
namespace Tools {
|
namespace ApiWithoutSecrets {
|
||||||
|
|
||||||
|
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
|
||||||
@@ -15,7 +15,9 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include "vulkan.h"
|
#include "vulkan.h"
|
||||||
|
|
||||||
namespace Tools {
|
namespace ApiWithoutSecrets {
|
||||||
|
|
||||||
|
namespace Tools {
|
||||||
|
|
||||||
// ************************************************************ //
|
// ************************************************************ //
|
||||||
// AutoDeleter //
|
// AutoDeleter //
|
||||||
@@ -48,7 +50,7 @@ namespace Tools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoDeleter& operator=( AutoDeleter&& other ) {
|
AutoDeleter& operator=(AutoDeleter&& other) {
|
||||||
if( this != &other ) {
|
if( this != &other ) {
|
||||||
Object = other.Object;
|
Object = other.Object;
|
||||||
Deleter = other.Deleter;
|
Deleter = other.Deleter;
|
||||||
@@ -68,7 +70,7 @@ namespace Tools {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
AutoDeleter( const AutoDeleter& );
|
AutoDeleter( const AutoDeleter& );
|
||||||
AutoDeleter& operator=( const AutoDeleter& );
|
AutoDeleter& operator=(const AutoDeleter&);
|
||||||
T Object;
|
T Object;
|
||||||
F Deleter;
|
F Deleter;
|
||||||
VkDevice Device;
|
VkDevice Device;
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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(),
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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" ) ) {
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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" ) ) {
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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" ) ) {
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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" ) ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user