• opengl
  • My graphics engine.

    When I started studying OpenGL back in December it was mostly for fun and with very little interest in going deeper in the realm of graphical programming. But now, I find myself spending more and more time digging into OpenGL details or in how to sculpt meshes with Blender. There are a lot of things […]

  • C++17
  • C++17: Variants!

    For compatibility reason to C the C++ language include the union construct which allows to manipulate several different types in a uniform manner. The reason I’m writing that this feature exist for compatibility reasons is that is almost completely useless when you’re doing object oriented programming, the only allowed types to be used with union are POD’s, non […]

  • Algorithms
  • Short post about the GCD.

    You probably think you know everything about what the Greatest Common Divisor is and how to calculate it quickly! Well, that’s most probably the case, but just in case you do not remember all the details then here’s a short post about the GCD! (All the code is available here) Simple GCD Let’s start with the basic […]

  • blog
  • About C++

    When someone tell me that he know’s C++ and that he actually is a C++ programmer I believe him, but, this statement need some further explanation about which version of C++ the fellas is talking about!. Most C++ programmers knows C++03, eventually a little of C++11 and that’s all. Nowadays the tag C++ is used by […]

  • C++17
  • C++17: Folding expression.

    That is one of those new additions to the language that for the most part is not understood, but that’s not a surprise since most of the people do not understand as well for what reason on heart someone included something diabolic as the variadics in the C++ language. The folding expressions was added to the […]

  • C++17
  • C++17: map splicing

    Std::list have a very useful operation which allows you to move elements from one list to another, it’s called splicing. Splicing come’s almost for free, no elements are really moved but only the pointers internally used by std::list are copied from one container to another. Here’s how splicing work: The first invocation of the splice function […]

  • C++
  • C++17: let’s have a look at the constexpr if

    There was a long discussion in the C++ community about when and how to implement the static if, the original proposal from Bright, Sutter and Alexandrescu which was aiming to define a possible implementation of this feature was resurrected after a quite long silence, just to be included in the upcoming C++17. The actual implementation of the […]

  • assembler
  • Unexpected stuff!

    Let’s have a look at this code: int main() { for(int i{0};i<500;i++) { std::cout<<“This is a big number: “<<i*20000000<<std::endl; } } And let’s compile it with g++ using the flag -O3, what’s going to happen? Before answering, let’s have a look at the assembly, shall we? L16: movsbl 39(%ebx), %eax L6: movl %esi, %ecx movl […]