Tag Archive: c++

Jun
23
2012

Thread-Safe Random Access to Zip Archives

Flow chart illustrating the logic employed by my ZLib extraction cache
Many games choose to store their resources in packages instead of shipping the potentially thousands of individual files directly. This is sometimes an attempt at tamper-proofing, but mostly it is about performance. Try copying a thousand 1 KiB files from one drive to another, then copy a single 1 MiB file on the same way …

Continue reading »

Jun
15
2012

Code Better: Headers without Hidden Dependencies

When you work on a larger project, you cannot easily keep track of which header depends on which other header. You can (and should) do your best to keep the number of other headers referenced inside your headers low (to speed up compilation) and move as many header dependencies as you can into your source …

Continue reading »

Jun
12
2012

How to Delete Directories Recursively with Win32

Well, while I’m at it, here’s the counterpart to the recursive directory creation function from my last post, a function that recursively deletes a directory and all its contents. Ordinarily, you could just use the shell API to achieve this on classic Win32: /// <summary>Deletes a directory and everything in it</summary> /// <param name=”path”>Path of …

Continue reading »

Jun
12
2012

How to Create Directories Recursively with Win32

As I just found out, the CreateDirectory function on Win32 can only create one directory at a time. If one, for example, specifies C:\Users\All Users\FirstNew\SecondNew as the directory to create, and both FirstNew and SecondNew do not exist, then CreateDirectory() fails. That’s less than ideal for some cases. Recently, for example, I wanted my game …

Continue reading »

Mar
29
2012

Ogre 1.8.0 RC1 for WinRT/Metro

Screenshot of the main dialog of the Windows App Certification Kit (ACK)
Here’s an interesting hypothesis: when Apple started its App Store, it was the El Dorado of software developers. Now Microsoft is adding an App Store to Windows 8. The Windows user base is huge, much larger than even the number of people running around with iPhones in their pockets (some estimates I came across average …

Continue reading »

Mar
20
2012

How to Consume DLLs in a WinRT/Metro Project

Screenshot showing where to find the output directory setting in a Visual Studio 11 project
Yesterday, I published a small guide on how to consume DLLs in Visual C++ that explained how to best integrate a third-party library into a Visual C++ project. This is a follow-up article for Visual Studio 11 Beta users that contains the additional steps required to consume a normal (non WinRT Component) DLL in a …

Continue reading »

Social Widgets powered by AB-WebLog.com.