Archive for anig

C++11 Delegating Constructors

C++ 11 introduces a new feature called “delegating constructors”. Now you can do common initialization steps in a constructor, known as the target constructor. Other constructors can call the target constructor to do the initialization. These constructors are called delegating constructors.


class A{
public:
A(): A(0) {}
A(int i): A(i, 0) {}
A(int i, int j)
{
...
}
...
};

Delegating constructors cannot have initializations of class members in their initializer lists; that is, a constructor cannot delegate and intialize at the same time.

If an exception occurs in the body of a target constructor, it can be caught by the try block of the delegating constructor.


class A{
public:
A();
A(int i);
A(int i, int j);
};
A::A() try: A(0) {
cout << "A() body"<< endl; } catch(...) { cout << "A() catch"<< endl; } A::A(int i) try : A(i, 0){ cout << "A(int i) body"<< endl; } catch(...) { cout << "A(int i) catch"<< endl; }

This feature helps to reduce the code size and make your program more readable and maintainable.

C++11 range-based for loops

Great link: Range-based for loop

Nowadays, almost every programming language has a convenient way to write a for loop over a range of values. Finally, C++ 11 has the same concept; this is a long awaited C++ feature.

Here’s an example:


vector<string> vec;
vec.push_back( "hello" );
vec.push_back( "world" );

for (string s : vec )
{
cout << s;
}

Understanding Unity 3D coordinate systems

Unity 3D has 4 coordinate systems: World, Screen, Viewport and UI.

The world coordinate system is left handed (as Direct X) where x positive axis is right, y positive is up and z is positive into the screen.

Read more

How to profile a “Made With Marmalade” app

Profiling is a form of dynamic program analysis that measures, for example, the usage of memory, the usage of particular instructions, or frequency and duration of function calls. The most common use of profiling information is to aid program optimization.

Read more

IWGE featuring pause/resume

Implemented pause/resume in IWGE 😉

The second edition of Codemotion, the event which is open to all languages and technologies will take place on 23rd and 24th March 2012 in Rome. The main innovations of Codemotion 2012 will be: two days dedicated to technical interventions and the fact that there will be two events held simultaneously in Rome and Madrid.

Intensive Works will attend at Codemotion. Register here and get in touch with us!

SvilupParty 2012

We will attend the SvilupParty 2012 in Bologna from 10 to 11 of March, it’s a meeting of Italians videogame indie developers. For more information see http://www.svilupparty.it/

 

 

 

Geomutations development continues

Beautiful screenshot of Geomutations, a “Made with Marmalade” game.

New classes ported

RenderTexture and nice Shaky3D fx from cocos2d

Box2D integration

Box2d integrated. The new B2Sprite class is an AliveSprite featuring physics properties.