Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Commit 2592271

Browse files
committed
Renamed base class used in tutorials.
1 parent 906cd3f commit 2592271

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

Project/Common/OperatingSystem.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace ApiWithoutSecrets {
3232

3333
#if defined(VK_USE_PLATFORM_WIN32_KHR)
3434

35-
#define TUTORIAL_NAME "API without Secrets: Introduction to Vulkan"
35+
#define SERIES_NAME "API without Secrets: Introduction to Vulkan"
3636

3737
LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) {
3838
switch( message ) {
@@ -56,7 +56,7 @@ namespace ApiWithoutSecrets {
5656
}
5757

5858
if( Parameters.Instance ) {
59-
UnregisterClass( TUTORIAL_NAME, Parameters.Instance );
59+
UnregisterClass( SERIES_NAME, Parameters.Instance );
6060
}
6161
}
6262

@@ -77,23 +77,23 @@ namespace ApiWithoutSecrets {
7777
wcex.hCursor = LoadCursor( NULL, IDC_ARROW );
7878
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
7979
wcex.lpszMenuName = NULL;
80-
wcex.lpszClassName = TUTORIAL_NAME;
80+
wcex.lpszClassName = SERIES_NAME;
8181
wcex.hIconSm = NULL;
8282

8383
if( !RegisterClassEx( &wcex ) ) {
8484
return false;
8585
}
8686

8787
// Create window
88-
Parameters.Handle = CreateWindow( TUTORIAL_NAME, title, WS_OVERLAPPEDWINDOW, 20, 20, 500, 500, nullptr, nullptr, Parameters.Instance, nullptr );
88+
Parameters.Handle = CreateWindow( SERIES_NAME, title, WS_OVERLAPPEDWINDOW, 20, 20, 500, 500, nullptr, nullptr, Parameters.Instance, nullptr );
8989
if( !Parameters.Handle ) {
9090
return false;
9191
}
9292

9393
return true;
9494
}
9595

96-
bool Window::RenderingLoop( TutorialBase &tutorial ) const {
96+
bool Window::RenderingLoop( ProjectBase &project ) const {
9797
// Display window
9898
ShowWindow( Parameters.Handle, SW_SHOWNORMAL );
9999
UpdateWindow( Parameters.Handle );
@@ -123,13 +123,13 @@ namespace ApiWithoutSecrets {
123123
// Draw
124124
if( resize ) {
125125
resize = false;
126-
if( !tutorial.OnWindowSizeChanged() ) {
126+
if( !project.OnWindowSizeChanged() ) {
127127
result = false;
128128
break;
129129
}
130130
}
131-
if( tutorial.ReadyToDraw() ) {
132-
if( !tutorial.Draw() ) {
131+
if( project.ReadyToDraw() ) {
132+
if( !project.Draw() ) {
133133
result = false;
134134
break;
135135
}
@@ -203,7 +203,7 @@ namespace ApiWithoutSecrets {
203203
return true;
204204
}
205205

206-
bool Window::RenderingLoop( TutorialBase &tutorial ) const {
206+
bool Window::RenderingLoop( ProjectBase &project ) const {
207207
// Prepare notification for window destruction
208208
xcb_intern_atom_cookie_t protocols_cookie = xcb_intern_atom( Parameters.Connection, 1, 12, "WM_PROTOCOLS" );
209209
xcb_intern_atom_reply_t *protocols_reply = xcb_intern_atom_reply( Parameters.Connection, protocols_cookie, 0 );
@@ -258,13 +258,13 @@ namespace ApiWithoutSecrets {
258258
// Draw
259259
if( resize ) {
260260
resize = false;
261-
if( !tutorial.OnWindowSizeChanged() ) {
261+
if( !project.OnWindowSizeChanged() ) {
262262
result = false;
263263
break;
264264
}
265265
}
266-
if( tutorial.ReadyToDraw() ) {
267-
if( !tutorial.Draw() ) {
266+
if( project.ReadyToDraw() ) {
267+
if( !project.Draw() ) {
268268
result = false;
269269
break;
270270
}
@@ -310,7 +310,7 @@ namespace ApiWithoutSecrets {
310310
return true;
311311
}
312312

313-
bool Window::RenderingLoop( TutorialBase &tutorial ) const {
313+
bool Window::RenderingLoop( ProjectBase &project ) const {
314314
// Prepare notification for window destruction
315315
Atom delete_window_atom;
316316
delete_window_atom = XInternAtom( Parameters.DisplayPtr, "WM_DELETE_WINDOW", false );
@@ -359,13 +359,13 @@ namespace ApiWithoutSecrets {
359359
// Draw
360360
if( resize ) {
361361
resize = false;
362-
if( !tutorial.OnWindowSizeChanged() ) {
362+
if( !project.OnWindowSizeChanged() ) {
363363
result = false;
364364
break;
365365
}
366366
}
367-
if( tutorial.ReadyToDraw() ) {
368-
if( !tutorial.Draw() ) {
367+
if( project.ReadyToDraw() ) {
368+
if( !project.Draw() ) {
369369
result = false;
370370
break;
371371
}

Project/Common/OperatingSystem.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ namespace ApiWithoutSecrets {
5555
#endif
5656

5757
// ************************************************************ //
58-
// OnWindowSizeChanged //
58+
// ProjectBase //
5959
// //
60-
// Base class for handling window size changes //
60+
// Base class for handling window size changes and drawing //
6161
// ************************************************************ //
62-
class TutorialBase {
62+
class ProjectBase {
6363
public:
6464
virtual bool OnWindowSizeChanged() = 0;
6565
virtual bool Draw() = 0;
@@ -68,11 +68,11 @@ namespace ApiWithoutSecrets {
6868
return CanRender;
6969
}
7070

71-
TutorialBase() :
71+
ProjectBase() :
7272
CanRender( false ) {
7373
}
7474

75-
virtual ~TutorialBase() {
75+
virtual ~ProjectBase() {
7676
}
7777

7878
protected:
@@ -126,7 +126,7 @@ namespace ApiWithoutSecrets {
126126
~Window();
127127

128128
bool Create( const char *title );
129-
bool RenderingLoop( TutorialBase &tutorial ) const;
129+
bool RenderingLoop( ProjectBase &project ) const;
130130
WindowParameters GetParameters() const;
131131

132132
private:

Project/Common/VulkanCommon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ namespace ApiWithoutSecrets {
106106
// //
107107
// Base class for Vulkan more advanced tutorial classes //
108108
// ************************************************************ //
109-
class VulkanCommon : public OS::TutorialBase {
109+
class VulkanCommon : public OS::ProjectBase {
110110
public:
111111
VulkanCommon();
112112
virtual ~VulkanCommon();

Project/Tutorials/01/Tutorial01.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace ApiWithoutSecrets {
4646
// //
4747
// Class for presenting Vulkan usage topics //
4848
// ************************************************************ //
49-
class Tutorial01 : public OS::TutorialBase {
49+
class Tutorial01 : public OS::ProjectBase {
5050
public:
5151
Tutorial01();
5252
~Tutorial01();

Project/Tutorials/02/Tutorial02.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ namespace ApiWithoutSecrets {
6363
// //
6464
// Class for presenting Vulkan usage topics //
6565
// ************************************************************ //
66-
class Tutorial02 : public OS::TutorialBase {
66+
class Tutorial02 : public OS::ProjectBase {
6767
public:
6868
Tutorial02();
6969
~Tutorial02();

0 commit comments

Comments
 (0)