Understanding what typedef HRESULT(__stdcall* endScene)(IDirect3DDevice9* pDevice) does

Viewed 21

I found this piece of code and i cant understand what it means and what it does:

typedef HRESULT(__stdcall* endScene)(IDirect3DDevice9* pDevice);
endScene pEndScene;

I would appreciate any clues

1 Answers

It is declaring an alias for a function pointer type, and then declaring a variable of that type.

It is declaring a type named endScene, which is a pointer to a function that takes in an IDirect3DDevice9* as input, uses the __stdcall calling convention, and returns an HRESULT as output.

And then it is declaring a variable named pEndScene of type endScene.

Related