| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- #pragma once
- //========================================================================
- // GameCodeStd.h : include file for standard system include files,
- // or project specific include files that are used frequently, but
- // are changed infrequently
- //
- // GameCode4 is the sample application that encapsulates much of the source code
- // discussed in "Game Coding Complete - 4th Edition" by Mike McShaffry and David
- // "Rez" Graham, published by Charles River Media.
- // ISBN-10: 1133776574 | ISBN-13: 978-1133776574
- //
- // If this source code has found it's way to you, and you think it has helped you
- // in any way, do the authors a favor and buy a new copy of the book - there are
- // detailed explanations in it that compliment this code well. Buy a copy at Amazon.com
- // by clicking here:
- // http://www.amazon.com/gp/product/1133776574/ref=olp_product_details?ie=UTF8&me=&seller=
- //
- // There's a companion web site at http://www.mcshaffry.com/GameCode/
- //
- // The source code is managed and maintained through Google Code:
- // http://code.google.com/p/gamecode4/
- //
- // (c) Copyright 2012 Michael L. McShaffry and David Graham
- //
- // This program is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Lesser GPL v3
- // as published by the Free Software Foundation.
- //
- // This program is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- // http://www.gnu.org/licenses/lgpl-3.0.txt for more details.
- //
- // You should have received a copy of the GNU Lesser GPL v3
- // along with this program; if not, write to the Free Software
- // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- //
- //========================================================================
- // C RunTime Header Files
- #include <stdlib.h>
- #include <malloc.h>
- #include <memory.h>
- // #include <tchar.h>
- // TODO(munnellg) - delete these when done
- #include <iostream>
- #include <iomanip>
- // #include <mmsystem.h>
- #include <algorithm>
- #include <string>
- #include <list>
- #include <vector>
- #include <queue>
- #include <map>
- // OpenGL / SDL2 includes
- // will go here
- #include <tinyxml.h>
- // fast delegate stuff
- #include <FastDelegate.h>
- using fastdelegate::MakeDelegate;
- // GameCode #includes
- #include "../Debugging/Logger.h" // this should be the first of the gcc includes since it defines GCC_ASSERT()
- #include "../Utilities/types.h"
- #include "../Utilities/templates.h"
- #include "../Graphics3D/Geometry.h"
- typedef glm::vec4 Color;
- extern Color g_White;
- extern Color g_Black;
- extern Color g_Cyan;
- extern Color g_Red;
- extern Color g_Green;
- extern Color g_Blue;
- extern Color g_Yellow;
- extern Color g_Gray40;
- extern Color g_Gray25;
- extern Color g_Gray65;
- extern Color g_Transparent;
- extern glm::vec3 g_Up;
- extern glm::vec3 g_Right;
- extern glm::vec3 g_Forward;
- extern glm::vec4 g_Up4;
- extern glm::vec4 g_Right4;
- extern glm::vec4 g_Forward4;
- class GCC_noncopyable
- {
- private:
- GCC_noncopyable(const GCC_noncopyable& x);
- GCC_noncopyable& operator=(const GCC_noncopyable& x);
- public:
- GCC_noncopyable() {}; // Default constructor
- };
- // TODO(munnellg): Update to the correct reference
- // Game Code Complete - Chapter 12, page 446-447
- #if defined(_DEBUG)
- # define GCC_NEW new(_NORMAL_BLOCK,__FILE__, __LINE__)
- #else
- # define GCC_NEW new
- #endif
- // Useful #defines
- // TODO(munnellg) - delete this when we're done with all that Window kruft
- #define MAX_PATH 260
- extern const float fOPAQUE;
- extern const int iOPAQUE;
- extern const float fTRANSPARENT;
- extern const int iTRANSPARENT;
- extern const int MEGABYTE;
- extern const float SIXTY_HERTZ;
- extern const int SCREEN_WIDTH;
- extern const int SCREEN_HEIGHT;
- #if !defined(SAFE_DELETE)
- #define SAFE_DELETE(x) do { if(x) delete x; x = NULL; } while(0)
- #endif
- #if !defined(SAFE_DELETE_ARRAY)
- #define SAFE_DELETE_ARRAY(x) do { if(x) delete [] x; x = NULL; } while(0)
- #endif
- #if !defined(SAFE_RELEASE)
- #define SAFE_RELEASE(x) do { if(x) x->Release(); x = NULL; } while(0)
- #endif
- #include "../GameCode4/GameCode.h"
- extern int GameCode4(int argc, char** argv);
|