<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>C++ | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/category/c/feed/" rel="self" type="application/rss+xml" />
	<link>https://learncgames.com</link>
	<description>A blog about C, programming games and my ebook(s).</description>
	<lastBuildDate>Sat, 26 Apr 2025 14:24:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://learncgames.com/wp-content/uploads/2020/03/cropped-favicon-32x32.png</url>
	<title>C++ | Learn C Games Programming Blog</title>
	<link>https://learncgames.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">181446779</site>	<item>
		<title>Debugging C/C++ and Rust with codelldb</title>
		<link>https://learncgames.com/debugging-c-c-and-rust-with-codelldb/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=debugging-c-c-and-rust-with-codelldb</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sat, 26 Apr 2025 23:05:03 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Rust]]></category>
		<category><![CDATA[debugging]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3381</guid>

					<description><![CDATA[<p>As a user of Visual Studio since about VS 5, I&#8217;ve become accustomed to being able to debug. With VS Code, it&#8217;s also been easy but now that I program in C and Rust, the codelldb extension makes things very easy. You need other extensions: for Rust- the Rust Analyzer extension and for C/C++ the [&#8230;]</p>
The post <a href="https://learncgames.com/debugging-c-c-and-rust-with-codelldb/">Debugging C/C++ and Rust with codelldb</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="alignleft size-full wp-image-3385" src="https://learncgames.com/wp-content/uploads/2025/04/extensions.png" alt="Extensions for C/C++" width="350" height="562" srcset="https://learncgames.com/wp-content/uploads/2025/04/extensions.png 350w, https://learncgames.com/wp-content/uploads/2025/04/extensions-187x300.png 187w" sizes="(max-width: 350px) 100vw, 350px" />As a user of Visual Studio since about VS 5, I&#8217;ve become accustomed to being able to debug. With VS Code, it&#8217;s also been easy but now that I program in C and Rust, the <strong>codelldb</strong> extension makes things very easy. You need other extensions: for Rust- the Rust Analyzer extension and for C/C++ the Microsoft C/C++ extension.</p>
<p>And for debugging for both the codelldb extension which is shown.  It uses the usual Microsoft debugging keys: F5 to start F10 to step over, F11 to step into and F9 to toggle a breakpoint.</p>
<p>Below is an example of debugging a Rust program.</p>
<p><img decoding="async" class="alignleft size-full wp-image-3386" src="https://learncgames.com/wp-content/uploads/2025/04/debuggingRust.png" alt="debugging Rust program in VS Code" width="1094" height="557" srcset="https://learncgames.com/wp-content/uploads/2025/04/debuggingRust.png 1094w, https://learncgames.com/wp-content/uploads/2025/04/debuggingRust-300x153.png 300w, https://learncgames.com/wp-content/uploads/2025/04/debuggingRust-1024x521.png 1024w, https://learncgames.com/wp-content/uploads/2025/04/debuggingRust-768x391.png 768w" sizes="(max-width: 1094px) 100vw, 1094px" /></p>The post <a href="https://learncgames.com/debugging-c-c-and-rust-with-codelldb/">Debugging C/C++ and Rust with codelldb</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3381</post-id>	</item>
		<item>
		<title>A free eBook about the Game of Life</title>
		<link>https://learncgames.com/a-free-ebook-about-the-game-of-life/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-free-ebook-about-the-game-of-life</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Fri, 17 Feb 2023 00:00:15 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[life]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3210</guid>

					<description><![CDATA[<p>Remember the cellular automation Life? I covered it in previous blog entries John Conway&#8217;s Game of Life and also Portable Life in C. Well, Associate Professor Nathaniel Johnston (in the Department of Mathematics and Computer Science at Mount Allison University in New Brunswick, Canada) and Dave Greene wrote a book/eBook about Life. It&#8217;s N. Johnston [&#8230;]</p>
The post <a href="https://learncgames.com/a-free-ebook-about-the-game-of-life/">A free eBook about the Game of Life</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:31,&quot;href&quot;:&quot;https:\/\/www.njohnston.ca\/publications\/conways-game-of-life-mathematics-and-construction&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260206110750\/https:\/\/njohnston.ca\/publications\/conways-game-of-life-mathematics-and-construction\/&quot;,&quot;redirect_href&quot;:&quot;https:\/\/njohnston.ca\/publications\/conways-game-of-life-mathematics-and-construction\/&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 19:09:59&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-09 20:19:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-12 22:35:42&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-16 19:52:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-20 02:02:03&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-24 16:45:44&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-01 17:04:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-06 23:03:48&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-11 04:41:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-14 16:16:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-20 13:33:46&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-24 12:58:00&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-27 21:49:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-03 02:45:38&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-08 11:28:19&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-12 05:32:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-17 09:56:16&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-21 04:19:46&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-21 04:19:46&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:32,&quot;href&quot;:&quot;https:\/\/sourceforge.net\/projects\/golly&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20251221195135\/https:\/\/sourceforge.net\/projects\/golly\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 11:04:10&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-09 20:19:22&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-12 22:35:41&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-16 19:52:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-20 02:01:59&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-24 00:15:22&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-27 00:41:45&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-03 20:07:33&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-06 21:54:31&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-10 18:30:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-14 16:16:30&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-18 16:51:22&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-22 08:32:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-26 13:35:42&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-30 20:41:02&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-03 02:45:38&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-08 00:33:17&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-12 05:32:26&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-16 15:32:42&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-20 09:40:42&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-20 09:40:42&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]'></div>
<p><img decoding="async" class="alignleft size-full wp-image-3212" src="https://learncgames.com/wp-content/uploads/2023/02/Conways-game-of-life.png" alt="Front cover of Conway's Game of Life eBook." width="223" height="300" />Remember the cellular automation Life? I covered it in previous blog entries <a title="Link to blog entry about the Game of life by John Conway" href="https://learncgames.com/john-conways-game-of-life/" target="_blank" rel="noopener">John Conway&#8217;s Game of Life</a> and also <a title="Link to Portable Life in C blog entry" href="https://learncgames.com/portable-life-in-c/" target="_blank" rel="noopener">Portable Life in C</a>. Well, Associate Professor Nathaniel Johnston (in the Department of Mathematics and Computer Science at Mount Allison University in New Brunswick, Canada) and Dave Greene wrote a book/eBook about Life. It&#8217;s N. Johnston and D. Greene. <em>Conway’s Game of Life: Mathematics and Construction</em>.</p>
<p>The 474 page eBook is free <a title="Link to Page about the book on the author's website" href="https://www.njohnston.ca/publications/conways-game-of-life-mathematics-and-construction/" target="_blank" rel="noopener">on this page</a> or you can buy the coloured hardback book. On Amazon that&#8217;s a modest £59.99! The PDF is 93 MB in size.</p>
<p>Ever since Life was publicized in Scientific American in the 1970s, it&#8217;s held a fascination for many including myself. I wrote a program (in Basic) 45 years ago to run it, but it was quite slow. One of the fastest I ever saw was written in 6502 assembly language running on an Acorn Atom. A very comprehensive and fast open source Life is <a title="Link to Golly project on Sourceforge" href="https://sourceforge.net/projects/golly/" target="_blank" rel="nofollow noopener">Golly</a>, written in C++ and is scriptable in Python or Lua.</p>
<p>But back to the book. If you are a real life afficionado and know the difference between a Glider and an Oscillator then this book/eBook is definitely for you. It&#8217;s a detailed look at Life from an academic point of view.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/a-free-ebook-about-the-game-of-life/">A free eBook about the Game of Life</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3210</post-id>	</item>
		<item>
		<title>Is Tiobe Index misinformation?</title>
		<link>https://learncgames.com/is-tiobe-index-misinformation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=is-tiobe-index-misinformation</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sun, 15 Jan 2023 00:00:05 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Other stuff]]></category>
		<category><![CDATA[rankings]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3188</guid>

					<description><![CDATA[<p>Every month a new Tiobe Index is published purporting to show the most popular programming languages. Except, if you look at other programming language popularity surveys, lists etc, the Tiobe Index increasingly seems to be at odds with everybody else. Take the programming language C. As you can imagine I have a particular interest in [&#8230;]</p>
The post <a href="https://learncgames.com/is-tiobe-index-misinformation/">Is Tiobe Index misinformation?</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignleft size-medium wp-image-3195" src="https://learncgames.com/wp-content/uploads/2023/01/2094394-300x200.jpg" alt="news, false, concept" width="300" height="200" srcset="https://learncgames.com/wp-content/uploads/2023/01/2094394-300x200.jpg 300w, https://learncgames.com/wp-content/uploads/2023/01/2094394-1024x682.jpg 1024w, https://learncgames.com/wp-content/uploads/2023/01/2094394-768x512.jpg 768w, https://learncgames.com/wp-content/uploads/2023/01/2094394.jpg 1280w" sizes="auto, (max-width: 300px) 100vw, 300px" />Every month a new Tiobe Index is published purporting to show the most popular programming languages. Except, if you look at other programming language popularity surveys, lists etc, the Tiobe Index increasingly seems to be at odds with everybody else.</p>
<p>Take the programming language C. As you can imagine I have a particular interest in it. I was at first delighted when I saw it at #3 in the Tiobe Index. In fact, in their most recent index it is listed as the 2nd most popular programming language. Well that is just crazy. No matter how much I might want it, there is no way on Earth that it is the 2nd most popular programming language.</p>
<p>It&#8217;s not just me saying it. Let&#8217;s look at who else says it.</p>

<table id="tablepress-1" class="tablepress tablepress-id-1">
<thead>
<tr class="row-1">
	<th class="column-1">Site</th><th class="column-2">C's Ranking</th><th class="column-3">Comments</th>
</tr>
</thead>
<tbody class="row-striping row-hover">
<tr class="row-2">
	<td class="column-1"><a href="https://www.tiobe.com/tiobe-index/">Tiobe Index</a></td><td class="column-2">2</td><td class="column-3">Updated monthly</td>
</tr>
<tr class="row-3">
	<td class="column-1"><a href="https://octoverse.github.com/2022/top-programming-languages">GitHub Octoverse Programming languages</a></td><td class="column-2">9</td><td class="column-3">Annually- this is October 2022</td>
</tr>
<tr class="row-4">
	<td class="column-1"><a href="https://www.reddit.com/r/programming/wiki/faq/#wiki_what_language_reddits_are_there.3F">Reddit Programming languages</a></td><td class="column-2">10</td><td class="column-3">Subreddits for programming languages</td>
</tr>
<tr class="row-5">
	<td class="column-1"><a href="https://redmonk.com/sogrady/2022/10/20/language-rankings-6-22/">Red Monk Programming Language Rankings</a></td><td class="column-2">10</td><td class="column-3">June 2022. Updated every 6 months</td>
</tr>
<tr class="row-6">
	<td class="column-1"><a href="https://survey.stackoverflow.co/2022/#technology">StackOverflow developer survey</a></td><td class="column-2">11</td><td class="column-3">Annually</td>
</tr>
<tr class="row-7">
	<td class="column-1"><a href="https://www.statista.com/statistics/793628/worldwide-developer-survey-most-used-languages/#:~:text=As%20of%202022%2C%20JavaScript%20and,55%20percent%20using%20HTML%2FCSS.">Statista most used programming languages 2022</a></td><td class="column-2">11</td><td class="column-3"></td>
</tr>
<tr class="row-8">
	<td class="column-1"><a href="https://www.hackerrank.com/research/developer-skills/2023">Hackerrank Developer skills report 2023</a></td><td class="column-2">12</td><td class="column-3"></td>
</tr>
</tbody>
</table>
<!-- #tablepress-1 from cache -->
<p>There are other programming language lists or surveys but those show what I mean.  No one else has C anywhere that high. Here it&#8217;s in positions 9-12 with an average roughly around 10.5 if you exclude Tiobe or 9.3 if you don&#8217;t.  I think their methodology is flawed and biased by age. Older languages appear to carry more weight.</p>
<p>Never mind C, what about JavaScript? Everyone else has it in first place (except HackerRank who has it in 4th). Tiobe index has it in 7th. Misinformation is defined as “false information that is spread, regardless of intent to mislead.”. Maybe that&#8217;s a bit harsh but that&#8217;s how I regard the Tiobe Index.</p>The post <a href="https://learncgames.com/is-tiobe-index-misinformation/">Is Tiobe Index misinformation?</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3188</post-id>	</item>
		<item>
		<title>How to Configure Visual Studio Code for C/C++ development</title>
		<link>https://learncgames.com/how-to-configure-visual-studio-code-for-c-c-development/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-configure-visual-studio-code-for-c-c-development</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Mon, 05 Dec 2022 00:00:11 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Visual Studio Code]]></category>
		<category><![CDATA[compilation]]></category>
		<category><![CDATA[configuration]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3111</guid>

					<description><![CDATA[<p>When I first started with VS Code on Linux, I found the C/C++ configuration somewhat confusing.  I blundered through, wasted a bit of time and got there in the end. After a gap of a couple of years I did the same again recently on Raspberry Pi. It&#8217;s clearer in my mind now so I [&#8230;]</p>
The post <a href="https://learncgames.com/how-to-configure-visual-studio-code-for-c-c-development/">How to Configure Visual Studio Code for C/C++ development</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3113" src="https://learncgames.com/wp-content/uploads/2022/12/vscode-extensions.png" alt="VS Code C/C++ extension" width="254" height="68" srcset="https://learncgames.com/wp-content/uploads/2022/12/vscode-extensions.png 254w, https://learncgames.com/wp-content/uploads/2022/12/vscode-extensions-250x68.png 250w" sizes="auto, (max-width: 254px) 100vw, 254px" />When I first started with VS Code on Linux, I found the C/C++ configuration somewhat confusing.  I blundered through, wasted a bit of time and got there in the end. After a gap of a couple of years I did the same again recently on Raspberry Pi. It&#8217;s clearer in my mind now so I thought I&#8217;d explain it here. This works for Ubuntu, Raspberry Pi OS and should for most other Linuxes. (<em>Not that I&#8217;ve tried them all&#8230;</em>)</p>
<p>We&#8217;ll start with you having already installed Clang (<em>or GCC</em>) and VS Code, and the C/C++ extension for VS Code (shown above). So make sure those are all done.</p>
<p>Start by defining a Folder for VS Code. VS code doesn&#8217;t use projects but it manages everything relative to the currently defined Folder.  It&#8217;ll ask you to open a folder initially. That&#8217;s where your source code etc will go. I created a folder called examples under my home folder and used that.</p>
<p>To compile anything C/C++ you also need two json files. These files are</p>
<ul>
<li>tasks.json</li>
<li>c_cpp_properties.json</li>
</ul>
<p>They are held in a hidden folder called .vscode in your current folder. Press F1 and you&#8217;ll see a popup menu. Type in C/C++ and you&#8217;ll see all the C/C++ items. Select <strong>C/C++: Edit Configurations (JSON).</strong> It&#8217;s highlighted below.</p>
<p><img loading="lazy" decoding="async" class="alignleft wp-image-3114 size-full" src="https://learncgames.com/wp-content/uploads/2022/12/cppconfigurations.png" alt="Vs Copde C++ menu" width="615" height="340" srcset="https://learncgames.com/wp-content/uploads/2022/12/cppconfigurations.png 615w, https://learncgames.com/wp-content/uploads/2022/12/cppconfigurations-300x166.png 300w" sizes="auto, (max-width: 615px) 100vw, 615px" /></p>
<p>Now if you click that, and look in the folder examples you&#8217;ll see nothing but if you know how to view hidden files using the files utility (as shown below). Then you&#8217;ll see the folder <strong>.vscode</strong>.  On Raspberry Pi the file explorer always shows hidden files.</p>
<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3115" src="https://learncgames.com/wp-content/uploads/2022/12/showHiddenFiles.png" alt="Show hidden files in files utility" width="218" height="352" srcset="https://learncgames.com/wp-content/uploads/2022/12/showHiddenFiles.png 218w, https://learncgames.com/wp-content/uploads/2022/12/showHiddenFiles-186x300.png 186w" sizes="auto, (max-width: 218px) 100vw, 218px" /> Now look in that folder and you&#8217;ll see <strong>c_cpp_properties.json</strong>.</p>
<p>Next we want <strong>tasks.json</strong>. On the Terminal menu, click the bottom item which is <em>Configure Default Build Task</em></p>
<p>It&#8217;ll ask you to select the <strong>clang  build active task</strong> so click that and voila you now have <strong>tasks.json</strong> open in the editor.</p>
<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3117" src="https://learncgames.com/wp-content/uploads/2022/12/configure-default-build-task.png" alt="Vs Code Configure Default Build Task" width="361" height="343" srcset="https://learncgames.com/wp-content/uploads/2022/12/configure-default-build-task.png 361w, https://learncgames.com/wp-content/uploads/2022/12/configure-default-build-task-300x285.png 300w" sizes="auto, (max-width: 361px) 100vw, 361px" /></p>
<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3119" src="https://learncgames.com/wp-content/uploads/2022/12/build-active-file.png" alt="Build Active File" width="592" height="79" srcset="https://learncgames.com/wp-content/uploads/2022/12/build-active-file.png 592w, https://learncgames.com/wp-content/uploads/2022/12/build-active-file-300x40.png 300w" sizes="auto, (max-width: 592px) 100vw, 592px" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Now I&#8217;ve created the standard hello world file in the file hw.c.</p>
<pre><code class="language-c" data-line="">#include &lt;stdio.h&gt;

int main() {
  printf(&quot;Hello world\n&quot;);
  return 0;
}</code></pre>
<p>So just do <em>Terminal/Run Build Task</em> and it will have clang compile the currently opened file. If you get terminal failed to launch (exit code: -1) then it&#8217;s likely that your hello world source file was not the currently opened file in the editor. You can see which file is open because its tab is brightest.</p>
<p>Note that hw.c is brighter than tasks.json on the left. On the right, the open file is tasks.json and its tab is brighter.</p>
<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3126" src="https://learncgames.com/wp-content/uploads/2022/12/open-file.png" alt="Open file in VS Code" width="330" height="201" srcset="https://learncgames.com/wp-content/uploads/2022/12/open-file.png 330w, https://learncgames.com/wp-content/uploads/2022/12/open-file-300x183.png 300w" sizes="auto, (max-width: 330px) 100vw, 330px" /></p>
<h3><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3127" src="https://learncgames.com/wp-content/uploads/2022/12/open-tasks.json.png" alt="Tasks.json is open" width="526" height="185" srcset="https://learncgames.com/wp-content/uploads/2022/12/open-tasks.json.png 526w, https://learncgames.com/wp-content/uploads/2022/12/open-tasks.json-300x106.png 300w" sizes="auto, (max-width: 526px) 100vw, 526px" /></h3>
<h3></h3>
<h3></h3>
<h3></h3>
<h3></h3>
<h3></h3>
<h3>So what are the json files for?</h3>
<p>The c_cpp_properties.json lets you specify include file paths.  For instance if you have the SDL files installed, the include files are in <strong>/usr/include/SDL2</strong></p>
<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3129" src="https://learncgames.com/wp-content/uploads/2022/12/sdl2-include-files.png" alt="SDL2 include files" width="551" height="247" srcset="https://learncgames.com/wp-content/uploads/2022/12/sdl2-include-files.png 551w, https://learncgames.com/wp-content/uploads/2022/12/sdl2-include-files-300x134.png 300w" sizes="auto, (max-width: 551px) 100vw, 551px" /></p>
<p>Note you can install SDL on linux by <a title="Link to how to install SDL on Linux" href="https://learncgames.com/tutorials/how-to-install-sdl-on-linux/" target="_blank" rel="noopener">following these instructions</a>.</p>
<p>The tasks.json file lets you specify which files are to be included and also linked.</p>
<p>Here I&#8217;ve just shown the args section from a <strong>tasks.json</strong> used to build SDL2 games.</p>
<pre><code class="language-json" data-line="">	&quot;args&quot;: [
		&quot;-g&quot;,
		&quot;${file}&quot;,
		&quot;${workspaceFolder}/hr_time.c&quot;,
		&quot;-o&quot;,
		&quot;${fileDirname}/${fileBasenameNoExtension}&quot;,
		&quot;-lSDL2&quot;,
		&quot;-lSDL2_image&quot;,
		&quot;-lSDL2_mixer&quot;,
		&quot;-lm&quot;
	],</code></pre>
<p>The -g option includes files. The ${file} is the current opened file and {workspaceFolder{} specifies the current folder where the file hr_time.c (used for timing). The -l is for linking files and links SDL2, SDL2_image and SDL2_mixer.  The last <strong>-lm</strong> links math(s) code; technically the -l{name} flag tells the linker to link against lib{name}. So -lm links against libm, the c math library.</p>The post <a href="https://learncgames.com/how-to-configure-visual-studio-code-for-c-c-development/">How to Configure Visual Studio Code for C/C++ development</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3111</post-id>	</item>
		<item>
		<title>Cling &#8211; an interactive C++ interpreter</title>
		<link>https://learncgames.com/cling-an-interactive-c-interpreter/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cling-an-interactive-c-interpreter</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Wed, 17 Mar 2021 00:00:57 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Other stuff]]></category>
		<category><![CDATA[interpreter]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=2897</guid>

					<description><![CDATA[<p>When I first learned to program back in 1976, I had a teletype and a BASIC interpreter. Apart from a couple of years writing BASIC programs in my first job, all my work after that was with compilers. So I&#8217;m a bit rusty with interpreters. The idea is that the interpreter reads a line of [&#8230;]</p>
The post <a href="https://learncgames.com/cling-an-interactive-c-interpreter/">Cling – an interactive C++ interpreter</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:93,&quot;href&quot;:&quot;https:\/\/pixabay.com\/users\/markusspiske-670330\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1689066&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:94,&quot;href&quot;:&quot;https:\/\/pixabay.com\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1689066&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260205102120\/https:\/\/pixabay.com\/?utm_source=link-attribution&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 11:50:20&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-15 12:03:43&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-27 11:09:00&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-14 22:59:27&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-03 19:13:13&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-08 10:51:40&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-12 18:42:27&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-18 05:17:31&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-21 17:51:40&quot;,&quot;http_code&quot;:403}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-21 17:51:40&quot;,&quot;http_code&quot;:403},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:95,&quot;href&quot;:&quot;https:\/\/root.cern\/cling&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260119154045\/https:\/\/root.cern\/cling\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 11:50:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-15 12:03:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 11:09:05&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-14 22:59:29&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-03 19:13:20&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-08 10:51:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-12 18:42:36&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-17 09:33:41&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-21 03:50:04&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-21 03:50:04&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:96,&quot;href&quot;:&quot;https:\/\/codepad.org&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20240520225456\/http:\/\/codepad.org\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 11:50:29&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-15 12:03:52&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-18 18:50:18&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-22 17:03:56&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-27 11:09:03&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-04 14:43:36&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-08 03:50:33&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-11 04:08:00&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-02 07:52:54&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-05 11:06:00&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-11 16:32:33&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-14 22:22:00&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-18 09:19:35&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-21 17:51:38&quot;,&quot;http_code&quot;:503}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-21 17:51:38&quot;,&quot;http_code&quot;:503},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:97,&quot;href&quot;:&quot;https:\/\/ideone.com&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260206115138\/https:\/\/ideone.com\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 21:53:36&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-15 12:03:48&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-18 18:50:24&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-22 17:03:59&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-27 11:09:01&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-04 12:21:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-08 03:50:34&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-11 04:08:00&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-02 07:52:53&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-05 11:05:59&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-13 18:20:50&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-17 15:02:07&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-20 19:39:42&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-20 19:39:42&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:98,&quot;href&quot;:&quot;https:\/\/root.cern\/doc\/master\/group__Tutorials.html&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260206115207\/https:\/\/root.cern\/doc\/master\/group__Tutorials.html&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 21:53:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-15 12:03:45&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 13:37:24&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-01 17:05:30&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-14 22:59:29&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-03 19:13:20&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-06 23:17:09&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-12 18:42:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-17 09:33:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-21 03:50:05&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-21 03:50:05&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<figure id="attachment_2900" aria-describedby="caption-attachment-2900" style="width: 300px" class="wp-caption alignleft"><img loading="lazy" decoding="async" class="size-medium wp-image-2900" src="https://learncgames.com/wp-content/uploads/2021/03/code-1689066_640-300x200.jpg" alt="Computer screen" width="300" height="200" srcset="https://learncgames.com/wp-content/uploads/2021/03/code-1689066_640-300x200.jpg 300w, https://learncgames.com/wp-content/uploads/2021/03/code-1689066_640.jpg 640w" sizes="auto, (max-width: 300px) 100vw, 300px" /><figcaption id="caption-attachment-2900" class="wp-caption-text">Image by <a href="https://pixabay.com/users/markusspiske-670330/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1689066">Markus Spiske</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1689066">Pixabay</a></figcaption></figure>
<p>When I first learned to program back in 1976, I had a teletype and a BASIC interpreter. Apart from a couple of years writing BASIC programs in my first job, all my work after that was with compilers.</p>
<p>So I&#8217;m a bit rusty with interpreters. The idea is that the interpreter reads a line of code and then executes it; parsing it and calling various routines to execute statements and parse then evaluate expressions. It&#8217;s kind if unusual to do this with C++. <a title="Link to cling at Cern" href="https://root.cern/cling/" target="_blank" rel="nofollow noopener">Cling</a> is built on the top of LLVM and Clang libraries.</p>
<p>This is different to sites like repl.it, <a title="Link to codepad.org" href="https://codepad.org/" target="_blank" rel="nofollow noopener">codepad.org</a> or <a title="Link to Ideone.com" href="https://ideone.com/" target="_blank" rel="nofollow noopener">ideone.com;</a> they compile the whole program and run it. With an interpreter, it runs line by line and you can print out variables at any time.  Interpreters are probably more like debuggers.</p>
<p>As well as C++, cling can execute C, Objective-C and that even less used language Objective-C++.  Developed at Cern it has a very extensive <a title="Link to cling tutorials" href="https://root.cern/doc/master/group__Tutorials.html" target="_blank" rel="nofollow noopener">set of tutorials</a>.</p>The post <a href="https://learncgames.com/cling-an-interactive-c-interpreter/">Cling – an interactive C++ interpreter</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2897</post-id>	</item>
		<item>
		<title>Warzone-2100 C++ cross platform open source</title>
		<link>https://learncgames.com/warzone-2100-c-cross-platform-open-source/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=warzone-2100-c-cross-platform-open-source</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Tue, 16 Mar 2021 00:00:51 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[wargame]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=2889</guid>

					<description><![CDATA[<p>There are some amazing open source games available and Warzone 2100 is definitely one of them. It was originally developed by Pumpkin Studios and published by Eidos Interactive. It was originally released in 1999 on PC and PlayStation. In late 2004 the source code and most of the data was released and a few years later [&#8230;]</p>
The post <a href="https://learncgames.com/warzone-2100-c-cross-platform-open-source/">Warzone-2100 C++ cross platform open source</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:99,&quot;href&quot;:&quot;https:\/\/wz2100.net&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260201095921\/https:\/\/wz2100.net\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 11:51:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-13 08:39:01&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-16 19:52:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 10:47:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-01 17:05:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-06 02:52:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-10 22:38:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-22 08:32:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-27 21:49:35&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-03 02:45:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-06 23:17:04&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-13 03:30:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-18 16:19:32&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-18 16:19:32&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:100,&quot;href&quot;:&quot;https:\/\/betaguide.wz2100.net&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260204192008\/https:\/\/betaguide.wz2100.net\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 11:51:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-13 08:38:58&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-16 19:52:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 10:47:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-01 17:05:26&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-06 02:52:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-11 04:41:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-22 08:32:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-27 21:49:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-03 02:45:40&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-06 23:17:01&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-13 03:30:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-18 16:19:32&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-18 16:19:32&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:101,&quot;href&quot;:&quot;https:\/\/github.com\/Warzone2100\/warzone2100\/issues&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20251227130027\/https:\/\/github.com\/Warzone2100\/warzone2100\/issues&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 11:51:14&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-11 08:45:59&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-15 07:11:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-19 23:43:08&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 10:47:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-01 17:05:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-06 02:52:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-11 04:41:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-22 08:32:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-27 21:49:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-03 02:45:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-06 23:17:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-13 03:30:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-18 16:19:33&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-18 16:19:33&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<figure id="attachment_2891" aria-describedby="caption-attachment-2891" style="width: 300px" class="wp-caption alignleft"><img loading="lazy" decoding="async" class="size-medium wp-image-2891" src="https://learncgames.com/wp-content/uploads/2021/03/Warzone_2100-300x240.jpg" alt="Warzone 2100" width="300" height="240" srcset="https://learncgames.com/wp-content/uploads/2021/03/Warzone_2100-300x240.jpg 300w, https://learncgames.com/wp-content/uploads/2021/03/Warzone_2100.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><figcaption id="caption-attachment-2891" class="wp-caption-text">Image from Wikimedia</figcaption></figure>
<p>There are some amazing open source games available and <a title="Link to Warzone 2100 website" href="https://wz2100.net/" target="_blank" rel="nofollow noopener">Warzone 2100</a> is definitely one of them. It was originally developed by Pumpkin Studios and published by Eidos Interactive. It was originally released in 1999 on PC and PlayStation.</p>
<p>In late 2004 the source code and most of the data was released and a few years later the rest of it. It is now also available for Windows 7-10, macOS, FreeBSD, AmigaOS, AROS, MorphOS, Linux, NetBSD and OpenBSD. Since then the Warzone 2100 Project has been worked on.</p>
<p>According to the GitHub page &#8220;Command the forces of The Project in a battle to rebuild the world after mankind has been nearly destroyed by nuclear missiles. &#8220;. You can play it in single-player mode or against other players on a LAN or on the internet.</p>
<p>To get a feel for the game you can view <a title="Link to Warzone 2100 guide" href="https://betaguide.wz2100.net/" target="_blank" rel="nofollow noopener">the online guide</a>.</p>
<p>Once you&#8217;ve played it, you could consider contributing to the project. It&#8217;s an open project and the <a title="Link to Warzone 2100 issues page on GitHub" href="https://github.com/Warzone2100/warzone2100/issues" target="_blank" rel="noopener">issue tracker</a> currently shows 213 open issues.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/warzone-2100-c-cross-platform-open-source/">Warzone-2100 C++ cross platform open source</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2889</post-id>	</item>
		<item>
		<title>Nearly finished translating asteroids to C++</title>
		<link>https://learncgames.com/nearly-finished-translating-asteroids-to-c/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nearly-finished-translating-asteroids-to-c</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Mon, 15 Mar 2021 00:00:33 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Other stuff]]></category>
		<category><![CDATA[asteroids]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=2883</guid>

					<description><![CDATA[<p>I always wanted to do this and have most of it done. It just needs a bit of polishing plus making it cross-platform. It wasn&#8217;t the hardest  thing I&#8217;ve done although I did start by trying to make the common part for asteroids, player ship, bullets and aliens, the bit that managed position and velocity [&#8230;]</p>
The post <a href="https://learncgames.com/nearly-finished-translating-asteroids-to-c/">Nearly finished translating asteroids to C++</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignleft size-medium wp-image-2886" src="https://learncgames.com/wp-content/uploads/2021/03/asteroids-300x292.png" alt="Asteroids screenshot" width="300" height="292" srcset="https://learncgames.com/wp-content/uploads/2021/03/asteroids-300x292.png 300w, https://learncgames.com/wp-content/uploads/2021/03/asteroids.png 364w" sizes="auto, (max-width: 300px) 100vw, 300px" />I always wanted to do this and have most of it done. It just needs a bit of polishing plus making it cross-platform. It wasn&#8217;t the hardest  thing I&#8217;ve done although I did start by trying to make the common part for asteroids, player ship, bullets and aliens, the bit that managed position and velocity into a base class.</p>
<p>I then spent a day wrestling with the compiler trying to access this in those methods that used this and in the end found it easier to make it into its own class and had an instance of it in each of the classes. I.e. using composition rather than inheritance.</p>
<p>Rewriting in C++ made things like saving high scores to disk and reloading a bit simpler using C++ strings.  Now I just have to get my main PC up and running and then polish the code and publish it on GitHub.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/nearly-finished-translating-asteroids-to-c/">Nearly finished translating asteroids to C++</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2883</post-id>	</item>
		<item>
		<title>So what do I think of C++ compared to C?</title>
		<link>https://learncgames.com/so-what-do-i-think-of-c-compared-to-c/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=so-what-do-i-think-of-c-compared-to-c</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Thu, 11 Mar 2021 00:00:05 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Techniques]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=2857</guid>

					<description><![CDATA[<p>I learnt C++ 30 years ago (1991)  and C about 10 years ago.  Mind you I&#8217;d had several years of Pascal by then including some OOP (Object Oriented Programming) so it wasn&#8217;t that big a thing to learn C++ after Pascal. For me it&#8217;s the objects and the template structures like vect that make the [&#8230;]</p>
The post <a href="https://learncgames.com/so-what-do-i-think-of-c-compared-to-c/">So what do I think of C++ compared to C?</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:109,&quot;href&quot;:&quot;https:\/\/pixabay.com\/users\/geralt-9301\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=417880&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260128125116\/https:\/\/pixabay.com\/users\/geralt-9301\/?utm_source=link-attribution&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 11:58:11&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-10 08:50:28&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-15 12:03:52&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-19 13:05:07&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-26 02:30:16&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-01 10:14:22&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-09 01:36:04&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-12 08:08:53&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-16 09:06:49&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-24 20:51:28&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-03 11:23:46&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-07 22:02:45&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-13 08:16:49&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-17 17:16:23&quot;,&quot;http_code&quot;:403}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-17 17:16:23&quot;,&quot;http_code&quot;:403},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:110,&quot;href&quot;:&quot;https:\/\/pixabay.com\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=417880&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;}]'></div>
<figure id="attachment_2858" aria-describedby="caption-attachment-2858" style="width: 300px" class="wp-caption alignleft"><img loading="lazy" decoding="async" class="size-medium wp-image-2858" src="https://learncgames.com/wp-content/uploads/2021/03/software-417880_640-300x280.jpg" alt="Software" width="300" height="280" srcset="https://learncgames.com/wp-content/uploads/2021/03/software-417880_640-300x280.jpg 300w, https://learncgames.com/wp-content/uploads/2021/03/software-417880_640.jpg 640w" sizes="auto, (max-width: 300px) 100vw, 300px" /><figcaption id="caption-attachment-2858" class="wp-caption-text">Image by <a href="https://pixabay.com/users/geralt-9301/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=417880">Gerd Altmann</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=417880">Pixabay</a></figcaption></figure>
<p>I learnt C++ 30 years ago (1991)  and C about 10 years ago.  Mind you I&#8217;d had several years of Pascal by then including some OOP (Object Oriented Programming) so it wasn&#8217;t that big a thing to learn C++ after Pascal.</p>
<p>For me it&#8217;s the objects and the template structures like <strong>vect</strong> that make the difference. Most C programs that I&#8217;ve written don&#8217;t really progress beyond using an array of structs. Asteroids, which at 2,200 lines long used a few of those but that was it.</p>
<p>In fact if I wanted any more complicated data structures in C programs, I&#8217;d either have to use a 3rd party library or roll my own using pointers.</p>
<p>Programs I&#8217;ve written in C# probably use <strong>List&lt;Class&gt;</strong> more than any other data structure with <strong>Dictionary&lt;string,Class&gt;</strong> a close second. It really depends upon the type of program you are writing. A lot of mine are reading from a text file or database file, holding data in memory then outputting results.</p>
<p>C++ offers more advanced data structures than C and I spent a fair bit of time rewriting Asteroids replacing all the array of structs as arrays of objects.  Inheritance isn&#8217;t that big a thing in OOP but it was handy here because I was able to initially have <strong>Asteroids, Space Ships, Bullets and Aliens</strong> classes all inherit from a <strong>moveable</strong> base class. That class had all the code for rotation, movement etc. I found though that C++ could be a real pain when trying to do comparisons between different superclasses and eventually switched from inheritance to composition so those classes had a <strong>moveable</strong> object instead.</p>
<p>The downside to C++ is remembering if you are copying or moving objects. Not a problem you have in C. One of the interesting problems is how you track the number of active Asteroids which can change from frame to frame. In C I used a fixed array of structs with a field showing whether it was active. Using a vect though and pushing and popping asteroid objects would probably take longer.</p>The post <a href="https://learncgames.com/so-what-do-i-think-of-c-compared-to-c/">So what do I think of C++ compared to C?</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2857</post-id>	</item>
		<item>
		<title>A look at a Raspberry Pi Pico</title>
		<link>https://learncgames.com/a-look-at-a-raspberry-pi-pico/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-look-at-a-raspberry-pi-pico</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sat, 23 Jan 2021 00:00:05 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[Raspbverry Pi Pico]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=2477</guid>

					<description><![CDATA[<p>As you probably know I do like my Raspberry Pi. But the RPi Pico is a different kettle of fish. I&#8217;m only mentioning it here because it is programmable in C/C++ and some may find it a less say overwhelming place to learn C than say a traditional Raspberry Pi. What&#8217;s different between a Pico [&#8230;]</p>
The post <a href="https://learncgames.com/a-look-at-a-raspberry-pi-pico/">A look at a Raspberry Pi Pico</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:234,&quot;href&quot;:&quot;https:\/\/raspberrypi.org&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260206021718\/https:\/\/www.raspberrypi.org\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 13:01:53&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-15 12:03:49&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 01:58:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-23 17:36:04&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-01 06:50:06&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-04 11:26:14&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-09 09:19:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-14 00:35:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-26 02:22:39&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-03 05:07:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-10 14:01:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-15 00:40:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-20 08:53:06&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-20 08:53:06&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:235,&quot;href&quot;:&quot;https:\/\/www.raspberrypi.org\/documentation\/pico\/getting-started&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20210223203320\/https:\/\/www.raspberrypi.org\/documentation\/pico\/getting-started\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 13:01:56&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-17 05:26:17&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-22 19:06:51&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-01 17:05:47&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-09 09:19:22&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-14 00:35:12&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-26 02:22:42&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-03 05:07:37&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-10 14:01:33&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-20 08:26:53&quot;,&quot;http_code&quot;:403}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-20 08:26:53&quot;,&quot;http_code&quot;:403},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:236,&quot;href&quot;:&quot;https:\/\/www.sciencedirect.com\/topics\/computer-science\/pulse-width-modulation&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20240423221600\/https:\/\/www.sciencedirect.com\/topics\/computer-science\/pulse-width-modulation&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 13:01:58&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-15 12:03:55&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-19 08:09:50&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-22 19:06:52&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-01 17:05:47&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-04 18:15:23&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-09 09:19:20&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-14 00:35:12&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-26 02:22:37&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-03 05:07:36&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-10 14:01:32&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-15 00:40:33&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-20 08:26:51&quot;,&quot;http_code&quot;:403}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-20 08:26:51&quot;,&quot;http_code&quot;:403},&quot;process&quot;:&quot;done&quot;}]'></div>
<figure id="attachment_2481" aria-describedby="caption-attachment-2481" style="width: 300px" class="wp-caption alignleft"><img loading="lazy" decoding="async" class="size-medium wp-image-2481" src="https://learncgames.com/wp-content/uploads/2021/01/raspberry-pi-pico-300x169.png" alt="Raspberry Pi Pico" width="300" height="169" srcset="https://learncgames.com/wp-content/uploads/2021/01/raspberry-pi-pico-300x169.png 300w, https://learncgames.com/wp-content/uploads/2021/01/raspberry-pi-pico.png 708w" sizes="auto, (max-width: 300px) 100vw, 300px" /><figcaption id="caption-attachment-2481" class="wp-caption-text">From <a href="https://raspberrypi.org">Raspberrypi.</a>org</figcaption></figure>
<p>As you probably know I do like my Raspberry Pi. But the RPi Pico is a different kettle of fish. I&#8217;m only mentioning it here because it is programmable in C/C++ and some may find it a less say overwhelming place to learn C than say a traditional Raspberry Pi.</p>
<p><strong>What&#8217;s different between a Pico and a Pi 4B?</strong> A Pico uses a microcontroller- basically a CPU with built in RAM, bit of flash RAM, real time clock. RAM is tiny compared to any Pi. Just 264 KB (<em>That&#8217;s still much more RAM than my CBM Vic-20 in 1981 with 3.5 KB of RAM!</em>) and 2MB of Flash RAM. The CPU, an ARM CPU designed in the UK runs at clock speeds up to 133 MHZ. A Pi 4B runs at 1.5 GB, over 11x faster.</p>
<p>The biggest difference is that a Raspberry Pi runs any operating system you want. Microcontrollers are different. To run a program on a Pico you have to program it into Flash RAM first. You can do this with drag and drop. <a title="Link to Raspberry pi instructions" href="https://www.raspberrypi.org/documentation/pico/getting-started/" target="_blank" rel="nofollow noopener">See here</a> for C/C++. The Pico is an embedded system. RAM is used for data, stack etc but not the program which runs out of Flash RAM.</p>
<p>But if you like hardware then this is an excellent place to get started. You get all these (<em><a title="Link to raspberry Pi Pico specifications" href="https://www.raspberrypi.org/documentation/pico/getting-started/" target="_blank" rel="nofollow noopener">see here</a> for Specifications</em>).</p>
<ul>
<li>26 × multi-function GPIO pins</li>
<li>2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit ADC, 16 × controllable PWM channels (<em>PWM I&#8217;m guessing is <a title="Link to article about pulse width modulation" href="https://www.sciencedirect.com/topics/computer-science/pulse-width-modulation" target="_blank" rel="nofollow noopener">pulse-width modulation</a></em>).</li>
<li>Accurate clock and timer on-chip</li>
<li>Temperature sensor</li>
<li>Accelerated floating-point libraries on-chip</li>
<li>8 × Programmable I/O (PIO) state machines for custom peripheral support</li>
</ul>
<p>So what about games? Not really. Or at best very simple games using the single LED. No, this is about learning C (o<em>r C++ or even- shock &#8211; Python</em>) and interfacing hardware.  You might for example put one of these inside a drone to provide control software.</p>The post <a href="https://learncgames.com/a-look-at-a-raspberry-pi-pico/">A look at a Raspberry Pi Pico</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2477</post-id>	</item>
		<item>
		<title>Fascinating online WebGL</title>
		<link>https://learncgames.com/fascinating-online-webgl/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fascinating-online-webgl</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Wed, 06 Jan 2021 00:00:49 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[WebGL]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=2306</guid>

					<description><![CDATA[<p>WebGL (Web Graphics Library) is a JavaScript API for rendering interactive 2D and 3D graphics in a compatible web browser without the use of plug-ins. A developer called Todd Fleming has created a webpage where C++ programs (and maybe C?) can be compiled online by Clang and then run in the browser. The colourful rabbits [&#8230;]</p>
The post <a href="https://learncgames.com/fascinating-online-webgl/">Fascinating online WebGL</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:272,&quot;href&quot;:&quot;https:\/\/tbfleming.github.io\/cib&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260204124603\/https:\/\/tbfleming.github.io\/cib\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 13:21:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-19 08:09:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-22 19:06:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-01 17:05:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-04 18:15:24&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-10 16:20:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-14 22:59:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-03 05:20:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-10 14:01:33&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-20 17:28:01&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-20 17:28:01&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<p><img loading="lazy" decoding="async" class="alignleft size-medium wp-image-2307" src="https://learncgames.com/wp-content/uploads/2021/01/WebGL-Rabbits-300x221.png" alt="WebGL Rabbits" width="300" height="221" srcset="https://learncgames.com/wp-content/uploads/2021/01/WebGL-Rabbits-300x221.png 300w, https://learncgames.com/wp-content/uploads/2021/01/WebGL-Rabbits-768x566.png 768w, https://learncgames.com/wp-content/uploads/2021/01/WebGL-Rabbits.png 784w" sizes="auto, (max-width: 300px) 100vw, 300px" />WebGL (<em>Web Graphics Library</em>) is a JavaScript API for rendering interactive 2D and 3D graphics in a compatible web browser without the use of plug-ins. A developer called Todd Fleming has created a <a title="Link to WebGL compile page" href="https://tbfleming.github.io/cib/" target="_blank" rel="nofollow noopener">webpage</a> where C++ programs (and maybe C?) can be compiled online by Clang and then run in the browser.</p>
<p>The colourful rabbits (<em>numbering approximately 30</em>) in the screenshot are rendered in real-time and rotated and moved (transformed). Each rabbit is actually each made up of 66,848 triangles.  Just click the (<em>WebGL- Flying bunnies</em>)  link on the right-hand side to load the 335 lines C++ source program then hit the compile button. After it has compiled in a second or so hit the Reboot/Run button on the right-hand side to start it running.</p>
<p>You can select all the source code and copy/paste it into a text editor if you want to examine it. You even can save out the compiled wasm (<em>WebAssembly</em>) file if you really want to though as it&#8217;s binary, it probably won&#8217;t mean too much unless you have a viewer.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/fascinating-online-webgl/">Fascinating online WebGL</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2306</post-id>	</item>
	</channel>
</rss>
