C++11 Compiler Support Wishlist

A few months back I did this little investigation in to C++11 support across compilers. The goal here was to figure out what C++11 features I could safely use today. I also ended up creating a useful list of compiler versions sorted by platform. I will continue, at least for the near term, updating this list as I see changes. This post is a follow up to that. I’m more familiar now with the actual use of many of these ‘nextgen’ features, so this post is a brief on certain features I really want to use, and why I can or can not use them. ...

Safe C++ Pointers to Member Functions (Functors)

I did a post some time ago on a threading library called TinyThread++. You can find it here. Like always, the following is just a collection of notes. Item 1: TinyThread++ is an almost functionally equivalent alternative to C++11 threads, but instead of taking multiple arguments to the thread it takes a single void*. When C++11 support improves everywhere, that will be the time to switch. But in the meantime, a void* is a good compromise. Item 2: Whenever I describe how and why a member function is different than a global/static function, I often say that a member function has a “secret 1st argument, the ‘this’ pointer”. Heck, if I was going to build a C++ compiler, I would implement it like this. So for the longest time I just assumed this is how others implemented it. If this is true, then it should be possible to convert a member function in to a “void Func(void*)”. * * * Long story short, this behavior is forbidden by the C++ standard. That said, it works in GCC, but fails in MSVC. In GCC’s case, while it does work, it invokes a warning known as “pmf-conversions”. You can explicitly disable the warning with “-Wno-pmf-conversions”, but given that this just doesn’t work in Visual Studio it’s probably unwise to do in the first place. My nice solution was to add a static proxy function that takes a single “this class” pointer, and call the function as if it was a member of the class (because it is). ...

Net Adapter – AKA the “Get IP/MAC address” library

So hey. I wrote and open sourced a small cross platform library for getting the IP and MAC address of the current device. You can find it here: https://github.com/povrazor/net-adapter So far I’ve tested it on Windows, Linux (Ubuntu), and Mac OSX Mountain Lion. It *should* also work on iOS, BSD and Android. If you happen to test it on one of those other platforms, I would love to know what the Sample program outputs....

HTTP GET and POST's from scratch with Sockets

So I’ve done a bunch of networking research lately, and have actually decided I’m not going to continue writing my own HTTP GETter and POSTer. Instead, I’ll be using libcurl. That said, I am not that comfortable using 3rd party libraries and tools unless I have a solid understanding of how they work internally. So this is a collection of notes on how to do HTTP GET and POST requests, in case I ever need to come back and do this from scratch (because I’m not going to remember all this)....

Cross Platform C++ Threading Today

C++11 finally brings threading in to the core C++ language. Unfortunately, as my little investigation found, we’re not quite all there yet. That’s okay though, ‘cause as it turns out, most of core function of C++ threading can be emulated using standard C and C++ features. While doing something else, I stumbled upon a library TinyThread++. It’s lightweight (2+1 source files), cross platform, and free+open source in the best ways possible. http://tinythreadpp.bitsnbites.eu/ TinyThread++ attempts to emulate the usage of standard C++11 threading, in a decent, good enough, compromise way. I like it, so instead of fooling around with pThreads and whatever classic Microsoft APIs do, I’m going to use it. And since it’s so simple (2+1 files), if I need something or need to fix something, it’s right there. Great. Alternatively, there is an equivalent C variant: http://tinycthread.bitsnbites.eu/ ...

Windows 8 C++ Notes

This post is a living collection of notes I’ve taken whilst exploring Windows 8 development. It’s not guaranteed to be well written nor complete, but who knows, maybe it’ll be useful. ...

Practical C++11 Support for Game Developers

So it’s Ludum Dare 24 weekend (Aug 24th), and I’m finally catching up on some work I had to put off as I … ahem … attended to my duties. Now that the event is going strong, it’s reading time! The main thing I need to do is some Windows 8 research. I installed the Windows 8 RTM (release) Trial on a new machine earlier this week, as well as the Visual Studio 2012 Express....

Something new, blue, and not for you

So, I’ve been dabbling with something new. One of the frustrating conclusions I came to whilst working on “Alone, The” was that content creation was way, far far, too much work. I went in to the project with some strong ideals about procedural content being lifeless and uninteresting. I still somewhat believe that, but when reality kicks in, you realize one can not make a seriously large game alone at a decent pace without being somewhat procedural....

BEARly SEASONed

I made a minigame over the past 24-some hours. It’s about a bear, and you eat things. Do what the bear says. Click the image above. Bears....

Because We May Sale

Because We May, a grandiose cross platform mega sale is on right now. Android, iPad, iPhone, PC (Desura), and Blackberry Playbook versions of Smiles and Smiles HD are all heavily discounted and available for about $2. The sale ends June 1st. ...