Ahh, my first developer journal post. Fun stuff, eh? I love the way Gamedev is headed with their GDNet+ membership and everything it provides. I will be using this journal for talking about any projects I am currently working on, and will also be using it to get feedback on where people wish me to direct my attention in future projects. I am very open to suggestions and am willing to develop just about any library that would be useful for many types of projects that plenty of developers can benefit from (within reason -- IE I'm not going to program the next Unreal engine... and if I did, I wouldn't upload it here ;).
Anyway, my first order of duty here is to provide the community with an article that I personally feel is almost a necessity to anyone planning on or currently working with DirectX, or any COM library for that matter, in C++. The planned title is something along the lines of "Why ATL's CComPtr is helpful and why you should never use it," which may give you a general idea of the direction I'll be taking.
With the article, I will be talking about why smart pointers are extremely useful when working with COM and why Microsoft's ATL COM smart pointer templates get it wrong in some areas from a C++ programmer's perspective. In addition, I will provide a suggested coded solution for what ATL attempts to provide, along with C++ wrapper functions and objects for Microsoft's procedural COM library featuring exception throwing instead of HRESULT returns and an easier method for dealing with factories. As well, I will also provide exception safe copyable objects for dealing with COM construction and destruction which allow you to easily determine if the COM settings in your current thread are acceptible for your application (which normally can be quite a hassle).
So, hopefully I'll be able to bring you some info that you may not have known about COM, or perhaps knew yet didn't give much thought as to how it should impact your development.
For those who are interested, be warned that I use a lot of advanced C++ template features, particularly a reliance on the SFINAE principle in conjunction with partial specialization. While everything I do is 100% standard C++, some compilers may have trouble with them. My current target for these libraries is Microsoft Visual C++ .NET 2003 as most people who work with COM are working on a Microsoft compiler to begin with, coupled with the fact that their template support is very compliant (for instance, I know that if I port the code to be used with GCC I will have to make some work-arounds for G++'s partially broken SFINAE implementation).
So, anyone who is interested in this project, please let me know. I'm happy to answer any questions you may have and would be willing to take suggestions both for the planned article as well as ideas for the project and even future projects.
My next project (which is already pretty far along in development) is a complete 3D sound manager built around DirectMusic providing facilities for loading sounds and creating generators positioned and oriented in 3D. Supported features include everything that DirectMusic can provide through DirectSound, particularly environmental effects, doppler effects, manual pitch and volume adjustments on both a persound or pergenerator basis, etc. The more abstract feature, and potentially the most useful, is the ability to set the maximum amount of active generators available as well as the ability to create any amount of generators you wish coupled with user-defined priorities (the type of which you can specify through a template parameter making customizability to your application a snap). The manager will automatically move your extra generators into and out of the active generator container based on what priority they have, so you can have lots of objects in a level and have a very simple way of ensuring that the most important sounds (usually the closest sounds or explosions, etc) always get heard without having to manually deal with the intricacies of managing activation and deactivation of generators. The order of an operation which switches the priorities of an already created generator is proportional to log(n), where n is the amount of different priority values that are currently being used. For speed purposes, there will also be a form without priorities that is slightly more optimized than having a manager with priorities where all the priorities are the same. Of course, the latter's uses are much less general than the former. Due to the nature of this project, I'll probably upload it along with documentation, but not make an article about it (unless, of course, I get enough positive feedback to warrant one).
Also, just so I can see if people (and which people) actually read this, please leave a comment of some sort -- even if it's just to say hi. Thanks.