Navigation menu:

Latest news:

Mar 22nd, 2013:
Updated the MayaFPS plug-in to version 1.1.0. The update allows the user to select which mouse button will engage first person controls (RMB/XButton1/XButton2). Suggested by JO.

Search:


XML: RSS Feed XML: Atom Feed

Category list:

Tag Cloud:

Archives

A long time ago I made a CListNode class and a corresponding CListT<type> class, just like a lot of programmers out there I guess. The CListNode class simply has next and previous pointers, and objects that need to be stored in an intrusive list needed to derive from CListNode. I also had a CTreeNode class which derived from CListNode, and a CTreeT<> template class which implemented an intrusive tree. Well that approach worked well enough in a lot of situations, but it has limitations. Then I came across John McCutchan's Intrusive Lists post on #AltDevBlogADay, and I liked what he was doing. But if we're going to have an intrusive list, we might as well have an intrusive tree as well, in case we need to go hierarchical.

Read More

| [C++] Intrusive Trees | Used tags: ,

projtexsample.jpg Not much to say. I've created this to help myself better-understand how projecting textures works, and thought I'd post it. I initially thought about writing a full description of the theory, but there are LOTS of resources on the internet already about this subject. For example, this is a good one.

I've stolen the texture used in this sample from http://www.thief-thecircle.com/. Don't tell.

| Direct3D Projective Texturing Sample | Used tags: , , ,

There is actually nothing special about fullscreen windows. A fullscreen window is just a window which has no borders or caption bar, and which has the same size as the screen. This little snippet of code and accompanying demo demonstrate this.

Read More

| [win32] Fullscreen Windows | Used tags: , ,

TinyXML2 (and possibly 1) does the following:

As a first step, all newlines / carriage-returns / line-feeds are normalized to a line-feed character, as required by the XML spec.

TinyXML logoThe practical meaning of this is that when your application stores text retrieved from an edit control to xml, tinyxml will “normalize” it. When you set the text in an edit control from xml that was saved previously using tinyxml, the edit control will not show new lines appropriately. To “fix” this, here is what you do:

Read More

| TinyXML2, New Lines, & Multi-line Edit Controls | Used tags: ,

If you decide that you want to use global variables, you may find yourself needing to declare those globals in a header file and defining (and initializing) them in a cpp file. As the list of globals grows longer, the inconvenience of keeping the declaration list and definition list in sync grows.

Read More

| [C++] Unifying Global Variable Declarations & Definitions Using The Preprocessor | Used tags: ,

This post is, as the title appropriately suggests, about the implementation of a simple event system for use in C++ applications, which is a fancy name for a list of function/method pointers. The main purpose of an event system is to have some code in a part of the application (module) be called whenever an event in another module takes place. An event system is a great tool for increasing code modularity and reducing dependencies and unnecessarily complex class hierarchies.

Read More

| [C++] A Simple Event System | Used tags: ,

The first thing that someone starting Windows GUI programming will likely miss is a simple way to output some text from his application. Using OutputDebugString() is a convenient approach for printing debug messages not intended to the end user, but that's not always enough. This simple class is an attempt to restore this functionality easily. The API is simple enough and uses the printf() formatting which should be familiar to all C(++) programmers. The CLogWindow class creates a window which just contains an edit control, and sends all text to that edit control. In addition, the CLogWindow class will also optionally write the text to a file so that it can be examined after a crash or for whatever reason.

Read More

| [Win32] Simple Text Output Window (Log Window) | Used tags: ,

Hi. For engine editors and tools, rendering to multiple windows is important. Once people ask how they should go about using Direct3D to render to multiple windows, they are most often directed to look into using multiple swap chains, one swap chain per window. However, this incurs a video memory penalty per window, as well as a noticeable performance penalty associated with recreating the swap chain whenever the window changes its size. Sometimes windows are laid out such that resizing one window will resize 3 more windows as well, making resizing a slow operation. Also, creating a swap chain could fail on some hardware if the window has a weird size (I'm not sure). There is another approach which is using a separate rendering device per window, but it's even worse, and it's not recommended. This post and sample code describe another more efficient approach.

Read More

| Efficient Multiple Windows in Direct3D | Used tags: , ,

I've written a small wrapper class for the uxtheme API called UXThemeProxy. It attempts to load uxtheme.dll at run-time, and if it fails (like if theming is not available, as in Win2K), the application can respond accordingly, typically by using classic drawing routines. The alternative is to link to uxtheme.lib and use the API functions directly, introducing a hard-dependency on uxtheme.dll, and your application won't run on pre-XP Windows (win2K), or (and I could be wrong here) if theming is disabled.

Read More

| UXTheme Wrapper | Used tags: , ,

This sample demonstrates how to create a win32 dialog box in memory (in code) without using a dialog template resource, which are typically created using a resource editor. This is especially useful for generating dynamic dialog boxes based on varying inputs. I clearly remember spending too much time with an MSDN sample demonstrating "dialog templates from memory" only to discover later it had a bug in it that makes it crash. Not the awesomest of memories.

Read More

| [win32] Building a Dialog Box in Memory | Used tags: , ,

[Update 25/3/2013] Normal-mapping version has been added. See below.

[Update: 15/7/2012] While there are newer and better file formats for storing and exchanging geometry or meshes between applications, the OBJ file format is still rather widely in use by many of the largest content authoring applications. If you find yourself in need of loading OBJ meshes in your application without using the FBX SDK, this demo/sample should be very helpful!

Read More

| [C++] Direct3D OBJ Viewer Sample | Used tags: , ,

bbtablet, developed by William Baxter, is a bare-bones WinTab wrapper C++ API for making the lives of Win32 programmers who wish to have tablet support in their apps a lot easier. Long story short, Curver, an application I'm working on, uses it, and it suddenly broke. I toyed around with it and I think I fixed the problem. I could be wrong here, as I haven't delved too deep into the WinTAB API.

Read More

| bbTablet Fix | Used tags: ,