Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members

NUS.hpp

Go to the documentation of this file.
00001 // Copyright (c) 2007-2008 Tomer Nosrati
00002 // This file is part of the "NUSoftware Game Engine".
00003 // For conditions of distribution and use, see copyright notice in nge.hpp
00004 
00005 #pragma once
00006 #ifndef __C_NUS_H__
00007 #define __C_NUS_H__
00008 
00009 #include "NGE_CompileConfig.hpp"
00010 #include "Irrlicht/irrlicht.h"
00011 
00012 using namespace irr;
00013 using namespace irr::core;
00014 using namespace irr::io;
00015 using namespace irr::scene;
00016 using namespace irr::video;
00017 
00018 namespace nge
00019 {
00020         namespace core
00021         {
00022 
00024 
00025                 class NUS
00026                 {
00027                 public:
00030                         static stringw& reverseLetters(stringw& st)
00031                         {
00032                                 // The casting is required because c_str() returns a const pointer
00033                                 reverseArray((wchar_t*)st.c_str(), (wchar_t*)st.c_str() + st.size() - 1);
00034                                 return st;
00035                         }
00036 
00037                         static EKEY_CODE convertIrrKeyCode(stringc str);
00038 
00039                         static c8* convertIrrKeyCode(EKEY_CODE value);  
00040 
00041                 private:
00043                         template <class T>
00044                         static void reverseArray(T* beg, T* end)
00045                         {
00046                                 _NGE_DEBUG_BREAK_IF(end<beg);
00047 
00048                                 while (beg < end)
00049                                 {
00050                                         T tmp(*beg);
00051                                         *beg++ = *end;
00052                                         *end-- = tmp;
00053                                 }
00054                         }
00055                 };
00056 
00058 
00063 #define MAKE_HEB(str) NUS::reverseLetters( stringw((L##str)) )
00064 
00067                 IAnimatedMesh* createMeshFromFile(ISceneManager* smgr, IReadFile* file);
00068 
00069                 ITexture* addTextureFromSColor(IVideoDriver* driver, SColor const& color, c8* name, dimension2di const& size = dimension2di(512,512));
00070 
00071         } // namespace core
00072 } // namespace nge
00073 
00074 #endif // __C_NUS_H__

The NUSoftware Game Engine
The NUSoftware Game Engine Documentation © 2007-2008 by Tomer Nosrati. Generated on Sat Apr 26 16:52:34 2008 by Doxygen (1.5.5)