It’s almost weekend, and time for a lighthearted post on the two realtime 3D computer graphics libraries that are available on Windows in 2011: OpenGL and Direct3D. The reason I mention the year is simply because of the fact that two years from now, this information will be as untrue as the Wikipedia article* on this matter due to rapid hardware and software developments. But for now, let’s bash it out.

Read the rest of this entry »

Creating a Window Wrapper Class: Redux

Okay, so I know you’re probably here because you searched for “window wrapper class” or something similar and expected the article that I use to host on Scriptionary that threw a bunch of C++ code at you for you to copy and paste. I regret to inform you that the article you were looking for has ceased to exist. Sorry about that.

However, in its place I have for you this very post which will teach you how to accomplish creating such a wrapper all by yourself. I hope that is okay since all you really need to know is the how to create a window procedure that you can use with your custom class.

Read the rest of this entry »

A High-Resolution Timer for Win32

This post lists the code for creating a high resolution timer for the Microsoft Windows platform. High resolution timers are often used in multimedia and entertainment applications for timing events up to the microsecond.

This is a heavily modified re-post of the article that used to be on the Scriptionary.com website before the change to the blog, read the source code for details.

Read the rest of this entry »

Counting Processor Cores and Threads

Wafer showing many Intel Nehalem cores
Here’s a little snippet I’d like to share with you since there really isn’t a good example online that shows you how to count the processor cores and threads on Microsoft Windows using the Windows API through C++.

If you have the need to count cores, or if you wish to determine if the system running your program is multicore, this snippet can come in handy.

By “counting threads” I mean counting the logical processors present, since Hyper-Threaded processors may display multiple logical cores per physical core — counting these is the tricky part.

Read the rest of this entry »

DirectX Developer Blog

Apparently, the DirectX team has had a blog since late April of this year it’s just not very popular I guess.

They’ve posted a shipload of information over the last couple of months, so if you’re like me and had no idea this existed, you’ll have quite some reading to catch up to. It’s mostly about Windows 7 and the new graphics APIs (Direct2D, DirectWrite, etc.) but it’s interesting nonetheless.

August 2009 DirectX SDK

DirectX 10 Logo
Yeah, I don’t have the DX11 logo yet…
Today the August 2009 DirectX SDK was released on MSDN, strangely enough the August SDK was released in September.

This release contains the first official release of Direct3D 11 (RTM), which was previously only a technical preview. According to the release notes, this version of Direct3D 11 will only work on the RTM version of Windows 7, not on the RC and Beta versions. So I guess only vendors and MSDN subscribers will be able to develop software until Windows 7 hits the retail market.

There’s also the issue of pure Direct3D 11 hardware not being sold yet but that should be right around the corner if the SDK is here.

Don’t use Turbo C, that’d be great yeah..

Turbo C++I don’t know how many times I’ve ran into people that need help with a piece of C code that should run perfectly fine but for some reason it just doesn’t. Of course, after much going back and forward, you find out that the person you’re trying to help is using Borland’s Turbo C compiler version 2.01, released 20 years ago in 1989..

While the compiler is freely download-able from several websites labeled as an “Antique”, it’s really not a great tool to start programming with on modern systems. If you really (really) want to use Turbo C, buy an old 286 and go at it but don’t use your Intel Core i7. Here’s why. PS, this also applies to Turbo C++

1. The compiler is 20 years old, it won’t support the current C99 standard so many things you might have learned, you now have to unlearn in order to get the program working.

2. Turbo C is an MS-DOS compiler, chances are if you are learning C now, you have never used DOS in your life; there’s no reason to go back, nostalgia doesn’t apply to DOS. Furthermore, Windows does not support DOS programs from the 80′s, so you would have to emulate DOS in order to get your programs working properly.

3. There are many free compilers available that are 100% compatible with today’s hardware and not bound by any limitations. Even if your Turbo C compiler is 32 bit compatible, it’s not a great match for your 64 bit CPU and Operating System.

4. You’re stuck on the command line interface with no way out. Even if you make the best command line program for DOS, nobody besides yourself will ever want to use it. Converting your program to Win32 requires a new compiler that will yell at you for using coding practices from 1989 and break your program.

In other words, if the following code compiles without warning, you know you need another compiler.

#include <stdio.h>

main()
{
    printf("Hello, World!");
}

March 2009 DirectX SDK

DirectX 10 LogoOK, so only one day after I publicly whined “where is the DX SDK?” Microsoft has released the March 2009 version. Go figure. Get it here at DirectX 2009 SDK @ MS Download.

Also, there seems to be some interesting stuff bundled with this version of the SDK, here’s my take on the important stuff:

  • Technical Previews
    • Direct2D
    • DirectWrite
    • DXGI 1.1
  • PIX works on the Windows 7 beta
  • Several updated samples

Check out the details at the link posted above. Also, it doesn’t look like the online MSDN library docs have been updated yet but usually that happens pretty quickly.

« Previous Entries