<p>Say I have:</p>

<pre><code>void Render(void(*Call)())
{
    D3dDevice-&gt;BeginScene();
    Call();
    D3dDevice-&gt;EndScene();
    D3dDevice-&gt;Present(0,0,0,0);
}
</code></pre>

<p>This is fine as long as the function I want to use to render is a function or a <code>static</code> member function:</p>

<pre><code>Render(MainMenuRender);
Render(MainMenu::Render);
</code></pre>

<p>However, I really want to be able to use a class method as well since in most cases the rendering function will want to access member variables, and Id rather not make the class instance global, e.g.</p>

<pre><code>Render(MainMenu-&gt;Render);
</code></pre>

<p>However I really have no idea how to do this, and still allow functions and <code>static</code> member functions to be used.</p>

You can make a wrapper function
```
void Wrap(T *t)
```
that just calls
```
t->Call()
```
and have
```
Render
```
take such a function together with an object. That is:
```
```
void Wrap(T *t)
{
  t->Call();
}

void Render(void (*f)(T *), T *t)
{
  ...
  f(t);
  ...
}
```
```