Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Delegate function to annother class

$
0
0

@Pedro Garlaschi wrote:

Hey Guys,

I have a quite beginner doubt about how could i pass a reference function from c lass to another.

Let's assume that i have a class

class ContentLoader
{
public:
void onComplete();
}

Houw could i do something like that ?

void ofApp::setup()
{
ContentLoader c;
c.onComplete = onComplete;
}

void ofApp::onComplete()
{

}

I've seen things about std::bind but i couldn't make it happen properly.

Thanks !

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles