Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. LRESULT CALLBACK WndProc(HWND hWindow, UINT msg, WPARAM wParam, LPARAM lParam)
  2. {
  3. // Initialize via wrapper, else route to engine
  4. switch (msg)
  5. {
  6. case WM_CREATE:
  7. return GEN::Wrapper::GetWrapper()->HandleEvent(hWindow, msg, wParam, lParam);
  8. break;
  9. default:
  10. return GEN::Wrapper::GetEngine()->HandleEvent(hWindow, msg, wParam, lParam) // DefWndProc called from this HandleEvent
  11. }
  12. }
  13.  
  14. class WrapperInterface
  15. {
  16. public:
  17. static std::tr1::shared_ptr<WrapperInterface> // factory function
  18. create_Wrapper(...); // returns pImpl
  19.  
  20. // ... Pure virtuals here
  21. };
  22.  
  23. std::tr1::shared_ptr<WrapperInterface> WrapperInterface::create_Wrapper(...)
  24. {
  25. return std::tr1::shared_ptr<WrapperInterface>(new Wrapper(...));
  26. }
  27.  
  28. std::tr1::shared_ptr<WrapperInterface>
  29. Wrapper(WrapperInterface::create(...));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement