Advertisement
Guest User

Untitled

a guest
Aug 16th, 2014
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.14 KB | None | 0 0
  1. //Application.h
  2.  
  3. #ifndef _APPLICATION_H_
  4. #define _APPLICATION_H_
  5.  
  6. #define WIN32_LEAN_AND_MEAN
  7. #include <Windows.h>
  8.  
  9.  
  10. #include "Memory\Memory.h"
  11. #include "Graphics.h"
  12.  
  13. class Application {
  14.  
  15. public:
  16.  
  17.     Application();
  18.     ~Application();
  19.  
  20.    
  21.     bool Setup(LPCSTR appname, int width, int height, bool windowed, bool wireframe, int cmd, HINSTANCE instance);
  22.     int Run();
  23.  
  24. private:
  25.  
  26.     void Frame();
  27.     bool IsOnlyInstance(LPCSTR);
  28.  
  29. private:
  30.  
  31.     HWND m_pHwnd;
  32.    
  33.     Graphics *m_pGraphics;
  34.  
  35. };
  36.  
  37.  
  38. #endif
  39.  
  40. //Memory.h
  41.  
  42. namespace Memory {
  43.  
  44.     template<class T> void Release(T&t)
  45.     {
  46.         if (t)
  47.         {
  48.             t->Release();
  49.             t = nullptr;
  50.         }
  51.     }
  52.  
  53.     template<class T> void Delete(T&t)
  54.     {
  55.         if (t)
  56.         {
  57.             delete t;
  58.             t = nullptr;
  59.         }
  60.     }
  61.  
  62.     template<class T> void DeleteArr(T&t)
  63.     {
  64.         if (t)
  65.         {
  66.             delete[] t;
  67.             t = nullptr;
  68.         }
  69.     }
  70. }
  71.  
  72. //Graphics.h
  73.  
  74. #ifndef _GRAPHICS_H_
  75. #define _GRAPHICS_H_
  76.  
  77. #include "Graphics3D.h"
  78.  
  79. class Graphics : public Graphics3D {
  80.  
  81. public:
  82.     void Render();
  83.  
  84. };
  85.  
  86. #endif
  87.  
  88. //Graphics3D.h
  89.  
  90. #ifndef _GRAPHICS3D_H_
  91. #define _GRAPHICS3D_H_
  92.  
  93. class Graphics3D {
  94.    
  95. public:
  96.     virtual void Render();
  97. };
  98.  
  99. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement