c++ Archive

  • Many things are cool, like this screenshot of XCode for example… this is what happens when debugging iOS apps that use OpenGL, there’s a handy button to click that lets...

    Scenegraphs are cool…

    Many things are cool, like this screenshot of XCode for example… this is what happens when debugging iOS apps that use OpenGL, there’s a handy button to click that lets...

    Continue Reading...

  • There has been progress on my “fly endlessly down some sort of canyon” iPad thing. Quite a lot of this progress has been non-visual infrastructure code where I’ve taken hastily...

    Speeding over the icy wastelands of $insert_name_here

    There has been progress on my “fly endlessly down some sort of canyon” iPad thing. Quite a lot of this progress has been non-visual infrastructure code where I’ve taken hastily...

    Continue Reading...

  • If you use XCode and have to deal with C++, Objective-C and Objective-C++ you might one day come across utterly mind-bending compiler errors that seem to defy logic. Weird things...

    Problems when your compiler defies sanity and logic

    If you use XCode and have to deal with C++, Objective-C and Objective-C++ you might one day come across utterly mind-bending compiler errors that seem to defy logic. Weird things...

    Continue Reading...

  • Back when I owned an ST (well, I still have it, but you know what I mean) one of my favourite demos was Ooh Crikey! Wot a Scorcher By The Lost...

    OOh Crikey! Wot a lot of green!

    Back when I owned an ST (well, I still have it, but you know what I mean) one of my favourite demos was Ooh Crikey! Wot a Scorcher By The Lost...

    Continue Reading...

  • So after creating a fun little iOS game using OpenGL ES 1.1 I decided the next thing I create should use ‘real’ 3D, rather than simply bashing OpenGL into managing...

    Debugging via telepathy

    So after creating a fun little iOS game using OpenGL ES 1.1 I decided the next thing I create should use ‘real’ 3D, rather than simply bashing OpenGL into managing...

    Continue Reading...

  • … and a bit of iOS file faffing. Getting paths to files inside the iOS application’s bundle: NSString* objPath = [[NSBundle mainBundle] pathForResource:@

    C++ and Objective-C string manipulations

    … and a bit of iOS file faffing. Getting paths to files inside the iOS application’s bundle: NSString* objPath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"obj"]; ‘objPath’ will now contain the full path...

    Continue Reading...

  • There will be a less predictable image in a future post, once I produce something worth looking at that makes sense to you. I’ve been spending the past few weeks...

    Linear Algebra, Analytic Geometry and other stuff you never saw the point of

    There will be a less predictable image in a future post, once I produce something worth looking at that makes sense to you. I’ve been spending the past few weeks...

    Continue Reading...

  • // Finds the angle that is 180 degrees from the given angle, but in radians fmodf((angle + M_PI), (M_PI * 2))

    Find opposite angle in radians

    // Finds the angle that is 180 degrees from the given angle, but in radians fmodf((angle + M_PI), (M_PI * 2))

    Continue Reading...

  • I’ve been trying to make a simple Service Locator class work but had a problem with bizarre linker errors, where the static member variable couldn’t be resolved. After a lot...

    Static class variable initialisation in C++

    I’ve been trying to make a simple Service Locator class work but had a problem with bizarre linker errors, where the static member variable couldn’t be resolved. After a lot...

    Continue Reading...

  • #include < stdio.h > #include < math.h >   #define M_PI 3.141 #define PI180 (M_PI/180) #define DEG2RAD(x) (x * PI180)   float getShortAngle(float a1, float a2) { float angle =...

    LERP between angles in radians

    #include < stdio.h > #include < math.h >   #define M_PI 3.141 #define PI180 (M_PI/180) #define DEG2RAD(x) (x * PI180)   float getShortAngle(float a1, float a2) { float angle =...

    Continue Reading...