SDXM Snowy Demo

So I went to the trouble of staging this demo on my newest “powerful” PC and presenting it to you in 4K so you can’t say it looks like shit. Even if it’s rendered at only 640×480. But it gives a very good idea what the final graphics might look like. Told y’all, PlayStation 2 quality. It’s coming…

Behold, Glorious 320×240 Resolution!

Here’s a demo that actually starting to resemble a video game. But it’s running at 320×240 and pushing about 10,000 triangles per frame per second. So I’m getting between 20 to 32 frames per second. The irony is the demo itself is captured at 60 fps and you can tell by how smooth it flows, which is how it looks live. I tried to capture it like how it plays in realtime.

SDXM 3D Engine Progress LOL

Been developing this thing for a long, long, long time in Qt c++, folks. It’s very fast and optimized. Can’t get vertex array buffering to work on the GPU, but whatevs. I know how to c++ and deal with pointers and memory management and shit, but Qt 4.8 does have it’s limitations. CPU is quite powerful anyway, giving promising results. 800,000 to 1,000,000 polygons per second isn’t that bad, folks. It’s still a long ways yet until production ready. But all the very basic elements are there.

Qt Alternative c++ IDEs and compilers

Here are some Qt alternative c++ compilers and IDEs I’ve been experimenting with:

MinGW pre-compiled c++ headers and compilers:

Code::Block IDE:

MinGW64:

Qt has the awesome QtCreator IDE to work with your projects. But I haven’t progressed beyond Qt 4.8.x so I’m stuck with targeting 32-bit platforms, even though I’m developing on a 64-bit machine.

Code::Block is another noteworthy IDE and apparently runs competently out of the box. I downloaded their minGW installer and it detected all the existing kits on my system. I had to do some minor linking to dependency libraries, but otherwise it was really easy to target 64-bit platforms. But the 64-bit Windows exe uses a lot of CPU resources for some reason. So there might be some extra stuff compiled into it that I’m not familiar with. Otherwise, no fuss.

Lastly, using rubenvb’s precompiled minGW files and compiling through Windows Command Prompt, I’ve been able to successfully target 64-bit platforms. The 64-bit Windows exe runs optimally and doesn’t use up much CPU resources like the ones compiled through Code::Block. But there are some minor quirks like the cursor not adjusting automatically. For example, if you resize the window, the cursor doesn’t revert back to default arrow cursor. So I have to manually set the cursor.

Most of the setup is the same. You download and install your kits and source files, ie, DirectX SDKs, Microsoft SDKs, OpenGL SDKs, Qt SDKs, etc. Then go to Windows Environment Variables and add the correct paths to these kit locations manually. But if your IDEs are robust enough, they might be able to automatically do it for you. If not, you need to find the feature that allows you to set the proper paths to these kits and files. Otherwise, you have to use Windows Command Prompt, which is very clunky, but when it works, you know you can rely on it because it “keeps it simple stupid”.

Have fun playing around with c++ on Windows! And it’s free, you just have to learn a bit! It’s worth it, kids.

Tips and tricks for c++ pointers and operators

If you really want to get the best performance from your c++ coding adventures, you’re gonna have to really get deep into the low-level experience. That means learning how to use pointers and directly accessing memory and data, which is always risky, but with care and proper practices, it shouldn’t even make you flinch. So here are some tips on how to master even c++ pointers and operators.

Usually when you’re accessing a pointer to a member of a class or object, you can do so in c++ like this:

//accessing member of object 10 in the someObject array/list
someObject[10].member

The [] operator is no different than this: Continue reading “Tips and tricks for c++ pointers and operators”

32-bit Color Blending Hints

When you’re programming graphics, you’ll be dealing with color blending and pixels and bitmaps and images and pointers and scanlines and compression, alladat jazz. If you’re not fully trained, it could get quite overwhelming. If you want a super simplified explanation of graphics, it’s just a HUGE array of numbers. And an array itself is like a container, a piece of memory in your computer that stores all those numbers. Continue reading “32-bit Color Blending Hints”

How to use Windows API all-purpose PVOID* structure

If you’re into modern Windows API c++ programming, it seems things have gotten just slightly easier. Naming conventions for classes, functions, structs, enums, etc. just aren’t as confusing anymore. I’m sure technical experts know how to move virtual memory around, which is essentially what programming and problem solving is, but if you’re just sitting down for some casual tinkering, it’s going to be a nightmare. You’re relying on the developers before you to name things intuitively.

So now Windows API documentation has been trying to promote using their generic PVOID struct more. It’s safer, maybe. It’s nothing special. It’s a generic struct to get a pointer to some data, any data. But you have to cast the data type yourself.

Here’s an example of how you can do something: Continue reading “How to use Windows API all-purpose PVOID* structure”

Using Now Patent-Free MP3 Audio Format For Your Indie Games

I’m super late posting this, as the news happened THREE YEARS AGO and the media didn’t spread the word. Anyway, as of 2017, the MP3 audio format is now patent-free. It doesn’t mean that you can now pirate all the commercial songs you want. What it actually means is now that the audio format is patent-free, you can implement an MP3 encoder/decoder into your game engine! That’s sweet! Continue reading “Using Now Patent-Free MP3 Audio Format For Your Indie Games”

Disabling antialiasing when drawing fonts in Qt 4.8.x

When you draw text in Qt using QPainter and desire it to be pixel crisp and sharp, you might do something like this:

QPainter painter(&this);
painter.setRenderHint(QPainter::TextAntialiasing, false);
painter.drawText(this.rect(), "Some Text");
Qt 4.8.x QPainter drawing text with default anti-aliasing on
Qt 4.8.x QPainter drawing text with default anti-aliasing on

However, sometimes it doesn’t work. Your text might be drawn with antialiasing no matter what, which results in soft blurry sometimes ugly font. Continue reading “Disabling antialiasing when drawing fonts in Qt 4.8.x”