Meet the AdManager

These days, it isn't enough to just write a game. You need to be trendy and monetize it as well.

This could mean displaying ads for a third party or your other games (Chartboost, Tapjoy), offering incentives and point systems (Tapjoy), tracking installs and what menus the player used and stuff like that (Flurry), or making money by adding buttons that open up third party stores and things. (Startapp, Hooked)

Some features of the AdManager:

The RTAdTest example shows this in action, although it's a little hairy to get compiling because it uses EVERY ad system we support at once, disable them as needed to make it easier to get going.

How to add AdManager to an existing project

Add the following after the other include's at the top your App.h

#include "Manager/AdManager.h"

Add the following to your App class in App.h:

//add this App member function (should be public)
AdManager * GetAdManager() {return &m_adManager;}

//add this App member variable (should be private)
AdManager m_adManager;

Add the following code in App::Init() in your App.cpp file

//add this after the if (!BaseApp::Init()) return false; statement
//Later, this where we'll init and add the real ad systems to the AdManager

In App::Update, add this under the existing BaseApp::Update() statement:


In App::Draw, add this under the existing BaseApp::Draw() statement:


If your App is currently not already over-riding virtual void OnMessage (Message &m ), well, you'll need to add this to your App class, otherwise just plug in the m_adManager part:

void App::OnMessage( Message &m )
	m_adManager.OnMessage(m); //gives the AdManager a way to handle messages

//and in your App.h, add this to the App class if it's not already there:
virtual void OnMessage(Message &m);

That's it! Now you should be able to run your app and.. well, the AdManager won't actually do anything other than send “AdManager initted.” to the log. To actually ad some ad providers with real functionality, see the main proton page, there are links to the various ad providers.