huutho_96

Constants.h V1

Sep 16th, 2016
640
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma once
  2. #ifndef CONSTANTS_H
  3. #define CONSTANTS_H
  4.  
  5. const int WINDOW_WIDTH  = 640;
  6. const int WINDOW_HEIGHT = 480;
  7. const char* APP_NAME = "5T&H";
  8. const char* WINDOW_NAME = "DIRECTX";
  9.  
  10. bool FULLSCREEN = false;
  11.  
  12. template <typename T>
  13. void SafeRelease(T &ptr)
  14. {
  15.     if (ptr)
  16.     {
  17.         ptr->Release();
  18.         ptr = NULL;
  19.     }
  20. }
  21. #define SAFE_RELEASE SafeRelease;
  22.  
  23. template <typename T>
  24. void SafeDelete(T &ptr)
  25. {
  26.     if (ptr)
  27.     {
  28.         delete ptr;
  29.         ptr = NULL;
  30.     }
  31. }
  32. #define SAFE_DELETE SafeDelete;
  33.  
  34. template <typename T>
  35. void SafeDeleteArray(T &ptr)
  36. {
  37.     if (ptr)
  38.     {
  39.         delete[] ptr;
  40.         ptr = NULL;
  41.     }
  42. }
  43. #define SAFE_DELETE_ARRAY SafeDeleteArray;
  44.  
  45.  
  46. #endif
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×