<?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"
	>

<channel>
	<title>Scriptionary Blog</title>
	<atom:link href="http://scriptionary.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://scriptionary.com/blog</link>
	<description>The informal part of Scriptionary</description>
	<pubDate>Tue, 11 Nov 2008 14:44:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Phoenix dead</title>
		<link>http://scriptionary.com/blog/2008/11/11/phoenix-dead/</link>
		<comments>http://scriptionary.com/blog/2008/11/11/phoenix-dead/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 14:44:56 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[bad thing]]></category>

		<category><![CDATA[NASA]]></category>

		<category><![CDATA[Phoenix]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=60</guid>
		<description><![CDATA[Maybe Phoenix will live up to its name and start functioning again soon, until then:

]]></description>
			<content:encoded><![CDATA[<p>Maybe <a href="http://phoenix.lpl.arizona.edu/">Phoenix</a> will live up to its name and start functioning again soon, until then:</p>
<div style="text-align: center;"><img src="http://scriptionary.com/blog/wp-content/uploads/2008/11/phoenix-rip.jpg" alt="Phoenix: RIP" width="246" height="172" /></div>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/11/11/phoenix-dead/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DirectX SDK November 2008</title>
		<link>http://scriptionary.com/blog/2008/11/06/directx-sdk-november-2008/</link>
		<comments>http://scriptionary.com/blog/2008/11/06/directx-sdk-november-2008/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 14:46:28 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[direct3d]]></category>

		<category><![CDATA[directx]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[windows programming]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=58</guid>
		<description><![CDATA[Just released, get it while it&#8217;s hot.
It doesn&#8217;t look like there are any DirectX 11 previews in there. Is it my imagination or were those supposed to be in it? Thanks Aras for the confirmation that the DirectX 11 preview are actually in there.
EDIT2: The new DirectX redistributable was released today.
]]></description>
			<content:encoded><![CDATA[<p>Just released, <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5493f76a-6d37-478d-ba17-28b1cca4865a&#038;DisplayLang=en">get it while it&#8217;s hot</a>.</p>
<p><del>It doesn&#8217;t look like there are any DirectX 11 previews in there. Is it my imagination or were those supposed to be in it?</del> Thanks Aras for the confirmation that the DirectX 11 preview <strong>are</strong> actually in there.</p>
<p>EDIT2: The new DirectX redistributable <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=886acb56-c91a-4a8e-8bb8-9f20f1244a8e&#038;DisplayLang=en">was released today</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/11/06/directx-sdk-november-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Crapple iTrash</title>
		<link>http://scriptionary.com/blog/2008/11/04/crapple-itrash/</link>
		<comments>http://scriptionary.com/blog/2008/11/04/crapple-itrash/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 15:02:11 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[apple]]></category>

		<category><![CDATA[funny]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=57</guid>
		<description><![CDATA[
Didn&#8217;t know Apple made this particular product. What do they call it? Crapple? iTrash?
]]></description>
			<content:encoded><![CDATA[<p><img src="http://scriptionary.com/blog/wp-content/uploads/2008/11/apple.jpg" alt="iCrap" title="iTrash?" width="500" height="400" /><br />
Didn&#8217;t know Apple made this particular product. What do they call it? Crapple? iTrash?</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/11/04/crapple-itrash/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What if .NET would be Discontinued?</title>
		<link>http://scriptionary.com/blog/2008/11/03/what-if-net-would-be-discontinued/</link>
		<comments>http://scriptionary.com/blog/2008/11/03/what-if-net-would-be-discontinued/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 01:09:45 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[what if]]></category>

		<category><![CDATA[windows programming]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=53</guid>
		<description><![CDATA[I&#8217;m not known as a person who particularly likes the .NET framework but I still have to use it. The .NET Framework is basically a massive library of general purpose functions, much like the Standard Library is to C or the Standard Template Library is to C++.
But what if it all would be discontinued?
It&#8217;s not [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://scriptionary.com/blog/wp-content/uploads/2008/11/microsoftnet-logo-100x54.jpg" alt="" title="Microsoft .NET Logo" width="100" height="54" style="float: right; margin: 5px;" />I&#8217;m not known as a person who particularly likes the .NET framework but I still have to use it. The .NET Framework is basically a massive library of general purpose functions, much like the Standard Library is to C or the Standard Template Library is to C++.</p>
<p>But what if it all would be discontinued?</p>
<p>It&#8217;s not an impossibility and rather likely considering Microsoft&#8217;s track-record. The millions of applications, libraries and websites created with .NET would be useless.</p>
<p>I&#8217;ve been *fortunate* enough to be part of a VB6 (CGI) to ASP.NET (VB) conversion team and, trust me when I say this, <strong>you don&#8217;t want to be part of such an effort</strong>. These conversions require truckloads of time and money, and if you work for a mid-sized to large corporation, this could <em>easily</em> lead into the millions of dollars.</p>
<p><img src="http://scriptionary.com/blog/wp-content/uploads/2008/11/foxpro_logo.gif" alt="" title="Microsoft Visual FoxPro Logo" width="70" height="75" style="float: left; margin: 5px;" />Now imagine all of your code obsolete. Everything you&#8217;ve coded since .NET 1.0. What would you do? Let&#8217;s take FoxPro as an example. Microsoft bought FoxPro in 1992 and released a couple of versions under the &#8220;Visual&#8221;-family of products. The last version was released in 2007 and a statement of Microsoft suggests that this is the last version.</p>
<p>No migration tools to any other language are being provided.</p>
<p>Another product would be J#, which will be retired in 2015. Keep in mind that J# is a fairly recent product and was only released with Visual Studio.NET.</p>
<p>How far will .NET go before a turning point is reached? Consider that .NET was first released publicly in 2002 and will be a decade old in less than four years. Knowing Microsoft, the end is quite possibly much nearer than you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/11/03/what-if-net-would-be-discontinued/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Visual Studio 2010 CTP Released</title>
		<link>http://scriptionary.com/blog/2008/10/30/visual-studio-2010-ctp-released/</link>
		<comments>http://scriptionary.com/blog/2008/10/30/visual-studio-2010-ctp-released/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 20:35:53 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[C]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[Visual Studio]]></category>

		<category><![CDATA[windows programming]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=50</guid>
		<description><![CDATA[Maybe this news is a bit old but Visual Studio 2010 CTP was released, you can get it at the following location:
Visual Studio 2010 CTP Site
For you who don&#8217;t know, CTP means Community Technology Preview and can almost be regarded as a public beta version.
For C/C++ developers, you can find more info on the next [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://scriptionary.com/blog/wp-content/uploads/2008/10/visual-studio-2010.jpg" alt="" title="Visual Studio 2010 CTP Banner" width="486" height="47" style="border: none;" />Maybe this news is a bit old but Visual Studio 2010 CTP was released, you can get it at the following location:</p>
<p><a href="https://connect.microsoft.com/VisualStudio/content/content.aspx?ContentID=9790">Visual Studio 2010 CTP Site</a></p>
<p>For you who don&#8217;t know, CTP means Community Technology Preview and can almost be regarded as a public beta version.</p>
<p>For C/C++ developers, you can find more info on the next version of Visual C++ 2010 on the <a href="http://blogs.msdn.com/vcblog/archive/2008/10/28/visual-studio-2010-ctp-released.aspx">Visual C++ Team Blog</a>. I&#8217;m glad to see that IntelliSense for VC++ is being improved since in 2008/2005 it&#8217;s a quite horrible technology. This version also has support for some C++0x functionality.</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/10/30/visual-studio-2010-ctp-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ASP.NET - Name Ambiguous by Nature?</title>
		<link>http://scriptionary.com/blog/2008/10/30/aspnet-name-ambiguous-by-nature/</link>
		<comments>http://scriptionary.com/blog/2008/10/30/aspnet-name-ambiguous-by-nature/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 15:15:22 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[asp.net]]></category>

		<category><![CDATA[C]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[windows programming]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=48</guid>
		<description><![CDATA[First of all, I have to mention that this colleague has been a C and ASM programmer for most of his lengthy professional career, I won&#8217;t mention his name here but let&#8217;s just call him &#8220;Joe the Programmer&#8221; in light of current braindead naming schemes.
Joe the Programmer recently started programming with the .NET framework but [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://scriptionary.com/blog/wp-content/uploads/2008/10/aspnet.png" alt="The ASP.NET logo" title="aspnet" width="108" height="44" style="margin: 5px; float: right;" />First of all, I have to mention that this colleague has been a C and ASM programmer for most of his lengthy professional career, I won&#8217;t mention his name here but let&#8217;s just call him &#8220;Joe the Programmer&#8221; in light of current braindead naming schemes.</p>
<p>Joe the Programmer recently started programming with the .NET framework but yesterday came to a stop. When he was asked to help out with .NET development using ASP.NET, he took some time and to his amazement couldn&#8217;t find the ASP.NET programming language in the Visual Studio &#8220;new project&#8221; dialog.</p>
<p>At first this made me chuckle and I brushed it off, but then I realized he was <strong>correct to assume</strong> that there should be an ASP.NET programming language. After all, there used to be an ASP programming language although it looked suspiciously much like BASIC.</p>
<p>After explaining that ASP.NET is not as much a language but a technology, he went on his way and continued programming.</p>
<p>This all made me think that maybe the name, ASP.NET, is ambiguous, vague and might be a concept difficult to grasp for guys like Joe the Programmer. I just hope that he has a concept of OOP to go along with his newly found knowledge of ASP.NET.</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/10/30/aspnet-name-ambiguous-by-nature/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Amount of Digits in an Integer</title>
		<link>http://scriptionary.com/blog/2008/10/11/amount-of-digits-in-an-integer/</link>
		<comments>http://scriptionary.com/blog/2008/10/11/amount-of-digits-in-an-integer/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 20:59:26 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[C]]></category>

		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=45</guid>
		<description><![CDATA[Here&#8217;s another little snippet that might come in handy in your programmatic travels. I&#8217;ll show you an example of usage below, which might also be of interest to you. The code presented is in C, not C++. First, the code to count the amount of digits in an integer:

const size_t intlen(long long int Num)
{
	size_t out [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another little snippet that might come in handy in your programmatic travels. I&#8217;ll show you an example of usage below, which might also be of interest to you. The code presented is in C, not C++. First, the code to count the amount of digits in an integer:</p>
<pre style="border: 1px solid rgb(204, 204, 204); margin: 5px; padding: 5px; overflow: auto; background-color: rgb(239, 239, 239);">
const size_t intlen(long long int Num)
{
	size_t out = 1;
	while (Num /= 10) ++out;
	return out;
}; // numlen
</pre>
<p>Looks simple enough; simply count the amount of times we can divide the number by 10 without the result being zero. This function takes a copy of an <code>int</code> (or <code>long long</code>) so that we don&#8217;t have to copy the number inside the body of the function and returns a <code>size_t</code> (<code>unsigned int</code>).</p>
<p>As for the usage example, it&#8217;s a bit more complex and might seem a bit &ldquo;obfuscated&rdquo; at first, but fear not, I will explain below.</p>
<pre style="border: 1px solid rgb(204, 204, 204); margin: 5px; padding: 5px; overflow: auto; background-color: rgb(239, 239, 239); height: 250px;">
void inttoa(long long int Num, char** RetVal)
{
	size_t neg = (Num < 0);
	size_t len = intlen(Num) + (neg ? 1 : 0); // add one for the "-" character
	size_t i;

	*RetVal = (char *) malloc(sizeof(char) * (len + 1));

	if (NULL == (*RetVal))
		return; // bad malloc

	if (neg)
		Num = -Num; // make pos if neg

	for (i = len; i; (Num /= 10), --i) // loop backwards
		(*RetVal)[i-1] = (char)((Num % 10) + '0'); // add modulo to char zero

	if (neg)
		(*RetVal)[0] = '-'; // first char

	(*RetVal)[len] = 0; // last char, null terminator
}; // intttoa
</pre>
<p>As you might have suspected, this function converts an integer to character string. First, we determine if the number is negative and retrieve its length with the help of the previous function. We allocate a character string with the length determined and start appending a character to the string.</p>
<p>You can use it like so:</p>
<pre style="border: 1px solid rgb(204, 204, 204); margin: 5px; padding: 5px; overflow: auto; background-color: rgb(239, 239, 239);">
char* mystring; // don't allocate, don't do anything
inttoa(42, &#038;mystring); // simply pass it to the function

// do things with the string

free(mystring); // you *do* have to free() the string though
</pre>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/10/11/amount-of-digits-in-an-integer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flattening Multidimensional Arrays</title>
		<link>http://scriptionary.com/blog/2008/10/11/flattening-multidimensional-arrays/</link>
		<comments>http://scriptionary.com/blog/2008/10/11/flattening-multidimensional-arrays/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 20:25:25 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[array]]></category>

		<category><![CDATA[C]]></category>

		<category><![CDATA[matrix]]></category>

		<category><![CDATA[multidimensional]]></category>

		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=44</guid>
		<description><![CDATA[Edit: Thank you, fixitman for the insightful comment; the code has been fixed to work with non-square arrays as well.
In an effort to produce a better performing multidimensional array, I would like to share the following with you. Say we have a Matrix (or multidimensional array) of 5 x 5 integer elements, M. In order [...]]]></description>
			<content:encoded><![CDATA[<div style="margin: 5px; border: 1px solid silver; background-color: #FFE; padding: 5px;"><strong>Edit:</strong> Thank you, fixitman for the <a href="#comment-1452">insightful comment</a>; the code has been fixed to work with non-square arrays as well.</div>
<p>In an effort to produce a better performing multidimensional array, I would like to share the following with you. Say we have a Matrix (or multidimensional array) of <code>5 x 5</code> integer elements, <em>M</em>. In order to allocate such an array in C++, we use the following code:</p>
<pre style="border: 1px solid rgb(204, 204, 204); margin: 5px; padding: 5px; overflow: auto; background-color: rgb(239, 239, 239);">
const size_t Width = 5;
const size_t Height = 5;
int** Array = new int*[Height]; // 2-Dimensional

for (size_t i = 0; i < Height; ++i)
	Array[i] = new int[Width];

// etcetera.

for (size_t i = 0; i < Height; ++i)
	delete[] Array[i];
delete[] Array;</pre>
<p>In order to counter-act this looping behavior, which, in many cases will slow down the program upon allocation and freeing of memory (due to the loops), the array may be flattened like so:</p>
<pre style="border: 1px solid rgb(204, 204, 204); margin: 5px; padding: 5px; overflow: auto; background-color: rgb(239, 239, 239);">
const size_t Width = 5;
const size_t Height = 5;
int* Array = new int[Width*Height]; // 1-Dimensional

// etcetera.

delete [] Array;</pre>
<p>Thus causing fewer allocations than before, and eliminating loops entirely. You might think that the array is entirely out of order, and no logical index can be obtained for selecting e.g.: <code>Array[2][3];</code>. This is where a simple calculation comes in handy.</p>
<p><code>A<sub>X,Y</sub> = (Y x Width) + X</code></p>
<p>With this calculation we can select our element by doing the following:</p>
<pre style="border: 1px solid rgb(204, 204, 204); margin: 5px; padding: 5px; overflow: auto; background-color: rgb(239, 239, 239);">
[...]
// desired position:
const size_t X = 2;
const size_t Y = 3;
[...]
int RequestedInteger = Array[(Y*Width)+X];
</pre>
<style type="text/css">
.exampleTable
{
	float: right;
	margin:0px;
	margin-left: 10px;
	padding:0px;
	text-align: center;
	font-family: monospace;
	border: 1px solid #333;
}
.exampleTable tr
{
	border-collapse: collapse;
}
.exampleTable td, th
{
	padding: 2px;
}
.exampleTable td
{
	border: 1px solid #333;
}
.exampleTable th
{
	background-color: #EEE;
}
</style>
<table class="exampleTable" cellpadding="0" cellspacing="0">
<tr>
<th>O</th>
<th>0</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th rowspan="7" style="vertical-align: top;">X</th>
</tr>
<tr>
<th>0</th>
<td>0</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr>
<th>1</th>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
</tr>
<tr>
<th>2</th>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
</tr>
<tr>
<th>3</th>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
</tr>
<tr>
<th>4</th>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
</tr>
<tr>
<th colspan="6" style="text-align: left;">Y</th>
</tr>
</table>
<p>This works because if we visualize our flattened array&#8217;s indexes in a table (right &rarr;), we can see that if we take Y (3) and multiply it by the Width (5) we get the appropriate first index of the row (15, or 0,3). If we add X (2) we have selected index 17, which is the index we want (X<sub>2</sub>, Y<sub>3</sub>).</p>
<p>This implementation is faster because we only allocate one single block of memory of X*Y instead of X*Y blocks of memory. The disadvantage of this is that to select any index from the array, you will have to calculate the expression, but this is a minor operation compared to the allocation/de-allocation loops.</p>
<div style="clear:both;></div>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/10/11/flattening-multidimensional-arrays/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CriticalSection wrapper class</title>
		<link>http://scriptionary.com/blog/2008/08/22/criticalsection-wrapper-class/</link>
		<comments>http://scriptionary.com/blog/2008/08/22/criticalsection-wrapper-class/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 15:09:39 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[C]]></category>

		<category><![CDATA[posix]]></category>

		<category><![CDATA[pthreads]]></category>

		<category><![CDATA[snippets]]></category>

		<category><![CDATA[windows programming]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=41</guid>
		<description><![CDATA[What: A C++ wrapper around both WINAPI (Microsoft Windows) and PThreads (POSIX threads) functionality.
Why: To abstract cross platform functionality.
Remarks: On  windows, CRITICAL_SECTION objects cannot be shared cross-process. This means that the class is tied to your application or DLL process. Comments are in Doxygen/Javadoc style.

#ifdef _WIN32
#include &#60;windows.h&#62;
#else
#include &#60;unistd.h&#62;
#include &#60;pthread.h&#62;
#endif

/**
 * @class A wrapper-class around [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What:</strong> A C++ wrapper around both WINAPI (Microsoft Windows) and PThreads (POSIX threads) functionality.<br />
<strong>Why:</strong> To abstract cross platform functionality.<br />
<strong>Remarks:</strong> On  windows, CRITICAL_SECTION objects cannot be shared cross-process. This means that the class is tied to your application or DLL process. Comments are in Doxygen/Javadoc style.</p>
<pre style="overflow: auto; height: 400px; background-color: #EFEFEF; margin: 5px; padding: 5px; border: 1px solid #CCC;">
#ifdef _WIN32
#include &lt;windows.h&gt;
#else
#include &lt;unistd.h&gt;
#include &lt;pthread.h&gt;
#endif

/**
 * @class A wrapper-class around Critical Section functionality, WIN32 &#038; PTHREADS.
 */
class CriticalSection
{
public:
	/**
	 * @brief CriticalSection class constructor.
	 */
	explicit CriticalSection(void)
	{
	#ifdef _WIN32
		if (0 == InitializeCriticalSectionAndSpinCount(&#038;this-&gt;m_cSection, 0))
			throw("Could not create a CriticalSection");
	#else
		if (pthread_mutex_init(&#038;this-&gt;m_cSection, NULL) != 0)
			throw("Could not create a CriticalSection");
	#endif
	}; // CriticalSection()

	/**
	 * @brief CriticalSection class destructor
	 */
	~CriticalSection(void)
	{
		this-&gt;WaitForFinish(); // acquire ownership
	#ifdef _WIN32
		DeleteCriticalSection(&#038;this-&gt;m_cSection);
	#else
		pthread_mutex_destroy(&#038;this-&gt;m_cSection);
	#endif
	}; // ~CriticalSection()

	/**
	 * @fn void WaitForFinish(void)
	 * @brief Waits for the critical section to unlock.
	 * This function puts the waiting thread in a waiting
	 * state.
	 * @see TryEnter()
	 * @return void
	 */
	void WaitForFinish(void)
	{
		while(!this-&gt;TryEnter())
		{
		#ifdef _WIN32
			Sleep(1); // put waiting thread to sleep for 1ms
		#else
			usleep(1000); // put waiting thread to sleep for 1ms (1000us)
		#endif
		};
	}; // WaitForFinish()

	/**
	 * @fn void Enter(void)
	 * @brief Wait for unlock and enter the CriticalSection object.
	 * @see TryEnter()
	 * @return void
	 */
	void Enter(void)
	{
		this-&gt;WaitForFinish(); // acquire ownership
	#ifdef _WIN32
		EnterCriticalSection(&#038;this-&gt;m_cSection);
	#else
		pthread_mutex_lock(&#038;this-&gt;m_cSection);
	#endif
	}; // Enter()

	/**
	 * @fn void Leave(void)
	 * @brief Leaves the critical section object.
	 * This function will only work if the current thread
	 * holds the current lock on the CriticalSection object
	 * called by Enter()
	 * @see Enter()
	 * @return void
	 */
	void Leave(void)
	{
	#ifdef _WIN32
		LeaveCriticalSection(&#038;this-&gt;m_cSection);
	#else
		pthread_mutex_unlock(&#038;this-&gt;m_cSection);
	#endif
	}; // Leave()

	/**
	 * @fn bool TryEnter(void)
	 * @brief Attempt to enter the CriticalSection object
	 * @return bool(true) on success, bool(false) if otherwise
	 */
	bool TryEnter(void)
	{
		// Attempt to acquire ownership:
	#ifdef _WIN32
		return(TRUE == TryEnterCriticalSection(&#038;this-&gt;m_cSection));
	#else
		return(0 == pthread_mutex_trylock(&#038;this-&gt;m_cSection));
	#endif
	}; // TryEnter()

private:
#ifdef _WIN32
	CRITICAL_SECTION m_cSection; //!&lt; internal system critical section object (windows)
#else
	pthread_mutex_t m_cSection; //!&lt; internal system critical section object (*nix)
#endif
}; // class CriticalSection
</pre>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/08/22/criticalsection-wrapper-class/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DirectX SDK August 2008</title>
		<link>http://scriptionary.com/blog/2008/08/16/directx-sdk-august-2008/</link>
		<comments>http://scriptionary.com/blog/2008/08/16/directx-sdk-august-2008/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 07:12:01 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[directx]]></category>

		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=40</guid>
		<description><![CDATA[Hot off the press, get it now: DirectX SDK August 2008
]]></description>
			<content:encoded><![CDATA[<p>Hot off the press, get it now: <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=EA4894B5-E98D-44F6-842D-E32147237638&#038;displaylang=en">DirectX SDK August 2008</a></p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/08/16/directx-sdk-august-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Preliminary view of DirectX 11</title>
		<link>http://scriptionary.com/blog/2008/08/15/preliminary-view-of-directx-11/</link>
		<comments>http://scriptionary.com/blog/2008/08/15/preliminary-view-of-directx-11/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 16:51:04 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[direct3d]]></category>

		<category><![CDATA[directx 11]]></category>

		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=39</guid>
		<description><![CDATA[Following is a list of the major features that have been announced to be included in Direct3D 11, the next generation Graphics API included in the DirectX SDK. In my opinion, the changes (rather, additions) brought into this API are excellent so far. It seems as if the API has finally grown up and is [...]]]></description>
			<content:encoded><![CDATA[<p>Following is a list of the major features that have been announced to be included in Direct3D 11, the next generation Graphics API included in the DirectX SDK. In my opinion, the changes (rather, additions) brought into this API are <em>excellent</em> so far. It seems as if the API has finally grown up and is in <em>no way, shape or form</em> comparable with older DX versions and deprecates OpenGL 3.0 at this point.</p>
<p><strong>Major Direct3D 11 Features:</strong></p>
<ol>
<li><strong>Compatibility:</strong> Ability to run on previous generation hardware (9, 10, 10.1)</li>
<li><strong>Multithreading:</strong> Resources may be created asynchronously on separate threads.</li>
<li><strong>Tesselation:</strong> Allows for subdivision surface operations (Fixed Function, not programmable)</li>
<li><strong>Compute Shaders:</strong> Allows for general programming on the CPU, much like NVIDIA&#8217;s CUDA.</li>
<li><strong>No Overhaul:</strong> Direct3D 11 is a superset of Direct3D 10, no learning curve as with 9 &rarr; 10.
</ol>
<p>A DX11 preview should appear in your November 2008 DirectX SDK. Keep your eyes on <a href="http://msdn.microsoft.com/en-us/xna/aa937787.aspx">this page</a> for GDC 2008 DirectX 11 papers.</p>
<p><strong>Notes</strong><small><br />
<strong>1.</strong> Although you may use the Direct3D 11 SDK on older hardware features will naturally be limited to the hardware itself.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/08/15/preliminary-view-of-directx-11/feed/</wfw:commentRss>
		</item>
		<item>
		<title>&#8220;Don&#8217;t worry, it&#8217;s just a warning.&#8221;</title>
		<link>http://scriptionary.com/blog/2008/08/15/dont-worry-its-just-a-warning/</link>
		<comments>http://scriptionary.com/blog/2008/08/15/dont-worry-its-just-a-warning/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 15:34:28 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[asp.net]]></category>

		<category><![CDATA[bad thing]]></category>

		<category><![CDATA[visual basic]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=36</guid>
		<description><![CDATA[I don&#8217;t like Visual Basic, yet in many Microsoft shops, VB is still being used especially in combination with ASP.NET. The problem with Visual Basic is that it&#8217;s not very strongly typed. Conventions are often thrown out of the window and Senior VB developers often hold their seniority as experience which, is more fiction than [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t like Visual Basic, yet in many Microsoft shops, VB is still being used especially in combination with ASP.NET. The problem with Visual Basic is that it&#8217;s not very strongly typed. Conventions are often thrown out of the window and Senior VB developers often hold their seniority as experience which, is more fiction than fact.</p>
<p>How many more times do I have to see <code>Function</code>s which don&#8217;t return anything and should have been declared as <code>Subs</code>.</p>
<p>Or: <code>Variable 'XYZ' is used before it has been assigned a value.</code><br />
Or: <code>Variable declaration without an 'As' clause; type of Object assumed.</code></p>
<p><img src="http://scriptionary.com/blog/wp-content/uploads/2008/08/vb.png" alt="Visual Basic Errors" title="VB Errors and Warnings" style="float: right; margin-left: 5px;" />Ugh. You&#8217;d think that people with 15 years of development experience wouldn&#8217;t dismiss this kind of stuff and just do the right thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/08/15/dont-worry-its-just-a-warning/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OpenGL 3.0 - 1 hour after</title>
		<link>http://scriptionary.com/blog/2008/08/11/opengl-3-0-1-hour-after/</link>
		<comments>http://scriptionary.com/blog/2008/08/11/opengl-3-0-1-hour-after/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 14:57:05 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[opengl]]></category>

		<category><![CDATA[opengl 3.0]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=35</guid>
		<description><![CDATA[Artistic License?
Once upon a time there was a little old API, struggling for its life amongst the giants of software. Little old OpenGL knew that in order to survive it had to adapt to a strange, bewildering and new environment; it was a strange new world indeed. For two years, rumors of old OpenGL&#8217;s struggles [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Artistic License?</strong></p>
<blockquote cite="Artistic License?"><p>Once upon a time there was a little old API, struggling for its life amongst the giants of software. Little old OpenGL knew that in order to survive it had to adapt to a strange, bewildering and new environment; it was a strange new world indeed. For two years, rumors of old OpenGL&#8217;s struggles reached the user-groups and there was much rejoicing indeed. But on one faithful day, August the 11<sup>th</sup> of 2008, OpenGL perished. Its age and idleness had (as with all things good and bad) caught up with him and slayed little old OpenGL in its path.</p></blockquote>
<p>After reading <a href="http://opengl.org/registry/doc/glspec30.20080811.pdf">the spec</a> and looking <strong>desperately</strong> for the promised <a href="http://scriptionary.com/blog/2008/05/15/why-opengl-30-is-important/">object model</a>, I felt quite like a <em>(self-censored)</em> taking the newsletters seriously and writing about them so explicitly.</p>
<p>For those who haven&#8217;t read the specification yet, it&#8217;s OpenGL 2.1 plus and minus some stuff, <em>hardly the fruition of two years labor</em>. The anticipation that followed the initial announcement of OpenGL 3.0&#8217;s Object Model was tremendous. For the first time in a long time, people started noticing OpenGL again and maybe a place for it in modern multimedia applications such as PC games besides <a href="http://www.idsoftware.com/">id Software</a>&#8217;s titles.</p>
<p>Alas, it was not to be. Woe is me for my old API is truly dead. D3D, hello.</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/08/11/opengl-3-0-1-hour-after/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OpenGL 3.0 Specification - August 2008</title>
		<link>http://scriptionary.com/blog/2008/08/11/opengl-30-specification-august-2008/</link>
		<comments>http://scriptionary.com/blog/2008/08/11/opengl-30-specification-august-2008/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 13:26:26 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[opengl]]></category>

		<category><![CDATA[opengl 3.0]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=34</guid>
		<description><![CDATA[It&#8217;s here, (Edit: It&#8217;s official) haven&#8217;t read it yet but here it is:
The OpenGL &#174; Graphics System: A Specification (Version 3.0 - August 11, 2008)
Link to the registry containing the link
Let me know what you think of it, thanks nosmileface!
]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s here, (Edit: It&#8217;s official) haven&#8217;t read it yet but here it is:</p>
<p><a href="http://opengl.org/registry/doc/glspec30.20080811.pdf">The OpenGL &reg; Graphics System: A Specification (Version 3.0 - August 11, 2008)</a><br />
<a href="http://www.opengl.org/registry/">Link to the registry containing the link</a></p>
<p>Let me know what you think of it, thanks <i>nosmileface</i>!</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/08/11/opengl-30-specification-august-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NVIDIA to Release OpenGL 3.0 Drivers September</title>
		<link>http://scriptionary.com/blog/2008/07/25/nvidia-to-release-opengl-3-0-drivers-september/</link>
		<comments>http://scriptionary.com/blog/2008/07/25/nvidia-to-release-opengl-3-0-drivers-september/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 13:54:22 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[NVIDIA]]></category>

		<category><![CDATA[nvision]]></category>

		<category><![CDATA[opengl 3.0]]></category>

		<category><![CDATA[siggraph]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=33</guid>
		<description><![CDATA[It&#8217;s been a while since I posted but this one will make up for it. A messy screenshot of NVIDIA&#8217;s 2008 timeline has emerged on Chilehardware (CHW) and reveals that OpenGL 3.0 drivers/implementation will be due in September of this year in a collection called Big Bang II (Big Bang I was SLI).
CHW member KaiserGerhardI [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I posted but this one will make up for it. <a href="http://www.chw.net/foro/nvidia-lanzara-big-bang-ii-en-septiembre-t170487.html">A messy screenshot</a> of NVIDIA&#8217;s 2008 timeline has emerged on Chilehardware (CHW) and reveals that OpenGL 3.0 drivers/implementation will be due in September of this year in a collection called Big Bang II (Big Bang I was SLI).</p>
<p>CHW member<a href="http://www.chw.net/foro/nvidia-lanzara-big-bang-ii-en-septiembre-t170487p2.html#post2167143"> KaiserGerhardI has provided a deciphering</a> of the screenshot which provides more information on the contents of the screenshot:</p>
<ul>
<li>First: Quad ?????? Release February</li>
<li>Hybrid Shipped Spring</li>
<li>Spring Notebook Cycle</li>
<li>GT200 + ????</li>
<li>Big Bang II-Fall Will Focus on
<ul>
<li>Now/WWW features</li>
<li>SLI connectivity features</li>
<li>Display connectivity</li>
<li>Quality improvements</li>
<li>Performance improvements</li>
<li>OpenGL 3.0</li>
</ul>
</li>
</ul>
<p>The words which could not be deciphered are marked with question marks. What this means for OpenGL enthusiasts and developers is that we won&#8217;t have to attend SIGGRAPH, NVISION or any other meeting for that matter, since this is basically a confirmation on its own.</p>
<p>Now, let&#8217;s hope that ATI will also provide an implementation this soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/07/25/nvidia-to-release-opengl-3-0-drivers-september/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Geforce GTX 200 Series Announced</title>
		<link>http://scriptionary.com/blog/2008/06/16/geforce-gtx-200-series-announced/</link>
		<comments>http://scriptionary.com/blog/2008/06/16/geforce-gtx-200-series-announced/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 17:24:35 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[gtx 200]]></category>

		<category><![CDATA[gtx 280]]></category>

		<category><![CDATA[NVIDIA]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=31</guid>
		<description><![CDATA[NVIDIA officially announced its new line of GPUs today on their website. Two models from the line have been announced, namely the GTX 260 and the GTX 280.
NVIDIA claims that the cards have a 50% performance increase over the Geforce 8800 Ulltra (figures anyone?). Below are some highlighted specs for the high-end GTX 280:



NVIDIA Geforce [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://scriptionary.com/blog/wp-content/uploads/2008/06/geforce_gtx_280_3qtr_thumb.jpg" alt="tx 280" title="gtx 280" width="158" height="108" style="float: right; margin: 5px;" />NVIDIA <a href="http://www.nvidia.com/object/io_1213610051114.html">officially announced</a> its new line of GPUs today on their website. Two models from the line have been announced, namely the <a href="http://www.nvidia.com/object/geforce_gtx_260.html">GTX 260</a> and the <a href="http://www.nvidia.com/object/geforce_gtx_280.html">GTX 280</a>.</p>
<p>NVIDIA claims that the cards have a <strong>50% performance increase</strong> over the Geforce 8800 Ulltra (figures anyone?). Below are some highlighted specs for the high-end GTX 280:</p>
<table align="center" style="margin-left: auto; margin-right: auto; width: 350px;">
<tr>
<td colspan="2">
<h3>NVIDIA Geforce GTX 280</h3>
</td>
</tr>
<tr>
<td><strong>Processor Cores</strong></td>
<td>240</td>
</tr>
<tr>
<td><strong>Graphics Clock</strong></td>
<td>602 MHz</td>
</tr>
<tr>
<td><strong>Processor Clock</strong></td>
<td>1,296 MHz</td>
</tr>
<tr>
<td><strong>Texture fill rate</strong></td>
<td>48.2 billion/second</td>
</tr>
<tr>
<td><strong>Memory</strong></td>
<td>1GB DDR3</td>
</tr>
<tr>
<td><strong>Memory Interface Width</strong></td>
<td>512 bits</td>
</tr>
<tr>
<td><strong>Memory Clock</strong></td>
<td>1,107 MHz</td>
</tr>
<tr>
<td><strong>DirectX Version</strong></td>
<td>10</td>
</tr>
<tr>
<td><strong>OpenGL Version</strong></td>
<td>2.1</td>
</tr>
<tr>
<td><strong>Card Dimensions</strong> (WxHxL)</td>
<td>2 Slots x 4.376&#8243; x 10.5&#8243;</td>
</tr>
</table>
<p>I&#8217;d love to see a benchmark done on this puppy.</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/06/16/geforce-gtx-200-series-announced/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DirectX 11 @ NVISION 2008</title>
		<link>http://scriptionary.com/blog/2008/06/12/directx-11-nvision-2008/</link>
		<comments>http://scriptionary.com/blog/2008/06/12/directx-11-nvision-2008/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 21:15:15 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[directx 11]]></category>

		<category><![CDATA[nvision]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=30</guid>
		<description><![CDATA[DirectX 11 is to be presented at NVISION 08, click here for details.
Looking at the few mentioned features on the page (tessellation, multithreaded rendering, compute shaders, Shader Model 5), I&#8217;d say OpenGL is in big trouble if they want to catch up.
]]></description>
			<content:encoded><![CDATA[<p>DirectX 11 is to be presented at NVISION 08, <a href="http://speakers.nvision2008.com/agenda/pop_session.cfm?sessionid=39" target="_blank">click here for details</a>.</p>
<p>Looking at the few mentioned features on the page (tessellation, multithreaded rendering, compute shaders, Shader Model 5), I&#8217;d say OpenGL is in big trouble if they want to catch up.</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/06/12/directx-11-nvision-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Vista and DirectX 10</title>
		<link>http://scriptionary.com/blog/2008/06/02/vista-and-directx-10/</link>
		<comments>http://scriptionary.com/blog/2008/06/02/vista-and-directx-10/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 20:44:16 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[directx 10]]></category>

		<category><![CDATA[NVIDIA]]></category>

		<category><![CDATA[vista]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=29</guid>
		<description><![CDATA[This weekend I took some time out to reformat my development computer in preparation for Windows Vista. I used Vista before but switched back to XP x64 in less than a week&#8217;s time. But heck, after a year and a Service Pack, I was willing to take the chance with Vista.
I wanted to take advantage [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I took some time out to reformat my development computer in preparation for Windows Vista. I used Vista before but switched back to XP x64 in less than a week&#8217;s time. But heck, after a year and a Service Pack, I was willing to take the chance with Vista.</p>
<p>I wanted to take advantage of the DirectX 10 features Vista exposes since they&#8217;re not available on XP but was kind of disappointed with the performance of the API in Vista. It seems to me that the samples provided in the DirectX SDK simply run much slower than on XP.</p>
<p>Granted, I bought the most budget oriented GPU that supports DX10 (Geforce 8500GT 512VRAM) but that was simply because of the reason that I want my projects to be able to run on the lowest budget hardware possible while still being able to access DX10-like features. Dell, in fact, offers the 8400 on their laptops and budget desktop PCs, which is a fair share of the market and <em>should</em> be targeted.</p>
<p>Vista itself seems pretty solid so far; it certainly responds better than a year ago and supports all of my hardware and development tools (VS 2008, AQTime, Intel C++ compiler, etc). The big test will be OpenGL: Will it also have performance drops or stay the same? I&#8217;ll see tonight.</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/06/02/vista-and-directx-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why OpenGL 3.0 is Important</title>
		<link>http://scriptionary.com/blog/2008/05/15/why-opengl-30-is-important/</link>
		<comments>http://scriptionary.com/blog/2008/05/15/why-opengl-30-is-important/#comments</comments>
		<pubDate>Thu, 15 May 2008 19:36:35 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[direct3d 10]]></category>

		<category><![CDATA[directx 10]]></category>

		<category><![CDATA[opengl]]></category>

		<category><![CDATA[opengl 3.0]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=21</guid>
		<description><![CDATA[Some questions have come up in regards to my last post, The Ghost of OpenGL 3.0, and one of them keeps popping out on top: Why do we need OpenGL 3.0 and What&#8217;s wrong with OpenGL 2.1? This post will attempt to take you through the pre-published materials on the OpenGL API, version 3.0 and [...]]]></description>
			<content:encoded><![CDATA[<p>Some questions have come up in regards to my last post, <a href="http://scriptionary.com/blog/2008/05/08/the-ghost-of-opengl-30/">The Ghost of OpenGL 3.0</a>, and one of them keeps popping out on top: <em>Why do we need OpenGL 3.0</em> and <em>What&#8217;s wrong with OpenGL 2.1</em>? This post will attempt to take you through the pre-published materials on the OpenGL API, version 3.0 and show you the major changes and differences. Or you could simple <a href="#twovsthree">jump to the answer</a> and conclusion without reading the features provided by OpenGL 3.0, if you don&#8217;t feel like getting informed.</p>
<p><strong>TOC:</strong></p>
<ol>
<li><a href="#hw-evo">Hardware Evolution</a></li>
<li><a href="#sw-side">The Software Side</a>
<ol>
<li><a href="#objects">Objects</a></li>
<li><a href="#asynch">Asynchronous Transactions</a></li>
<li><a href="#backward">Backwards Compatibility</a></li>
<li><a href="#fixedfunction">Goodbye, Fixed Function Pipeline</a></li>
</ol>
</li>
<li><a href="#twovsthree">So, what&#8217;s wrong with 2.1?</a></li>
<li><a href="#conclusion">Conclusion</a></li>
</ol>
<p><strong>Terms used:</strong><br />
<em>Mutable</em>: something which <em>can</em> change shape or form.<br />
<em>Immutable</em>: something which <em>cannot</em> change shape or form.<br />
<em>API</em>: Application Programming Interface, an interface designed to allow transactions with a library or application.</p>
<p><a name="hw-evo"></a><br />
<h1>Hardware Evolution</h1>
<div style="text-align: center; margin: 5pt; float: right; border: 1px solid silver; padding: 5pt;"><img src="http://scriptionary.com/blog/wp-content/uploads/2008/05/geforce-100x75.jpg" alt="A GeForce 880 Video Card" title="A GeForce 880 Video Card" width="100" height="75" /><br /><small>Image by: <a href="http://flickr.com/photos/02/440945826/" target="_blank">Rooka</a></small></div>
<p>Besides being a graphics API, OpenGL sets a standard for IHVs (Independent Hardware Vendors) to comply with. By doing this, we can be sure that a certain type of hardware is compliant with a specific set of demands, not unlike what Microsoft has been doing with DirectX 10 and higher, albeit not an open standard. For example, OpenGL 2.0 formally introduced the GLSL (OpenGL Shading Language) which was not available in 1.5, thus forcing IHVs to implement the capabilities according to the OpenGL standard.</p>
<p>A comparison with the Direct3D side of things would be the enforcement of Direct3D 10.1 compliance by setting a mandatory requirement of 4x anti-aliasing.</p>
<p>OpenGL 3.0 is said to be able to function on OpenGL 2.1/DirectX 9 level hardware, so basically anything from the GeForce FX series and upwards (supporting High Level shaders).</p>
<p><a name="sw-side"></a><br />
<h1>The Software Side</h1>
<p><img src="http://scriptionary.com/blog/wp-content/uploads/2008/05/ogl1-100x48.jpg" alt="The OpenGL logo" title="The OpenGL logo" width="100" height="48" style="float: left; margin: 5pt;" />Most of the readers here are programmers, so the hardware side of the OpenGL standard will probably be less interesting to you than the features OpenGL 3.0 will bring. We all know that the OpenGL 3.0 specification has <a href="http://scriptionary.com/blog/2008/05/08/the-ghost-of-opengl-30/">not yet been finalized</a>, so all material discussed here is subject to change and compiled from various sources which I will list at the end of the post.</p>
<p><a name="objects"></a><br />
<h2>Objects</h2>
<div style="text-align: center; margin: 5pt; float: right; border: 1px solid silver; padding: 5pt;"><img src="http://scriptionary.com/blog/wp-content/uploads/2008/05/blocks-100x75.jpg" alt="Building Blocks" title="Building Blocks" width="100" height="75" /><br /><small>Image by: <a href="http://flickr.com/photos/stilleben2001/212593899/" target="_blank">stilleben2001</a></small></div>
<p>One of the major changes that OpenGL 3.0 will introduce is the usage of objects. Yes, the specification is still specified through the C programming language which natively does not support the OOP (Object Oriented Programming) paradigm but a way around this is being implemented.</p>
<p>The objects themselves are similar to native C <code>struct</code>s which are used for creating user-defined data-types. Please note that I refrain from using the word <em>class</em> since a class is a data-type on its own, not found in the C programming language nor used in combination with the OpenGL API.</p>
<p>So far, four object categories have been announced, namely:</p>
<ul>
<li><strong>Templates</strong>
<ul>
<li>Put in simple terms: a placeholder for the definition of a specific object type. Attributes can be set to fulfill the creation of a specific object type. For example, to create an &#8220;image&#8221; object, one must first create a template object with specific parameters for the creation of the image object, set the attributes required for the object and pass it to an image object constructor function, e.g.: <code>glCreateTemplate(GL_IMAGE_OBJECT);</code> returns a <code>GLtemplate</code> object, after which attributes are applied, <code>glCreateImage(<em>variable to GLtemplate object</em>);</code> returns the handle to an image object (see <em>Data Objects</em> below) constructed according to the attributes supplied to the image template. Templates may be modified at any time since they are defined and stored on the client-side.</li>
</ul>
</li>
<li><strong>State Objects</strong>
<ul>
<li>State Objects are simple objects containing a specific set of attributes applicable to multiple objects. State Objects are partially mutable once created, meaning that only certain aspects of the object can be altered after it has been constructed.</li>
</ul>
</li>
<li><strong>Data Objects</strong>
<ul>
<li>The example given above at <em>Templates</em> talked about an &#8220;image object&#8221; which contains image data, stored in a Data Object. These objects have an immutable structure but the data is mutable. These Data Objects get stored VRAM (or RAM depending on the implementation) and can be shared amongst multiple contexts. Examples of Data Objects are Image Objects and Buffer Objects.</li>
</ul>
</li>
<li><strong>Container Objects</strong>
<ul>
<li>The best way to describe a Container Object is by the example of the VAO (Vertex Array Object). The VAO represents a piece of geometry by describing an array of vertices stored in memory and may not be referenced amongst multiple contexts. The Container Object contains a mutable attachment (VAO: Vertex Buffer) and immutable attachment properties.</li>
</ul>
</li>
</ul>
<p>This new object-based system seems to be the biggest part of the restructuring of the standard and it certainly opens up a new realm of possibilities for IHVs/driver implementers. By abstracting the objects to the server-side, the underlying driver code can be optimized to handle the new data-types more efficiently. The more the API pushes to the server-side, the better the performance can potentially be optimized.</p>
<p><a name="asynch"></a><br />
<h2>Asynchronous Transactions</h2>
<div style="text-align: center; margin: 5pt; float: right; border: 1px solid silver; padding: 5pt;"><img src="http://scriptionary.com/blog/wp-content/uploads/2008/05/synch-100x75.jpg" alt="Synchronous requests? A thing of the past." title="Synchronous requests? A thing of the past." width="100" height="75" class="alignnone size-thumbnail wp-image-24" /><br /><small>Image by: <a href="http://flickr.com/photos/jamescridland/2271827325/" target="_blank">James Cridland</a></small></div>
<p>While this basically falls under the &#8220;Objects&#8221; heading, it&#8217;s a feature worth mentioning alone. In an effort to improve parallelism, Object creation calls are asynchronous. This means that during the time that an object is being created, a valid handle to the object has already been returned for usage, even before the object&#8217;s resources have actually been allocated.</p>
<p>What this means is that more commands can be executed on the client side while the server-side takes care of the execution thus resulting in a faster command chain.</p>
<p><a name="backward"></a><br />
<h2>Backwards Compatibility</h2>
<div style="text-align: center; margin: 5pt; float: right; border: 1px solid silver; padding: 5pt;"><img src="http://scriptionary.com/blog/wp-content/uploads/2008/05/gl3backwards.png" alt="OpenGL 3.0 Backwards Compatibility" title="OpenGL 3.0 Backwards Compatibility" width="100" height="100" /></div>
<p>The OpenGL API has always been backwards compatible throughout its revisions and OpenGL 3.0 will not be an exception. Plans have been made to retain backwards compatibility with the current OpenGL 2.1 standard without breaking older applications.</p>
<p>Another feature, which has not been set in stone, is the manner of interoperability between OpenGL 3.0 and 2.1 which would allow an OpenGL 2.1 application to attain an OpenGL 3.0 rendering context.</p>
<p><a name="fixedfunction"></a><br />
<h2>Goodbye, Fixed Function Pipeline</h2>
<p>OpenGL 3.0 removes the fixed function pipeline which was eradicated in the Direct3D API in version 10. This means that many parts of a normal graphics pipeline are now programmable. This is a huge shift towards the future of a fully-programmable graphics pipeline which would be the definitive step in perfecting a graphics API.</p>
<p>The removal of the so-called &#8220;fixed function&#8221; pipeline means that all graphical output has to be defined through the &#8220;programmable pipeline&#8221; though a mechanism often called &#8220;Shaders.&#8221; Shaders are programmed in a language called the OpenGL Shading Language (GLSL or glslang) or through an intermediary language such as Cg. Shaders not only allow for shading the geometry but also the transformation of its vertices (vertex shader) and individual pixels (fragment shader).</p>
<p>If you&#8217;ve read the heading above this one, you&#8217;ll notice that OpenGL 3.0 is backwards compatible with older versions which support the fixed pipeline functionality. OpenGL also supports these functions but internally these are transformed into the form of shaders.</p>
<p>OpenGL version &#8220;Mount Evans&#8221;, which will be released <em>after</em> OpenGL 3.0, will support the functionality provided by Geometry Shaders which allows for the manipulation of &#8220;pieces&#8221; of geometry and generation of new geometry as well. This allows the programmer to take advantage of currently available hardware-accelerated functionality such as tessellation. Even though this functionality is <em>said</em> to be provided after 3.0 has been released, it is likely that this functionality will be provided with the formal release of OpenGL 3.0 instead.</p>
<p><a name="twovsthree"></a><br />
<h1>So, what&#8217;s wrong with 2.1?</h1>
<p>By now you might have noticed that I haven&#8217;t exactly formally answered the question &#8220;What&#8217;s wrong with OpenGL 2.1?&#8221; The answer is: There&#8217;s nothing wrong with OpenGL 2.1.. informally. OpenGL 2.1 is a very capable API which <em>could</em> support many of the features that OpenGL 3.0 incorporated. The big difference is of course that the functionality in OpenGL 3.0 will be a formal standard while the 3.0-like functionality in OpenGL 2.1 is provided through IHV-developed OpenGL extensions which may differ from one and other.</p>
<p>The above, and the fact that the new API works with Objects, is causing the anticipation. OpenGL 3.0 will formally push the API into the next-generation era and will finally be able to compete with Direct3D 10, which is why OpenGL 3.0 is important.</p>
<p><a name="conclusion"></a><br />
<h1>Conclusion</h1>
<div style="text-align: center; margin: 5pt; float: right; border: 1px solid silver; padding: 5pt;"><img src="http://scriptionary.com/blog/wp-content/uploads/2008/05/ogl1-100x48.jpg" alt="The OpenGL logo" title="OpenGL Logo" width="100" height="48" /><br /><small>The OpenGL API Logo</small></div>
<p>As said above, OpenGL 3.0 will push the API into the next generation. In my personal opinion, the new structure of OpenGL 3.0 could severely compromise the position of Direct3D in the Microsoft Windows gaming market since the functionality provided with OpenGL 3.0 will also work on Windows XP, unlike Direct3D 10. Vista is still being viewed upon as somewhat of a quirky Operating System and many developers and users are sticking with XP for the time being.</p>
<p>I&#8217;d like to conclude by saying that this post does <strong>not</strong> present all of the new published features in OpenGL 3.0, rather it lists the features which I find most compelling about the new API. Also, I&#8217;m not affiliated with the Khronos Group in any way so everything you read here is non-official and compiled from various online sources, talking about the unfinished and proposed API. Last but not least, I don&#8217;t guarantee the correctness of the article, nor the correctness of the sources used &#8212; correct me if I&#8217;m wrong about something.</p>
<h2>Sources Used</h2>
<ul>
<li><a href="http://www.opengl.org/pipeline/">OpenGL Pipeline Newsletters</a></li>
<li><a href="http://www.opengl.org/discussion_boards/">OpenGL.ORG Discussion Boards</a></li>
<li><a href="http://en.wikipedia.org/wiki/OpenGL">Wikipedia article on OpenGL</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/05/15/why-opengl-30-is-important/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NVIDIA PhysX SDK + more</title>
		<link>http://scriptionary.com/blog/2008/05/14/nvidia-physx-sdk-plus-more/</link>
		<comments>http://scriptionary.com/blog/2008/05/14/nvidia-physx-sdk-plus-more/#comments</comments>
		<pubDate>Wed, 14 May 2008 17:14:11 +0000</pubDate>
		<dc:creator>E. Luten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[free]]></category>

		<category><![CDATA[gratis]]></category>

		<category><![CDATA[NVIDIA]]></category>

		<guid isPermaLink="false">http://scriptionary.com/blog/?p=26</guid>
		<description><![CDATA[As you might know, NVIDIA has recently purchased Ageia, makers of the PhysX real-time physics SDK. Since then, NVIDIA has taken over the development of the SDK and a new version of the SDK is now available for free in binary form from the NVIDIA website, click here to go to check it out. A [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://scriptionary.com/blog/wp-content/uploads/2008/05/physx-100x35.jpg" alt="NVIDIA PhysX" title="NVIDIA PhysX" width="100" height="35" style="float: right; margin: 5pt;" />As you might know, NVIDIA has recently purchased Ageia, makers of the PhysX real-time physics SDK. Since then, NVIDIA has taken over the development of the SDK and a new version of the SDK is now available for free in binary form from the NVIDIA website, <a href="http://developer.nvidia.com/object/physx.html">click here to go to check it out</a>. A special license for the source code version of the SDK can be acquired for a mere $50K.</p>
<p>In other NVIDIA news: two new free book releases are now available on the NVIDIA website, namely: <a href="http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter01.html">The Cg Tutorial</a> and <a href="http://http.developer.nvidia.com/GPUGems2/gpugems2_part01.html">GPU Gems 2</a> which are two incredibly useful books. NVIDIA is on a roll, and looking at the manner in which freebies are coming in lately, I&#8217;ll be the last one to stop &#8216;em.</p>
]]></content:encoded>
			<wfw:commentRss>http://scriptionary.com/blog/2008/05/14/nvidia-physx-sdk-plus-more/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
