GameCodeStd.cpp 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //========================================================================
  2. // GameCodeStd.cpp : source file that includes just the standard includes
  3. //
  4. // Part of the GameCode4 Application
  5. //
  6. // GameCode4 is the sample application that encapsulates much of the source code
  7. // discussed in "Game Coding Complete - 4th Edition" by Mike McShaffry and David
  8. // "Rez" Graham, published by Charles River Media.
  9. // ISBN-10: 1133776574 | ISBN-13: 978-1133776574
  10. //
  11. // If this source code has found it's way to you, and you think it has helped you
  12. // in any way, do the authors a favor and buy a new copy of the book - there are
  13. // detailed explanations in it that compliment this code well. Buy a copy at Amazon.com
  14. // by clicking here:
  15. // http://www.amazon.com/gp/product/1133776574/ref=olp_product_details?ie=UTF8&me=&seller=
  16. //
  17. // There's a companion web site at http://www.mcshaffry.com/GameCode/
  18. //
  19. // The source code is managed and maintained through Google Code:
  20. // http://code.google.com/p/gamecode4/
  21. //
  22. // (c) Copyright 2012 Michael L. McShaffry and David Graham
  23. //
  24. // This program is free software; you can redistribute it and/or
  25. // modify it under the terms of the GNU Lesser GPL v3
  26. // as published by the Free Software Foundation.
  27. //
  28. // This program is distributed in the hope that it will be useful,
  29. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  30. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  31. // http://www.gnu.org/licenses/lgpl-3.0.txt for more details.
  32. //
  33. // You should have received a copy of the GNU Lesser GPL v3
  34. // along with this program; if not, write to the Free Software
  35. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  36. //
  37. //========================================================================
  38. #include "GameCodeStd.h"
  39. //
  40. // Colors are discussed in Chapter 13, page 453
  41. //
  42. Color g_White( 1.0f, 1.0f, 1.0f, fOPAQUE );
  43. Color g_Black( 0.0f, 0.0f, 0.0f, fOPAQUE );
  44. Color g_Cyan( 0.0f, 1.0f, 1.0f, fOPAQUE );
  45. Color g_Red( 1.0f, 0.0f, 0.0f, fOPAQUE );
  46. Color g_Green( 0.0f, 1.0f, 0.0f, fOPAQUE );
  47. Color g_Blue( 0.0f, 0.0f, 1.0f, fOPAQUE );
  48. Color g_Yellow( 1.0f, 1.0f, 0.0f, fOPAQUE );
  49. Color g_Gray40( 0.4f, 0.4f, 0.4f, fOPAQUE );
  50. Color g_Gray25( 0.25f, 0.25f, 0.25f, fOPAQUE );
  51. Color g_Gray65( 0.65f, 0.65f, 0.65f, fOPAQUE );
  52. Color g_Transparent (1.0f, 0.0f, 1.0f, fTRANSPARENT );
  53. // Note! If you change these direction vectors around to suit yourself
  54. // Make sure you change it so it retains a left handed
  55. // coordinate system
  56. glm::vec3 g_Right(1.0f, 0.0f, 0.0f);
  57. glm::vec3 g_Up(0.0f, 1.0f, 0.0f);
  58. glm::vec3 g_Forward(0.0f, 0.0f, 1.0f);
  59. glm::vec4 g_Up4(g_Up.x, g_Up.y, g_Up.z, 0.0f);
  60. glm::vec4 g_Right4(g_Right.x, g_Right.y, g_Right.z, 0.0f);
  61. glm::vec4 g_Forward4(g_Forward.x, g_Forward.y, g_Forward.z, 0.0f);
  62. const float fOPAQUE = 1.0f;
  63. const int iOPAQUE = 1;
  64. const float fTRANSPARENT = 0.0f;
  65. const int iTRANSPARENT = 0;
  66. const int MEGABYTE = 1024 * 1024;
  67. const float SIXTY_HERTZ = 16.66f;
  68. const int SCREEN_WIDTH = 800;
  69. const int SCREEN_HEIGHT = 600;