#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 #include #include // #include // TODO(munnellg) - delete these when done #include #include // #include #include #include #include #include #include #include // OpenGL / SDL2 includes // will go here #include // fast delegate stuff #include 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);