Well I thought to myself, as everyone seems to complain about the string functions in DarkGDK due to memory leaks and whatever, I decided to create a library of functions that work like the GDK variants, but are safer and in some cases easier to use. Later on I expanded the library to include some common math functions that were missing in DarkGDK, like Distance functions, and now I've expanded it further to include Win32 functions. Who knows what will be added next.
Function Listing:
Math:
float Dist( float X1, float Y1, float X2, float Y2 )
float Dist( float X1, float Y1, float Z1, float X2, float Y2, float Z2 )
float Dist( D3DXVECTOR2 pos1, D3DXVECTOR2 pos2 )
float Dist( D3DXVECTOR3 pos1, D3DXVECTOR3 pos2 )
float DistSq( float X1, float Y1, float X2, float Y2 )
float DistSq( float X1, float Y1, float Z1, float X2, float Y2, float Z2 )
float DistSq( D3DXVECTOR2 pos1, D3DXVECTOR2 pos2 )
float DistSq( D3DXVECTOR3 pos1, D3DXVECTOR3 pos2 )
String:
T Extract( std::string &str )
std::string Convert( T &value )
void ClearOf( char character, std::string &str )
void Tokenize( std::vector<std::string> &tokens, char delim, const std::string &str )
Win32:
File:
void open( const std::string &filename, int flags )
void close()
void write( T val )
T read()
bool isOpen()
bool isEmpty()
bool atFileEnd()
std::fstream &getFileStream()
Anybody got any more function ideas?
GDKUtilities, a utility library for DarkGDK, avaliable
here