Category Archives: C++

Everything related to the use of the C++ language

Interactive RayTracer 1: A barebone raytracer

At last, I’m starting with my first post on my attempt on Interactive RayTracing. This first one will only be on the generic global implementation.

A matrix library must be used, the same basis class will be used for each element, point or color, but with a different size (if needed). I will use a typedef for defining each of them. This will help explaining what is going on. I will not explain the code of the library, althoug the optimization of the raytracer will surely have to be done in this part of the code as well.

So a vector will be named (for the moment) Vector3df, a point Point3df, a normal Normal3df and a color Color. All elements will live in the IRT namespace.
Continue reading Interactive RayTracer 1: A barebone raytracer

Book review: C++ For Game Programmers

Some books geared toward game programming beginners tend to only scratch the surface of the presented language and of what it takes to write a game. There are some pitfalls that are specific to games that need to be addressed (or so the book says), and this is what this book is about.
Continue reading Book review: C++ For Game Programmers

Using GCCXML to automate C++ wrappers creation

GCCXML uses GCC as a front-end to parse C or C++ files. It then generates XML files for the interface, that is, it generates tags for the types and prototypes it parses. Then, pygccxml is a wrapper over it which parses the XML file to generate a Python object with every information one may need.

So I will quicly show here how it is possible to generate serialization/deserialization and then how to wrap functions with my custom serialization functions.
Continue reading Using GCCXML to automate C++ wrappers creation

Review of Intel Parallel Studio

I’ve played a little bit with Intel Parallel Studio. Let’s say it has been a pleasant trip out in the wildness of multithreaded applications.

Intel Parallel Studio is a set of tools geared toward multithreaded applications. It consists of three Visual Studio plugins (so you need a fully-fledged Visual Studio, not an Express edition):

  • Parallel Inspector for memory analysis
  • Parallel Amplifier for thread behavior and concurrency
  • Parallel Composer for parallel debugging

This is an update of the review I’ve done for the beta version. Since this first review, I’ve tried the official first version.

Continue reading Review of Intel Parallel Studio

Book review: C++ Coding Standards: 101 Rules, Guidelines, and Best Practices

There is no official C++ standard, unlike several languages (Java, Python, …) where there are referentials for code and design style, good practices, … It didn’t exist until this book where two world-renowned C++ authors set the basis for your every day development.
Continue reading Book review: C++ Coding Standards: 101 Rules, Guidelines, and Best Practices

Book review: Ultimate 3D Game Engine Design & Architecture

I bought this book as soon as it was published, and I sold it soon after. Suffice to say I had a very mitigated impression after reading it. There are good things in it, but also some very bad stuff. It doesn’t describe how to write your ultimate game engine, but the author’s game engine. What about some modesty?

Let’s start with the bad stuff.

Continue reading Book review: Ultimate 3D Game Engine Design & Architecture

Interactive RayTracer

Some months ago, I’ve decided to dig into raytracing, and more exactly interactive raytracing. So I’ve started writting my own library, based on several publications.
nVidia announced recently its own framework, Intel wants also to do raytracing on Larrabee, it is the current trend.
Continue reading Interactive RayTracer

Profiling with Valgrind/Callgrind

Profiling comes in three different flaviors. The first is emulation, where a processor behavior is emulated, the second is sampling, where at regular intervals, the profiler samples the status of a program, and fianlly instrulentation, where the profiler gets information when a subroutine is called and when it returns. As with the Heisenberg uncertainty, profiling changes the exact behavior of your program. This is something you have to remember when analyzing a profile.

Valgrind is an Open Source emulation profiler. It is freely available on standard Linux platforms. As it is an emulation, it is far slower than the actual program. This means that the I/O are underestimated. The advantage is that you can have every detail on the memory behavior (cache misses for instance). Valgrind does not emulate all processors, but you can tweak it to approach your own one.
Continue reading Profiling with Valgrind/Callgrind