From 2592271bfa48c5c45b4865febfd82fcbeb2693ed Mon Sep 17 00:00:00 2001 From: Pawel Lapinski Date: Mon, 26 Feb 2018 22:48:01 +0100 Subject: [PATCH] Renamed base class used in tutorials. --- Project/Common/OperatingSystem.cpp | 32 +++++++++++++++--------------- Project/Common/OperatingSystem.h | 12 +++++------ Project/Common/VulkanCommon.h | 2 +- Project/Tutorials/01/Tutorial01.h | 2 +- Project/Tutorials/02/Tutorial02.h | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Project/Common/OperatingSystem.cpp b/Project/Common/OperatingSystem.cpp index b738092..d8e10cd 100644 --- a/Project/Common/OperatingSystem.cpp +++ b/Project/Common/OperatingSystem.cpp @@ -32,7 +32,7 @@ namespace ApiWithoutSecrets { #if defined(VK_USE_PLATFORM_WIN32_KHR) -#define TUTORIAL_NAME "API without Secrets: Introduction to Vulkan" +#define SERIES_NAME "API without Secrets: Introduction to Vulkan" LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { switch( message ) { @@ -56,7 +56,7 @@ namespace ApiWithoutSecrets { } if( Parameters.Instance ) { - UnregisterClass( TUTORIAL_NAME, Parameters.Instance ); + UnregisterClass( SERIES_NAME, Parameters.Instance ); } } @@ -77,7 +77,7 @@ namespace ApiWithoutSecrets { wcex.hCursor = LoadCursor( NULL, IDC_ARROW ); wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wcex.lpszMenuName = NULL; - wcex.lpszClassName = TUTORIAL_NAME; + wcex.lpszClassName = SERIES_NAME; wcex.hIconSm = NULL; if( !RegisterClassEx( &wcex ) ) { @@ -85,7 +85,7 @@ namespace ApiWithoutSecrets { } // Create window - Parameters.Handle = CreateWindow( TUTORIAL_NAME, title, WS_OVERLAPPEDWINDOW, 20, 20, 500, 500, nullptr, nullptr, Parameters.Instance, nullptr ); + Parameters.Handle = CreateWindow( SERIES_NAME, title, WS_OVERLAPPEDWINDOW, 20, 20, 500, 500, nullptr, nullptr, Parameters.Instance, nullptr ); if( !Parameters.Handle ) { return false; } @@ -93,7 +93,7 @@ namespace ApiWithoutSecrets { return true; } - bool Window::RenderingLoop( TutorialBase &tutorial ) const { + bool Window::RenderingLoop( ProjectBase &project ) const { // Display window ShowWindow( Parameters.Handle, SW_SHOWNORMAL ); UpdateWindow( Parameters.Handle ); @@ -123,13 +123,13 @@ namespace ApiWithoutSecrets { // Draw if( resize ) { resize = false; - if( !tutorial.OnWindowSizeChanged() ) { + if( !project.OnWindowSizeChanged() ) { result = false; break; } } - if( tutorial.ReadyToDraw() ) { - if( !tutorial.Draw() ) { + if( project.ReadyToDraw() ) { + if( !project.Draw() ) { result = false; break; } @@ -203,7 +203,7 @@ namespace ApiWithoutSecrets { return true; } - bool Window::RenderingLoop( TutorialBase &tutorial ) const { + bool Window::RenderingLoop( ProjectBase &project ) const { // Prepare notification for window destruction xcb_intern_atom_cookie_t protocols_cookie = xcb_intern_atom( Parameters.Connection, 1, 12, "WM_PROTOCOLS" ); xcb_intern_atom_reply_t *protocols_reply = xcb_intern_atom_reply( Parameters.Connection, protocols_cookie, 0 ); @@ -258,13 +258,13 @@ namespace ApiWithoutSecrets { // Draw if( resize ) { resize = false; - if( !tutorial.OnWindowSizeChanged() ) { + if( !project.OnWindowSizeChanged() ) { result = false; break; } } - if( tutorial.ReadyToDraw() ) { - if( !tutorial.Draw() ) { + if( project.ReadyToDraw() ) { + if( !project.Draw() ) { result = false; break; } @@ -310,7 +310,7 @@ namespace ApiWithoutSecrets { return true; } - bool Window::RenderingLoop( TutorialBase &tutorial ) const { + bool Window::RenderingLoop( ProjectBase &project ) const { // Prepare notification for window destruction Atom delete_window_atom; delete_window_atom = XInternAtom( Parameters.DisplayPtr, "WM_DELETE_WINDOW", false ); @@ -359,13 +359,13 @@ namespace ApiWithoutSecrets { // Draw if( resize ) { resize = false; - if( !tutorial.OnWindowSizeChanged() ) { + if( !project.OnWindowSizeChanged() ) { result = false; break; } } - if( tutorial.ReadyToDraw() ) { - if( !tutorial.Draw() ) { + if( project.ReadyToDraw() ) { + if( !project.Draw() ) { result = false; break; } diff --git a/Project/Common/OperatingSystem.h b/Project/Common/OperatingSystem.h index 15d6a29..5ee7b56 100644 --- a/Project/Common/OperatingSystem.h +++ b/Project/Common/OperatingSystem.h @@ -55,11 +55,11 @@ namespace ApiWithoutSecrets { #endif // ************************************************************ // - // OnWindowSizeChanged // + // ProjectBase // // // - // Base class for handling window size changes // + // Base class for handling window size changes and drawing // // ************************************************************ // - class TutorialBase { + class ProjectBase { public: virtual bool OnWindowSizeChanged() = 0; virtual bool Draw() = 0; @@ -68,11 +68,11 @@ namespace ApiWithoutSecrets { return CanRender; } - TutorialBase() : + ProjectBase() : CanRender( false ) { } - virtual ~TutorialBase() { + virtual ~ProjectBase() { } protected: @@ -126,7 +126,7 @@ namespace ApiWithoutSecrets { ~Window(); bool Create( const char *title ); - bool RenderingLoop( TutorialBase &tutorial ) const; + bool RenderingLoop( ProjectBase &project ) const; WindowParameters GetParameters() const; private: diff --git a/Project/Common/VulkanCommon.h b/Project/Common/VulkanCommon.h index 9b00a71..1403f99 100644 --- a/Project/Common/VulkanCommon.h +++ b/Project/Common/VulkanCommon.h @@ -106,7 +106,7 @@ namespace ApiWithoutSecrets { // // // Base class for Vulkan more advanced tutorial classes // // ************************************************************ // - class VulkanCommon : public OS::TutorialBase { + class VulkanCommon : public OS::ProjectBase { public: VulkanCommon(); virtual ~VulkanCommon(); diff --git a/Project/Tutorials/01/Tutorial01.h b/Project/Tutorials/01/Tutorial01.h index 5bcb3dc..692b770 100644 --- a/Project/Tutorials/01/Tutorial01.h +++ b/Project/Tutorials/01/Tutorial01.h @@ -46,7 +46,7 @@ namespace ApiWithoutSecrets { // // // Class for presenting Vulkan usage topics // // ************************************************************ // - class Tutorial01 : public OS::TutorialBase { + class Tutorial01 : public OS::ProjectBase { public: Tutorial01(); ~Tutorial01(); diff --git a/Project/Tutorials/02/Tutorial02.h b/Project/Tutorials/02/Tutorial02.h index efdfd69..68c53c9 100644 --- a/Project/Tutorials/02/Tutorial02.h +++ b/Project/Tutorials/02/Tutorial02.h @@ -63,7 +63,7 @@ namespace ApiWithoutSecrets { // // // Class for presenting Vulkan usage topics // // ************************************************************ // - class Tutorial02 : public OS::TutorialBase { + class Tutorial02 : public OS::ProjectBase { public: Tutorial02(); ~Tutorial02();