<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: Beginning C++ Game Programming 2nd Edition</title>
	<atom:link href="https://gamecodeschool.com/books/beginning-c-plus-plus-game-programming-2nd-edition/feed/" rel="self" type="application/rss+xml" />
	<link>https://gamecodeschool.com/books/beginning-c-plus-plus-game-programming-2nd-edition/</link>
	<description>Game Coding for Beginners</description>
	<lastBuildDate>Mon, 20 Apr 2026 12:04:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>By: Paul Savage</title>
		<link>https://gamecodeschool.com/books/beginning-c-plus-plus-game-programming-2nd-edition/#comment-17424</link>
		<dc:creator><![CDATA[Paul Savage]]></dc:creator>
		<pubDate>Thu, 28 Sep 2023 08:29:09 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=16279#comment-17424</guid>
		<description><![CDATA[I have just finished reading the Kindle version of &quot;Beginning C++ Game Programming&quot; 2nd edition by John Horton, purchased from Amazon.

I very much enjoyed the book, but I have one question that I have not been able to resolve, even after extensive &#039;Googling&#039; (perhaps I am not formulating the query correctly). The question relates to the overriding of various virtual functions. In the following header files:

LevelManager.h
ScreenManager.h
BulletUpdateComponent.h
ColliderComponent.h
GraphicsComponent.h
InvaderUpdateComponent.h
PlayerUpdateComponent.h
RectColliderComponent.h
StandardGraphicsComponent.h
TransformComponent.h
UpdateComponent.h
GameScreen.h

There are various overrides for inherited virtual functions. Most, but not all, the functions are qualified by the class name in which the virtual function is first declared. For example, in ScreenManager.h, the ScreenManager class inherits from the ScreenManagerRemoteControl class and overrides:

	virtual void SwitchScreens(std::string screenToSwitchTo) = 0;
	virtual void loadLevelInPlayMode(std::string screenToLoad) = 0;
	virtual std::vector&amp; getGameObjects() = 0;
	virtual GameObjectSharer&amp; shareGameObjectSharer() = 0;

The first three overriden functions in ScreenManager.h have the function names qualified by the ScreenManagerRemoteControl class:

	void ScreenManagerRemoteControl::SwitchScreens(string screenToSwitchTo)
	{
		m_CurrentScreen = &quot;&quot; + screenToSwitchTo;
		m_Screens[m_CurrentScreen]-&gt;initialise();
	}

	void ScreenManagerRemoteControl::loadLevelInPlayMode(string screenToLoad)
	{
		m_LevelManager.getGameObjects().clear();
		m_LevelManager.
			loadGameObjectsForPlayMode(screenToLoad);
		SwitchScreens(&quot;Game&quot;);
	}

	vector&amp; ScreenManagerRemoteControl::getGameObjects()
	{
		return m_LevelManager.getGameObjects();
	}

The fourth function, however, does not i.e.:

	GameObjectSharer&amp; shareGameObjectSharer()
	{
		return m_LevelManager;
	}

I&#039;ve noticed that if I remove all class name qualifiers from all the headers, the game still compiles and runs.

My question is: under what circumstances do the inherited functions need to be qualified by the original class names?]]></description>
		<content:encoded><![CDATA[<p>I have just finished reading the Kindle version of &#8220;Beginning C++ Game Programming&#8221; 2nd edition by John Horton, purchased from Amazon.</p>
<p>I very much enjoyed the book, but I have one question that I have not been able to resolve, even after extensive &#8216;Googling&#8217; (perhaps I am not formulating the query correctly). The question relates to the overriding of various virtual functions. In the following header files:</p>
<p>LevelManager.h<br />
ScreenManager.h<br />
BulletUpdateComponent.h<br />
ColliderComponent.h<br />
GraphicsComponent.h<br />
InvaderUpdateComponent.h<br />
PlayerUpdateComponent.h<br />
RectColliderComponent.h<br />
StandardGraphicsComponent.h<br />
TransformComponent.h<br />
UpdateComponent.h<br />
GameScreen.h</p>
<p>There are various overrides for inherited virtual functions. Most, but not all, the functions are qualified by the class name in which the virtual function is first declared. For example, in ScreenManager.h, the ScreenManager class inherits from the ScreenManagerRemoteControl class and overrides:</p>
<p>	virtual void SwitchScreens(std::string screenToSwitchTo) = 0;<br />
	virtual void loadLevelInPlayMode(std::string screenToLoad) = 0;<br />
	virtual std::vector&amp; getGameObjects() = 0;<br />
	virtual GameObjectSharer&amp; shareGameObjectSharer() = 0;</p>
<p>The first three overriden functions in ScreenManager.h have the function names qualified by the ScreenManagerRemoteControl class:</p>
<p>	void ScreenManagerRemoteControl::SwitchScreens(string screenToSwitchTo)<br />
	{<br />
		m_CurrentScreen = &#8220;&#8221; + screenToSwitchTo;<br />
		m_Screens[m_CurrentScreen]-&gt;initialise();<br />
	}</p>
<p>	void ScreenManagerRemoteControl::loadLevelInPlayMode(string screenToLoad)<br />
	{<br />
		m_LevelManager.getGameObjects().clear();<br />
		m_LevelManager.<br />
			loadGameObjectsForPlayMode(screenToLoad);<br />
		SwitchScreens(&#8220;Game&#8221;);<br />
	}</p>
<p>	vector&amp; ScreenManagerRemoteControl::getGameObjects()<br />
	{<br />
		return m_LevelManager.getGameObjects();<br />
	}</p>
<p>The fourth function, however, does not i.e.:</p>
<p>	GameObjectSharer&amp; shareGameObjectSharer()<br />
	{<br />
		return m_LevelManager;<br />
	}</p>
<p>I&#8217;ve noticed that if I remove all class name qualifiers from all the headers, the game still compiles and runs.</p>
<p>My question is: under what circumstances do the inherited functions need to be qualified by the original class names?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve B</title>
		<link>https://gamecodeschool.com/books/beginning-c-plus-plus-game-programming-2nd-edition/#comment-17420</link>
		<dc:creator><![CDATA[Steve B]]></dc:creator>
		<pubDate>Wed, 24 May 2023 20:04:52 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=16279#comment-17420</guid>
		<description><![CDATA[Apologies - I found the answer in the downloaded source code.]]></description>
		<content:encoded><![CDATA[<p>Apologies &#8211; I found the answer in the downloaded source code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve B</title>
		<link>https://gamecodeschool.com/books/beginning-c-plus-plus-game-programming-2nd-edition/#comment-17419</link>
		<dc:creator><![CDATA[Steve B]]></dc:creator>
		<pubDate>Tue, 23 May 2023 19:34:11 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=16279#comment-17419</guid>
		<description><![CDATA[Dear John, 

First thanks for your book, I&#039;m learning a lot. I&#039;ve entered all the code for Space Invaders ++ but there seems to be a small part missing and I can&#039;t figure it out as I&#039;m new to component-based systems: Could you give me the code? 

in GameInputHandler.h the shared pointers m_PUC and m_PTC are declared but they are not initialised anywhere, and I think this is why the game crashes. Where and how should I do this?]]></description>
		<content:encoded><![CDATA[<p>Dear John, </p>
<p>First thanks for your book, I&#8217;m learning a lot. I&#8217;ve entered all the code for Space Invaders ++ but there seems to be a small part missing and I can&#8217;t figure it out as I&#8217;m new to component-based systems: Could you give me the code? </p>
<p>in GameInputHandler.h the shared pointers m_PUC and m_PTC are declared but they are not initialised anywhere, and I think this is why the game crashes. Where and how should I do this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Horton</title>
		<link>https://gamecodeschool.com/books/beginning-c-plus-plus-game-programming-2nd-edition/#comment-17415</link>
		<dc:creator><![CDATA[John Horton]]></dc:creator>
		<pubDate>Sun, 08 Jan 2023 12:30:49 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=16279#comment-17415</guid>
		<description><![CDATA[I think Armando is saying change 
Pickup::Pickup(int type)
to
Pickup(int type)]]></description>
		<content:encoded><![CDATA[<p>I think Armando is saying change<br />
Pickup::Pickup(int type)<br />
to<br />
Pickup(int type)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Den</title>
		<link>https://gamecodeschool.com/books/beginning-c-plus-plus-game-programming-2nd-edition/#comment-17414</link>
		<dc:creator><![CDATA[Den]]></dc:creator>
		<pubDate>Fri, 06 Jan 2023 22:45:30 +0000</pubDate>
		<guid isPermaLink="false">http://gamecodeschool.com/?p=16279#comment-17414</guid>
		<description><![CDATA[Dear John! I read above Armando L October 8, 2021 about the solution to the error. But I didn&#039;t understand what needed to change. In Pickup.h at line 38 need Pickup::Pickup(int type); replace with Pickup::Pickup(int type)”; 
So you can add only quotation marks ( &quot; ) before ( ; ) is it correct ?]]></description>
		<content:encoded><![CDATA[<p>Dear John! I read above Armando L October 8, 2021 about the solution to the error. But I didn&#8217;t understand what needed to change. In Pickup.h at line 38 need Pickup::Pickup(int type); replace with Pickup::Pickup(int type)”;<br />
So you can add only quotation marks ( &#8221; ) before ( ; ) is it correct ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
