Flattening Multidimensional Arrays

1 minute read

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 to allocate such an array in C++, we use the following code:

Read 489 more words...

CriticalSection wrapper class

2 minute read

2023 Update: You probably don’t want to use this code since there are likely some serious issues with it. But, fun fact: a major tech company reached out to me to clarify what the license for this is. So, if you want to screw yourself over and use it, let’s say it’s MIT licensed and call it a day.

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.

Read 568 more words...

Preliminary view of DirectX 11

less than 1 minute read

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 in no way, shape or form comparable with older DX versions and deprecates OpenGL 3.0 at this point.

Read 115 more words...

Don’t worry, it’s just a warning.

less than 1 minute read

I don’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’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.

How many more times do I have to see Functions which don’t return anything and should have been declared as Subs.

Or:

Variable 'XYZ' is used before it has been assigned a value.

Or:

Variable declaration without an 'As' clause; type of Object assumed.

Ugh. You’d think that people with 15 years of development experience wouldn’t dismiss this kind of stuff and just do the right thing.

OpenGL 3.0 - 1 hour after

1 minute read

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’s struggles reached the user-groups and there was much rejoicing indeed. But on one faithful day, August the 11th 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.

After reading the spec and looking desperately for the promised object model, I felt quite like a (self-censored) taking the newsletters seriously and writing about them so explicitly.

For those who haven’t read the specification yet, it’s OpenGL 2.1 plus and minus some stuff, hardly the fruition of two years labor. The anticipation that followed the initial announcement of OpenGL 3.0’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 id Software’s titles.

Alas, it was not to be. Woe is me for my old API is truly dead. D3D, hello.

NVIDIA to Release OpenGL 3.0 Drivers September

less than 1 minute read

It’s been a while since I posted but this one will make up for it. A messy screenshot of NVIDIA’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 has provided a deciphering of the screenshot which provides more information on the contents of the screenshot:

  • First: Quad ?????? Release February
  • Hybrid Shipped Spring
  • Spring Notebook Cycle
  • GT200 + ????
  • Big Bang II-Fall Will Focus on
    • Now/WWW features
    • SLI connectivity features
    • Display connectivity
    • Quality improvements
    • Performance improvements
    • OpenGL 3.0

The words which could not be deciphered are marked with question marks. What this means for OpenGL enthusiasts and developers is that we won’t have to attend SIGGRAPH, NVISION or any other meeting for that matter, since this is basically a confirmation on its own.

Now, let’s hope that ATI will also provide an implementation this soon.

Geforce GTX 200 Series Announced

less than 1 minute read

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 Ultra (figures anyone?). Below are some highlighted specs for the high-end GTX 280:

NVIDIA Geforce GTX 280 Specs

Processor Cores 240
Graphics Clock 602 MHz
Processor Clock 1,296 MHz
Texture fill rate 48.2 billion/second
Memory 1GB DDR3
Memory Interface Width 512 bits
Memory Clock 1,107 MHz
DirectX Version 10
OpenGL Version 2.1
Card Dimensions (WxHxL) 2 Slots x 4.376″ x 10.5″

I’d love to see a benchmark done on this puppy.

DirectX 11 @ NVISION 2008

less than 1 minute read

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’d say OpenGL is in big trouble if they want to catch up.

Vista and DirectX 10

1 minute read

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’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 of the DirectX 10 features Vista exposes since they’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.

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 should be targeted.

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’ll see tonight.