Below you will find pages that utilize the taxonomy term “C++”
Mixing C++ with AMD64 (x86_64) assembly
Lately, I’ve been dabbling into some “closer to the metal” kind of programming.
On most compilers (Visual Studio’s one for instance) it used to be rather easy to mix assembly code and C++ code using a feature called inline assembly where the ASM code will be put in a block (decorated with a special macro/symbol like _asm
for instance), and when the compiler sees that, it will put the content of this “as is” inside of the compiled code.
SDL: not (just) a 2D graphics library
My first real introduction with programming was with the C programming language, on a French website that was, at the time, known by the “Le Site Du Zéro” (think “The newbie’s website”).
At this time, I was in middle school, and I was pretty bored by it. It’s around that time that I started to have really access to the internet at home, and started spending a lot of time on it.
Ogre_glTF: A glTF loader plugin for Ogre 2.x
If there’s one open source library that I really like and think has a great level of usefulness for both myself, and a whole community, it’s Ogre.
Before going on the story of why I felt loading glTF files into ogre was a necessary thing to do, and why I decided to actually write a loader myself, I need to tell you a bit about Ogre:
Good old Ogre3D
I prefer to write it “Ogre”, but really, it’s name is OGRE. This is an acronym that stands for “Object-oriented Graphical Rendering Engine”.
No nonsense networking for C++ : Introducing kissnet, a K.I.S.S. socket library!
Sometimes I wonder why some things are inside the C and C++ standard libraries, and some aren’t.
As far as I can be bothered to read the actual “standards” document (that are mostly written in legalize, not in understandable English for you and me), these languages are defined against an “abstract machine”, and the actual real-world implementation of them, on computers that actually exists, should follow the behavior described for that thing, modulo some implementations details.
“Scenario Testing” a game engine by misusing an unit test framework.
I don’t post regularly on this blog, but I really should post more… ^^”
If you have ever read me here before, you probably know that one of my pet project is a game engine called Annwvyn.
Where did I get from
Annwvyn was just “a few classes to act as glue code around a few free software library”. I really thought that in 2 months I had some piece of software worthy of bearing the name game engine. Obviously, I was just a foolish little nerd playing around with an Oculus DK1 in his room, but still, I did actually manage to have something render in real time on the rift with some physics and sound inside! That was cool!
Everything started as just a test project, then, I decided to remove the int main(void) function I had and stash everything else inside a DLL file. That was quickly done (after banging my head against the MSDN website and Visual Studio’s 2010 project settings, and writing a macro to insert __declspec(dllexport) or __declspec(dllimport) everywhere.)
The need for testability and the difficulties of retrofitting tests
So let’s be clear: I know about good development practice, about automated testing, about TDD, about software architecture, about UML Class Diagrams and all that jazz. Heck, I’m a student in those things. But, the little hobby project wasn’t intended to grow as a 17000 lines of C++ with a lot of modules and bindings to a scripting language, and an event dispatch system, and a lot of interconnected components that abstract writing data to the file system (well, it’s for video game save files) or rendering to multiple different kind of VR hardware, to go expand the Resource Manager of Ogre. Hell, I did not know that Ogre had such a complex resource management system. I thought that Ogre was a C++ thing that drew polygon on the screen without me having to learn OpenGL. (I still had to actually learn quite a lot about OpenGL because I needed to hack into it’s guts, but I blogged about that already.).
Lets just say that things are really getting out of hands, and that I seriously needed to start thinking about making the code saner, and to be able to detect when I break stuff.
Shoehorning anything (with `operator<<()`) into `qDebug()` the quick and dirty templated way
So, the other day I was working on some Ogre + Qt5 code.
I haven’t really worked with Qt that much since Qt4 was the hot new thing, so I was a bit rusty, but I definitively like the new things I’ve seen in version 5. But I’m not here to discuss Qt 5 today. ^^
There’s a few weird things Qt does that I can’t really warp my head around. One is the incompatibility between QString and std::string (There’s probably a nasty problem called “unicode” behind this), but one other one is that QDebug is not an std::ostream derived object.