39#ifndef INCLUDED_GLS_RUNTIME_UTIL_H
40#define INCLUDED_GLS_RUNTIME_UTIL_H
42#include "ConvertUTF.h"
63# define _CRT_FUNCTIONS_REQUIRED 1
74#if defined( LINUX ) || defined( __VXWORKS__ ) || defined( __APPLE__ ) || defined( QNX )
79# include <android/asset_manager.h>
87#if defined( GLS_DEBUG ) || !defined( NDEBUG )
88# define GLS_DEBUG_CODE( x ) x
90# define GLS_DEBUG_CODE( x )
108inline int strcasecmp(
const char*
const x,
const char*
const y )
110 return _stricmp( x, y );
127template<
class X,
class X1,
class X2>
128bool BETWEEN(
const X& x,
const X1& x1,
const X2& x2 )
130 return ( x >= x1 && x <= x2 )
131 || ( x >= x2 && x <= x1 );
138bool IS_NEGATIVE(
const X& x ) {
return std::fabs( x ) > 0.0001 ? ( x < 0.0 ) : 0; }
144bool IS_POSITIVE(
const X& x ) {
return std::fabs( x ) > 0.0001 ? ( x > 0.0 ) : 0; }
153 return std::fabs( x ) < threshold;
177# define MIN( A, B ) ( ( A ) < ( B ) ? ( A ) : ( B ) )
183# define MAX( A, B ) ( ( A ) > ( B ) ? ( A ) : ( B ) )
198# define GLSTUDIO_CLAMP_TO_EDGE ( OpenGLVersion() >= 1.2f ? 0x812F : GL_CLAMP )
200# define GLSTUDIO_CLAMP_TO_EDGE GL_CLAMP_TO_EDGE
228 if( ( index < 0 ) || ( index >= GLS_COLOR_MAX ) )
245 unsigned char alpha )
247 if( ( index >= 0 ) && ( index < GLS_COLOR_MAX ) )
309 return ( *s1 - *( s2 - 1 ) );
377 for(
size_t idx = 0u; idx < n; ++idx )
413 return static_cast<int_type>( EOF );
421 return ( c ==
eof() ) ? 0 : c;
425typedef std::basic_string<unsigned short, CharTraitsUnsignedShort>
UTF16String;
449 if( src.size() > 0u )
452 const unsigned int srcLen = (
unsigned int)src.size();
453 const unsigned int utf16BufLen = (
unsigned int)( src.size() + 1u );
454 UTF16* utf16Buf =
new UTF16[ src.size() + 1u ];
456 memset( utf16Buf, 0, ( utf16BufLen *
sizeof( UTF16 ) ) );
460 const UTF8* srcUTF8 = (
const UTF8*)( src.c_str() );
461 UTF16* targetUTF16 = utf16Buf;
462 ConvertUTF8toUTF16( &srcUTF8, &srcUTF8[ srcLen ], &targetUTF16, &( targetUTF16[ utf16BufLen - 1u ] ), strictConversion );
465 utf16Buf[ utf16BufLen - 1u ] = 0;
468 ret.assign( (
wchar_t*)utf16Buf );
470 ret.assign( (
unsigned short*)utf16Buf );
474 delete[]( utf16Buf );
490template<
class T1,
class T2>
491bool Equal( T1 x, T2 y,
float precision = 0.001f )
493 return ( x - precision ) <= y && y <= ( x + precision );
501const T&
Min(
const T& x,
const T& y )
503 return x < y ? x : y;
511const T&
Max(
const T& x,
const T& y )
513 return x < y ? y : x;
521template<
class T,
class Pred>
522const T&
Min(
const T& x,
const T& y, Pred pr )
524 return pr( x, y ) ? x : y;
532template<
class T,
class Pred>
533const T&
Max(
const T& x,
const T& y, Pred pr )
535 return pr( x, y ) ? y : x;
597 rotation_scaling( 0, 0 ) = new_i.
x;
598 rotation_scaling( 0, 1 ) = new_j.
x;
599 rotation_scaling( 0, 2 ) = new_k.
x;
600 rotation_scaling( 1, 0 ) = new_i.
y;
601 rotation_scaling( 1, 1 ) = new_j.
y;
602 rotation_scaling( 1, 2 ) = new_k.
y;
603 rotation_scaling( 2, 0 ) = new_i.
z;
604 rotation_scaling( 2, 1 ) = new_j.
z;
605 rotation_scaling( 2, 2 ) = new_k.
z;
608 rotation_scaling.
Invert();
611 return rotation_scaling * transform;
639 rotation_scaling( 0, 0 ) = new_i.
x;
640 rotation_scaling( 0, 1 ) = new_j.
x;
641 rotation_scaling( 0, 2 ) = new_k.
x;
642 rotation_scaling( 1, 0 ) = new_i.
y;
643 rotation_scaling( 1, 1 ) = new_j.
y;
644 rotation_scaling( 1, 2 ) = new_k.
y;
645 rotation_scaling( 2, 0 ) = new_i.
z;
646 rotation_scaling( 2, 1 ) = new_j.
z;
647 rotation_scaling( 2, 2 ) = new_k.
z;
650 rotation_scaling.
Invert();
653 result = rotation_scaling * transform;
722 int& index1,
int& index2,
int& index3,
723 bool isVectorArray =
true );
850GLS_EXPORT void EnableDirectAssetLoading(
bool enableDirectAssetLoading );
858GLS_EXPORT bool HasAssetExtension(
const char* filename );
866GLS_EXPORT bool AssetExists(
const char* filename );
873GLS_EXPORT void SetAssetManager( AAssetManager* assetManager );
876#if defined( ANDROID ) || ( defined( __APPLE__ ) && defined( GLES ) && !defined( GLES_ANGLE ) ) || ( defined( LINUX ) && defined( GLES ) && !defined( GLES_ANGLE ) ) || defined( QNX ) || defined( INTEGRITY )
888GLS_EXPORT void SetResourcePath(
const char* resourcePath );
952#if defined( __APPLE__ ) && defined( GLES ) && !defined( GLES_ANGLE )
959GLS_EXPORT std::string GetAbsolutePathAndFileNameInDefaultResourceBundle(
const char* fileName );
1131#if !defined( GLES ) || defined( GLES_ANGLE )
1147 char* directory = NULL,
const char* filterStr = NULL,
1148 const char* defaultExt = NULL,
const char* title = NULL,
1149 bool multiSelect =
false,
bool createFile =
false,
1150 bool fileMustExist =
false,
bool pathMustExist =
false,
1151 bool noChangeDirectory =
false );
1167 char* directory = NULL,
const char* filterStr = NULL,
1168 const char* defaultExt = NULL,
const char* title = NULL,
1169 bool createFile =
false,
1170 bool fileMustExist =
false,
bool pathMustExist =
false,
1171 bool noChangeDirectory =
false );
1257 const char*
Code()
const {
return _code; }
1260 const char*
Usage()
const {
return _usage; }
1265#if defined( DISTI_HAS_RVAL_REFS )
1273 StealFrom( source );
1281 if(
this != &source )
1288 StealFrom( source );
1297 _code = source._code;
1298 _usage = source._usage;
1299 _comment = source._comment;
1302 source._code = NULL;
1303 source._usage = NULL;
1304 source._comment = NULL;
1361 if(
typeid( T2 ) !=
typeid(
void* ) )
1365 if(
typeid( T3 ) !=
typeid(
void* ) )
1369 if(
typeid( T4 ) !=
typeid(
void* ) )
1373 if(
typeid( T5 ) !=
typeid(
void* ) )
1377 if(
typeid( T6 ) !=
typeid(
void* ) )
1381 if(
typeid( T7 ) !=
typeid(
void* ) )
1385 if(
typeid( T8 ) !=
typeid(
void* ) )
1389 if(
typeid( T9 ) !=
typeid(
void* ) )
1393 if(
typeid( T10 ) !=
typeid(
void* ) )
1450 const T2& val2 = T2(),
1451 const T3& val3 = T3(),
1452 const T4& val4 = T4(),
1453 const T5& val5 = T5(),
1454 const T6& val6 = T6(),
1455 const T7& val7 = T7(),
1456 const T8& val8 = T8(),
1457 const T9& val9 = T9(),
1458 const T10& val10 = T10() )
1506 return !( *
this == val );
1513 outstr <<
" " <<
_val2;
1515 outstr <<
" " <<
_val3;
1517 outstr <<
" " <<
_val4;
1519 outstr <<
" " <<
_val5;
1521 outstr <<
" " <<
_val6;
1523 outstr <<
" " <<
_val7;
1525 outstr <<
" " <<
_val8;
1527 outstr <<
" " <<
_val9;
1528 if( _numVals >= 10 )
1575 if( _numVals >= 10 )
1628 operator std::string()
const
1656 return !( str1 == str2 );
1713 operator std::string()
const
1754 if( instr.peek() !=
'\"' )
1766 while( instr.good() )
1768 lastChar = currChar;
1769 currChar = instr.get();
1770 if( currChar != -1 )
1772 if( currChar ==
'\"' && lastChar !=
'\\' )
1774 temp += (char)currChar;
1826 return std::string( a + b.
_string );
1835 return std::string( a + b.
_string );
1994 T
Clamp(
const T& val,
const T& min,
const T& max )
1996 return std::min( max, std::max( min, val ) );
2007 inline void Split(
const std::string& s,
const char delim, std::vector<std::string>& elems,
const std::size_t maxElems = 0 )
2009 std::istringstream ss( s );
2011 while( std::getline( ss, item, delim ) )
2014 if( elems.size() == maxElems )
2020 if( maxElems > 0 && elems.size() == maxElems && ss.good() )
2022 std::string remaining;
2023 std::getline( ss, remaining,
'\0' );
2024 elems.back() += delim + remaining;
2026 else if( s.size() && s.at( s.size() - 1 ) == delim )
2029 elems.push_back(
"" );
2041 inline std::vector<std::string>
Split(
const std::string& s,
const char delim,
const std::size_t maxElems = 0 )
2043 std::vector<std::string> elems;
2044 Split( s, delim, elems, maxElems );
2053 return ( cStr ? cStr :
"" );
2060class IGlsStateManager;
2063class TextureLoaderList;
2111 "Pointer size is unexpected for this bitness" );
2137#ifdef MATRIX_TYPE_FLOAT
2139 const float modelMatrix[ 16 ],
2140 const float projMatrix[ 16 ],
2141 const int viewport[ 4 ],
2142 double* winx,
double* winy,
double* winz );
2145 const double modelMatrix[ 16 ],
2146 const double projMatrix[ 16 ],
2147 const int viewport[ 4 ],
2148 double* winx,
double* winy,
double* winz );
2162#ifdef MATRIX_TYPE_FLOAT
2164 const float modelMatrix[ 16 ],
2165 const float projMatrix[ 16 ],
2166 const int viewport[ 4 ],
2167 double* objx,
double* objy,
double* objz );
2170 const double modelMatrix[ 16 ],
2171 const double projMatrix[ 16 ],
2172 const int viewport[ 4 ],
2173 double* objx,
double* objy,
double* objz );
Definition: display_frame.h:86
Definition: dynamic_array.h:79
Definition: gls_font_man.h:59
Hold global objects so we can control order of destruction.
Definition: util.h:2067
Mutex & GetImageListMutex()
IGlsStateManager & GetStateManager()
static GlsGlobals & Instance()
GlsFontMan & GetFontMan()
TextureLoaderList & GetTextureLoaders()
void Translate(Type x, Type y, Type z)
Definition: gls_matrix_affine.h:204
void Invert()
Definition: gls_matrix.h:751
std::ostream ostreamType
Typedef shorthand for std::ostream.
Definition: util.h:1318
virtual void StreamOut(ostreamType &outstr) const =0
virtual void StreamIn(istreamType &instr)=0
std::istream istreamType
Typedef shorthand for std::istream.
Definition: util.h:1319
T6 _val6
The sixth value.
Definition: util.h:1405
GlsMultiVal()
Definition: util.h:1414
T7 _val7
The seventh value.
Definition: util.h:1406
GlsMultiVal(const GlsMultiVal &src)
Definition: util.h:1422
T5 _val5
The fifth value.
Definition: util.h:1404
T4 _val4
The fourth value.
Definition: util.h:1403
T3 _val3
The third value.
Definition: util.h:1402
virtual bool operator==(const GlsMultiVal &val) const
Definition: util.h:1476
T10 _val10
The tenth value.
Definition: util.h:1409
void StreamIn(istreamType &instr) override
Definition: util.h:1532
T2 _val2
The second value.
Definition: util.h:1401
void StreamOut(ostreamType &outstr) const override
Definition: util.h:1509
GlsMultiVal(const T1 &val1, const T2 &val2=T2(), const T3 &val3=T3(), const T4 &val4=T4(), const T5 &val5=T5(), const T6 &val6=T6(), const T7 &val7=T7(), const T8 &val8=T8(), const T9 &val9=T9(), const T10 &val10=T10())
Definition: util.h:1448
T8 _val8
The eighth value.
Definition: util.h:1407
virtual bool operator!=(const GlsMultiVal &val) const
Definition: util.h:1504
T1 _val1
The first value.
Definition: util.h:1400
T9 _val9
The ninth value.
Definition: util.h:1408
GlsPropStringQuoted()
Default constructor, create an empty GlsPropStringQuoted object.
Definition: util.h:1694
GlsPropStringQuoted(const std::string &str)
Definition: util.h:1700
bool operator==(const GlsPropStringQuoted &str) const
Definition: util.h:1727
std::string _string
The underlying wrapped string.
Definition: util.h:1691
GlsPropStringQuoted(const char *str)
Definition: util.h:1707
std::string & String()
Definition: util.h:1719
GlsPropString(const char *str)
Definition: util.h:1622
GlsPropString()
Default constructor. Creates an empty GlsPropString.
Definition: util.h:1608
friend bool operator==(const GlsPropString &str1, const GlsPropString &str2)
Definition: util.h:1645
GlsPropString(const std::string &str)
Definition: util.h:1615
std::string _string
The underlying wrapped string.
Definition: util.h:1605
std::string & String()
Definition: util.h:1636
friend bool operator!=(const GlsPropString &str1, const GlsPropString &str2)
Definition: util.h:1654
Definition: gls_state_manager_interface.h:65
const char * Code() const
Definition: util.h:1257
InterfaceDescriptionClass & operator=(const InterfaceDescriptionClass &source)
void Comment(const char *)
Set the comment member to a new value.
InterfaceDescriptionClass(const char *code, const char *usage, const char *comment)
void Code(const char *)
Set the code member to a new value.
const char * Usage() const
Definition: util.h:1260
InterfaceDescriptionClass(const InterfaceDescriptionClass &source)
InterfaceDescriptionClass(InterfaceDescriptionClass &&source)
Definition: util.h:1268
void Usage(const char *)
Set the usage member to a new value.
InterfaceDescriptionClass & operator=(InterfaceDescriptionClass &&source)
Definition: util.h:1279
const char * Comment() const
Definition: util.h:1263
Definition: gls_mutex.h:51
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:540
void GetCurrent()
Retrieves the current OpenGL Matrices from the OpenGL Subsystem.
OpenGLMatrices(int *view, GlsMatrixType *proj, GlsMatrixType *model)
GlsMatrixType * modelMatrix
The modelview matrix.
Definition: util.h:547
int * viewMatrix
The viewport matrix.
Definition: util.h:545
~OpenGLMatrices()
Destructor.
GlsMatrixType * projMatrix
The projection matrix.
Definition: util.h:546
OpenGLMatrices(const OpenGLMatrices &src)
Definition: scoped_ptr.h:53
Definition: texture_loader.h:55
float y
The Y component.
Definition: vertex.h:87
float x
The X component.
Definition: vertex.h:86
float z
The Z component.
Definition: vertex.h:88
int _argc
The number of arguments.
Definition: util.h:1206
static glsCommandLine * Instance()
void ReadCommandLine(int argc, char **argv)
void Usage()
Prints the usage instructions for the command line operations to stdout.
bool SilentMode() const
Definition: util.h:1210
char ** _argv
The array of arguments.
Definition: util.h:1207
Contains the DistiAssert macro.
The disti::DynamicArray class. A templated array of objects capable of dynamically growing.
Macros and helper code to determine what subset of C++11/14/17 is available.
#define DISTI_RVAL_MOVE(x)
Macro to wrap std::move, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:195
#define DISTI_SPECIAL_MEM_FUN_DELETE
Macro to wrap function deletion, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:245
#define DISTI_STATIC_ASSERT_STR(expr, msg)
Uses C++11's static_assert() because it is available on this platform.
Definition: gls_cpp_lang_support.h:432
#define DISTI_FINAL
Macro to wrap the final keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:223
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:221
#define DISTI_FUNC_NOEXCEPT
Macro to wrap the noexcept keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:239
A file for all GL Studio files to include.
#define GLS_EXPORT
Macro denoting which functions should be visible from the runtime library.
Definition: gls_include.h:50
#define DISTI_IS_BITNESS(X)
Macro for checking bitness (safer macros borrowed from https://www.fluentcpp.com/2019/05/28/better-ma...
Definition: gls_include.h:205
The GlsMatrixAffine class.
Definition: bmpimage.h:46
std::string ResolvePath(const char *path)
bool VeryCloseToZero(X x)
Definition: util.h:160
std::ostream UTF16Outstream
A cross platform UTF-16 encoded ostream.
Definition: util.h:427
void ConvertBackslashToSlash(char *str)
const char PARSER_CLEARSTRING_DELIMETER_END[]
Used for parsing lines of clear (multiline otherwise unencoded) text.
Definition: util.h:118
bool Equal(T1 x, T2 y, float precision=0.001f)
Definition: util.h:491
const char * GetBaseName(const char *path)
std::ofstream UnicodeOutfilestream
A cross platform UTF-8 encoded ofstream.
Definition: util.h:429
bool IsNearZero(X x)
Definition: util.h:166
int EncodeString(char *dest, const char *src, const int dest_str_length)
int Safe_fopen(const char *filename, char *flags, FILE **f)
bool gltIsExtSupported(const char *extension)
bool GetNoSpaces(FILE *f, char *result, int maxLen)
bool BETWEEN(const X &x, const X1 &x1, const X2 &x2)
Definition: util.h:128
const int INLINE_TEXTURE_LINE_LENGTH
Definition: util.h:115
const double HIT_TOLERANCE
The hit tolerance in logical units for selecting objects in the editor.
Definition: util.h:120
void AppendTrailingSlash(char *s)
std::string ResolveRuntimeResourcePath(const char *fileName)
DynamicArray< InterfaceDescriptionClass > InterfaceListType
Typedef for a list of interface description objects.
Definition: util.h:1309
bool FileExists(const char *filename)
int EncodedStringMinLength()
bool GetObjectCoordinatesTransformSameView(DisplayObject *from, DisplayObject *to, GlsMatrixType *outTransform)
bool CheckDistiLicense(const char *licenseGroupName, const char *feature, const char *version, bool quiet)
std::ostream & operator<<(std::ostream &outstr, const AttributeName &name)
void PushResourceFinder(std::string(*finder)(const std::string &))
char * GetFileName(const char *name)
std::string FileName(const std::string &filepath)
void RemoveSpaces(std::string &entry)
std::ofstream UTF16Outfilestream
A cross platform UTF-16 encoded ofstream.
Definition: util.h:426
bool CalculateTexPointsFromTexCoords(DisplayObject *object)
bool CloseToZero(const X x, const X threshold=X(1e-1))
Definition: util.h:151
bool GetVertex(std::istream &instr, Vertex *vert, bool getColor)
const char * GetFilePath(const char *name)
void GlsGetOrtho(GlsMatrixType &m, double left, double right, double bottom, double top, double zNear, double zFar)
float AngularDistanceRad(float angle1, float angle2)
unsigned char * GlsDefinedColor(GlsDefinedColorEnum index)
Definition: util.h:226
std::string FileExtension(const std::string &filepath)
char * PathToOS(const char *path)
std::string Uppercase(const std::string &str)
char * MakeRelativePath(const char *originalPath, const char *relativePath)
UTF16String ConvertUTF8ToWide(const std::string &src)
Definition: util.h:446
std::string GetQualifiedInstanceName(const DisplayFrame *topFrame, const DisplayObject *obj)
bool GetToEnd(std::istream &instr, std::string &result, bool decode)
bool IS_ZERO(X x)
Definition: util.h:172
const char PARSER_CLEARSTRING_DELIMETER_START[]
Used for parsing lines of clear (multiline otherwise unencoded) text.
Definition: util.h:117
void SpawnBrowser(const char *url)
bool FindNonColinearVertices(int arraySize, Vector array[], int &index1, int &index2, int &index3, bool isVectorArray=true)
void RemoveDoubleSlashes(char *path, char slash='/')
void CheckGLError()
Checks the OpenGL error state, and prints to stdout if there was an error.
const T & Max(const T &x, const T &y)
Definition: util.h:511
const T & Min(const T &x, const T &y)
Definition: util.h:501
bool IS_NEGATIVE(const X &x)
Definition: util.h:138
int DecodeString(char *dest, const char *src, const int dest_str_length)
void PushResourcePath(const char *resourcePath)
std::string UnicodeString
A cross platform UTF-8 encoded string.
Definition: util.h:428
void TrimSpaces(std::string &entry)
bool ContainsNonBlank(const std::string &val)
GlsPropString operator+(const GlsPropString &a, GlsPropString &b)
Definition: util.h:1788
float AngularDistanceDeg(float angle1, float angle2)
int range_check(int num, double val,...)
bool SaveFileDialog(Fl_Window *win, char *filePath, unsigned int filePathSize, char *directory=NULL, const char *filterStr=NULL, const char *defaultExt=NULL, const char *title=NULL, bool createFile=false, bool fileMustExist=false, bool pathMustExist=false, bool noChangeDirectory=false)
std::istream & operator>>(std::istream &instr, GlsColor &color)
std::basic_string< unsigned short, CharTraitsUnsignedShort > UTF16String
A cross platform UTF-16 encoded string.
Definition: util.h:425
FILE * gls_fopen(const char *filename, const char *flags)
bool IsDirectory(const char *filename)
bool OpenFileDialog(Fl_Window *win, char *filePath, unsigned int filePathSize, char *directory=NULL, const char *filterStr=NULL, const char *defaultExt=NULL, const char *title=NULL, bool multiSelect=false, bool createFile=false, bool fileMustExist=false, bool pathMustExist=false, bool noChangeDirectory=false)
bool NotColinear(const Vector &a, const Vector &b, const Vector &c)
void GlsGetPerspective(GlsMatrixType &m, double fovy, double aspect, double zNear, double zFar)
void ChangeGlsDefinedColor(GlsDefinedColorEnum index, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
Definition: util.h:240
std::string GetExtension(const std::string &filename)
std::ostream UnicodeOutstream
A cross platform UTF-8 encoded string.
Definition: util.h:430
bool GetObjectCoordinatesTransform(DisplayObject *from, DisplayObject *to, GlsMatrixType *outTransform)
std::string ReplaceEnvironmentVariables(const char *originalPath)
unsigned char glsDefinedColors[GLS_COLOR_MAX][4]
std::string GetDefaultComponentClassName(const char *dllFileName)
GlsPropString & operator+=(GlsPropString &a, const GlsPropString &b)
Definition: util.h:1842
GlsMatrixAffine< T > FindCoordinateTransformation(const Vector &new_origin, const Vector &new_i, const Vector &new_j, const Vector &new_k)
Definition: util.h:586
bool IS_POSITIVE(const X &x)
Definition: util.h:144
GlsDefinedColorEnum
Definition: util.h:206
DisplayFrame * GetTopLevelDisplayFrame(DisplayFrame *frame)
int gls_unlink(const char *filename)
int C_EncodeString(char *dest, const char *src, const int dest_str_length)
bool GetComponentClassNames(const char *dllFileName, DynamicArray< std::string > &nameList, const char *createClassTag="CreateComponent_")
std::string FilePath(const std::string &filepath)
A smart pointer with unique ownership – poor man's std::unique_ptr.
static bool lt(const char_type &c1, const char_type &c2)
Definition: util.h:289
static void assign(char_type &c1, const char_type &c2)
Definition: util.h:271
static int_type to_int_type(const char_type &c)
Definition: util.h:395
static char_type * move(char_type *s1, const char_type *s2, size_t n)
Definition: util.h:355
std::mbstate_t state_type
Typedef for the underlying multibyte conversion state type.
Definition: util.h:266
static const char_type * find(const char_type *s, size_t n, const char_type &a)
Definition: util.h:337
static bool eq(const char_type &c1, const char_type &c2)
Definition: util.h:280
static int compare(const char_type *s1, const char_type *s2, size_t n)
Definition: util.h:299
static char_type to_char_type(const int_type &c)
Definition: util.h:387
static char_type * copy(char_type *s1, const char_type *s2, size_t n)
Definition: util.h:365
static int_type eof()
Definition: util.h:411
std::streampos pos_type
Typedef for the underlying stream position type.
Definition: util.h:264
unsigned short char_type
Typedef for the underlying char type.
Definition: util.h:262
static int_type not_eof(const int_type &c)
Definition: util.h:419
int int_type
Typedef for the underlying int type.
Definition: util.h:263
static size_t length(const char_type *s)
Definition: util.h:322
static bool eq_int_type(const int_type &c1, const int_type &c2)
Definition: util.h:404
std::streamoff off_type
Typedef for the underlying stream offset type.
Definition: util.h:265
static char_type * assign(char_type *s, size_t n, char_type a)
Definition: util.h:375
int width
The width in pixels.
Definition: util.h:795
unsigned char * pixels
Pointer to the underlying data buffer.
Definition: util.h:798
int height
The height in pixels.
Definition: util.h:796
int comprSize
The size in bytes.
Definition: util.h:797
The DistiUnhideGlobalsDummyClass class.
void _checkPointerSize()
We need this function because 'static_assert' replacements for pre-C++11 compilers cannot be at file ...
Definition: util.h:2106
std::string MakeString(const char *const cStr)
Definition: util.h:2051
void Split(const std::string &s, const char delim, std::vector< std::string > &elems, const std::size_t maxElems=0)
Definition: util.h:2007
T Clamp(const T &val, const T &min, const T &max)
Definition: util.h:1994
bool glsUnProject(double winx, double winy, double winz, const double modelMatrix[16], const double projMatrix[16], const int viewport[4], double *objx, double *objy, double *objz)
void glsPerspective(double fovy, double aspect, double zNear, double zFar)
bool glsProject(double objx, double objy, double objz, const double modelMatrix[16], const double projMatrix[16], const int viewport[4], double *winx, double *winy, double *winz)
const int DIALOG_MAX_DIRECTORY_LENGTH
Limited by FLTK FileBrowser.
Definition: util.h:82
The disti::Vertex class. A class for manipulating 3D vertices.