42#ifndef INCLUDED_GLS_RUNTIME_UTIL_H
43#define INCLUDED_GLS_RUNTIME_UTIL_H
45#include "ConvertUTF.h"
66# define _CRT_FUNCTIONS_REQUIRED 1
77#if defined( LINUX ) || defined( __VXWORKS__ ) || defined( __APPLE__ ) || defined( QNX )
82# include <android/asset_manager.h>
90#if defined( GLS_DEBUG ) || !defined( NDEBUG )
91# define GLS_DEBUG_CODE( x ) x
93# define GLS_DEBUG_CODE( x )
111inline int strcasecmp(
const char*
const x,
const char*
const y )
113 return _stricmp( x, y );
130template<
class X,
class X1,
class X2>
131bool BETWEEN(
const X& x,
const X1& x1,
const X2& x2 )
133 return ( x >= x1 && x <= x2 )
134 || ( x >= x2 && x <= x1 );
141bool IS_NEGATIVE(
const X& x ) {
return std::fabs( x ) > 0.0001 ? ( x < 0.0 ) : 0; }
147bool IS_POSITIVE(
const X& x ) {
return std::fabs( x ) > 0.0001 ? ( x > 0.0 ) : 0; }
156 return std::fabs( x ) < threshold;
180# define MIN( A, B ) ( ( A ) < ( B ) ? ( A ) : ( B ) )
186# define MAX( A, B ) ( ( A ) > ( B ) ? ( A ) : ( B ) )
201# define GLSTUDIO_CLAMP_TO_EDGE ( OpenGLVersion() >= 1.2f ? 0x812F : GL_CLAMP )
203# define GLSTUDIO_CLAMP_TO_EDGE GL_CLAMP_TO_EDGE
231 if( ( index < 0 ) || ( index >= GLS_COLOR_MAX ) )
248 unsigned char alpha )
250 if( ( index >= 0 ) && ( index < GLS_COLOR_MAX ) )
312 return ( *s1 - *( s2 - 1 ) );
380 for(
size_t idx = 0u; idx < n; ++idx )
416 return static_cast<int_type>( EOF );
424 return ( c ==
eof() ) ? 0 : c;
428typedef std::basic_string<unsigned short, CharTraitsUnsignedShort>
UTF16String;
453 if( src.size() > 0u )
456 const unsigned int srcLen = (
unsigned int)src.size();
457 const unsigned int utf16BufLen = (
unsigned int)( src.size() + 1u );
458 UTF16* utf16Buf =
new UTF16[ src.size() + 1u ];
460 memset( utf16Buf, 0, ( utf16BufLen *
sizeof( UTF16 ) ) );
464 const UTF8* srcUTF8 = (
const UTF8*)( src.c_str() );
465 UTF16* targetUTF16 = utf16Buf;
466 ConvertUTF8toUTF16( &srcUTF8, &srcUTF8[ srcLen ], &targetUTF16, &( targetUTF16[ utf16BufLen - 1u ] ), strictConversion );
469 utf16Buf[ utf16BufLen - 1u ] = 0;
472 ret.assign( (
wchar_t*)utf16Buf );
474 ret.assign( (
unsigned short*)utf16Buf );
478 delete[]( utf16Buf );
494template<
class T1,
class T2>
495bool Equal( T1 x, T2 y,
float precision = 0.001f )
497 return ( x - precision ) <= y && y <= ( x + precision );
505const T&
Min(
const T& x,
const T& y )
507 return x < y ? x : y;
515const T&
Max(
const T& x,
const T& y )
517 return x < y ? y : x;
525template<
class T,
class Pred>
526const T&
Min(
const T& x,
const T& y, Pred pr )
528 return pr( x, y ) ? x : y;
536template<
class T,
class Pred>
537const T&
Max(
const T& x,
const T& y, Pred pr )
539 return pr( x, y ) ? y : x;
601 rotation_scaling( 0, 0 ) = new_i.
x;
602 rotation_scaling( 0, 1 ) = new_j.
x;
603 rotation_scaling( 0, 2 ) = new_k.
x;
604 rotation_scaling( 1, 0 ) = new_i.
y;
605 rotation_scaling( 1, 1 ) = new_j.
y;
606 rotation_scaling( 1, 2 ) = new_k.
y;
607 rotation_scaling( 2, 0 ) = new_i.
z;
608 rotation_scaling( 2, 1 ) = new_j.
z;
609 rotation_scaling( 2, 2 ) = new_k.
z;
612 rotation_scaling.
Invert();
615 return rotation_scaling * transform;
643 rotation_scaling( 0, 0 ) = new_i.
x;
644 rotation_scaling( 0, 1 ) = new_j.
x;
645 rotation_scaling( 0, 2 ) = new_k.
x;
646 rotation_scaling( 1, 0 ) = new_i.
y;
647 rotation_scaling( 1, 1 ) = new_j.
y;
648 rotation_scaling( 1, 2 ) = new_k.
y;
649 rotation_scaling( 2, 0 ) = new_i.
z;
650 rotation_scaling( 2, 1 ) = new_j.
z;
651 rotation_scaling( 2, 2 ) = new_k.
z;
654 rotation_scaling.
Invert();
657 result = rotation_scaling * transform;
726 int& index1,
int& index2,
int& index3,
727 bool isVectorArray =
true );
854GLS_EXPORT void EnableDirectAssetLoading(
bool enableDirectAssetLoading );
862GLS_EXPORT bool HasAssetExtension(
const char* filename );
870GLS_EXPORT bool AssetExists(
const char* filename );
877GLS_EXPORT void SetAssetManager( AAssetManager* assetManager );
880#if defined( ANDROID ) || ( defined( __APPLE__ ) && defined( GLES ) ) || ( defined( LINUX ) && defined( GLES ) ) || defined( QNX ) || defined( INTEGRITY )
892GLS_EXPORT void SetResourcePath(
const char* resourcePath );
956#if defined( __APPLE__ ) && defined( GLES )
963GLS_EXPORT std::string GetAbsolutePathAndFileNameInDefaultResourceBundle(
const char* fileName );
1135#if !defined( GLES ) || defined( GLES_ANGLE )
1151 char* directory = NULL,
const char* filterStr = NULL,
1152 const char* defaultExt = NULL,
const char* title = NULL,
1153 bool multiSelect =
false,
bool createFile =
false,
1154 bool fileMustExist =
false,
bool pathMustExist =
false,
1155 bool noChangeDirectory =
false );
1171 char* directory = NULL,
const char* filterStr = NULL,
1172 const char* defaultExt = NULL,
const char* title = NULL,
1173 bool createFile =
false,
1174 bool fileMustExist =
false,
bool pathMustExist =
false,
1175 bool noChangeDirectory =
false );
1261 const char*
Code()
const {
return _code; }
1264 const char*
Usage()
const {
return _usage; }
1269#if defined( DISTI_HAS_RVAL_REFS )
1277 StealFrom( source );
1285 if(
this != &source )
1292 StealFrom( source );
1301 _code = source._code;
1302 _usage = source._usage;
1303 _comment = source._comment;
1306 source._code = NULL;
1307 source._usage = NULL;
1308 source._comment = NULL;
1365 if(
typeid( T2 ) !=
typeid(
void* ) )
1369 if(
typeid( T3 ) !=
typeid(
void* ) )
1373 if(
typeid( T4 ) !=
typeid(
void* ) )
1377 if(
typeid( T5 ) !=
typeid(
void* ) )
1381 if(
typeid( T6 ) !=
typeid(
void* ) )
1385 if(
typeid( T7 ) !=
typeid(
void* ) )
1389 if(
typeid( T8 ) !=
typeid(
void* ) )
1393 if(
typeid( T9 ) !=
typeid(
void* ) )
1397 if(
typeid( T10 ) !=
typeid(
void* ) )
1454 const T2& val2 = T2(),
1455 const T3& val3 = T3(),
1456 const T4& val4 = T4(),
1457 const T5& val5 = T5(),
1458 const T6& val6 = T6(),
1459 const T7& val7 = T7(),
1460 const T8& val8 = T8(),
1461 const T9& val9 = T9(),
1462 const T10& val10 = T10() )
1510 return !( *
this == val );
1517 outstr <<
" " <<
_val2;
1519 outstr <<
" " <<
_val3;
1521 outstr <<
" " <<
_val4;
1523 outstr <<
" " <<
_val5;
1525 outstr <<
" " <<
_val6;
1527 outstr <<
" " <<
_val7;
1529 outstr <<
" " <<
_val8;
1531 outstr <<
" " <<
_val9;
1532 if( _numVals >= 10 )
1579 if( _numVals >= 10 )
1632 operator std::string()
const
1660 return !( str1 == str2 );
1717 operator std::string()
const
1758 if( instr.peek() !=
'\"' )
1770 while( instr.good() )
1772 lastChar = currChar;
1773 currChar = instr.get();
1774 if( currChar != -1 )
1776 if( currChar ==
'\"' && lastChar !=
'\\' )
1778 temp += (char)currChar;
1844 T
Clamp(
const T& val,
const T& min,
const T& max )
1846 return std::min( max, std::max( min, val ) );
1857 inline void Split(
const std::string& s,
const char delim, std::vector<std::string>& elems,
const std::size_t maxElems = 0 )
1859 std::istringstream ss( s );
1861 while( std::getline( ss, item, delim ) )
1864 if( elems.size() == maxElems )
1870 if( maxElems > 0 && elems.size() == maxElems && ss.good() )
1872 std::string remainder;
1873 std::getline( ss, remainder,
'\0' );
1874 elems.back() += delim + remainder;
1876 else if( s.size() && s.at( s.size() - 1 ) == delim )
1879 elems.push_back(
"" );
1891 inline std::vector<std::string>
Split(
const std::string& s,
const char delim,
const std::size_t maxElems = 0 )
1893 std::vector<std::string> elems;
1894 Split( s, delim, elems, maxElems );
1903 return ( cStr ? cStr :
"" );
1910class IGlsStateManager;
1913class TextureLoaderList;
1961 "Pointer size is unexpected for this bitness" );
1987#ifdef MATRIX_TYPE_FLOAT
1989 const float modelMatrix[ 16 ],
1990 const float projMatrix[ 16 ],
1991 const int viewport[ 4 ],
1992 double* winx,
double* winy,
double* winz );
1995 const double modelMatrix[ 16 ],
1996 const double projMatrix[ 16 ],
1997 const int viewport[ 4 ],
1998 double* winx,
double* winy,
double* winz );
2012#ifdef MATRIX_TYPE_FLOAT
2014 const float modelMatrix[ 16 ],
2015 const float projMatrix[ 16 ],
2016 const int viewport[ 4 ],
2017 double* objx,
double* objy,
double* objz );
2020 const double modelMatrix[ 16 ],
2021 const double projMatrix[ 16 ],
2022 const int viewport[ 4 ],
2023 double* objx,
double* objy,
double* objz );
Definition: display_frame.h:87
Definition: dynamic_array.h:79
Definition: gls_font_man.h:60
Hold global objects so we can control order of destruction.
Definition: util.h:1917
Mutex & GetImageListMutex()
IGlsStateManager & GetStateManager()
static GlsGlobals & Instance()
GlsFontMan & GetFontMan()
TextureLoaderList & GetTextureLoaders()
void Translate(Type x, Type y, Type z)
Definition: gls_matrix_affine.h:205
void Invert()
Definition: gls_matrix.h:752
std::ostream ostreamType
Typedef shorthand for std::ostream.
Definition: util.h:1322
virtual void StreamOut(ostreamType &outstr) const =0
virtual void StreamIn(istreamType &instr)=0
std::istream istreamType
Typedef shorthand for std::istream.
Definition: util.h:1323
T6 _val6
The sixth value.
Definition: util.h:1409
GlsMultiVal()
Definition: util.h:1418
virtual void StreamIn(istreamType &instr) override
Definition: util.h:1536
T7 _val7
The seventh value.
Definition: util.h:1410
GlsMultiVal(const GlsMultiVal &src)
Definition: util.h:1426
T5 _val5
The fifth value.
Definition: util.h:1408
T4 _val4
The fourth value.
Definition: util.h:1407
T3 _val3
The third value.
Definition: util.h:1406
virtual bool operator==(const GlsMultiVal &val) const
Definition: util.h:1480
T10 _val10
The tenth value.
Definition: util.h:1413
virtual void StreamOut(ostreamType &outstr) const override
Definition: util.h:1513
T2 _val2
The second value.
Definition: util.h:1405
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:1452
T8 _val8
The eighth value.
Definition: util.h:1411
virtual bool operator!=(const GlsMultiVal &val) const
Definition: util.h:1508
T1 _val1
The first value.
Definition: util.h:1404
T9 _val9
The ninth value.
Definition: util.h:1412
GlsPropStringQuoted()
Default constructor, create an empty GlsPropStringQuoted object.
Definition: util.h:1698
GlsPropStringQuoted(const std::string &str)
Definition: util.h:1704
bool operator==(const GlsPropStringQuoted &str) const
Definition: util.h:1731
std::string _string
The underlying wrapped string.
Definition: util.h:1695
GlsPropStringQuoted(const char *str)
Definition: util.h:1711
std::string & String()
Definition: util.h:1723
GlsPropString(const char *str)
Definition: util.h:1626
GlsPropString()
Default constructor. Creates an empty GlsPropString.
Definition: util.h:1612
friend bool operator==(const GlsPropString &str1, const GlsPropString &str2)
Definition: util.h:1649
GlsPropString(const std::string &str)
Definition: util.h:1619
std::string _string
The underlying wrapped string.
Definition: util.h:1609
std::string & String()
Definition: util.h:1640
friend bool operator!=(const GlsPropString &str1, const GlsPropString &str2)
Definition: util.h:1658
Definition: gls_state_manager_interface.h:69
const char * Code() const
Definition: util.h:1261
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:1264
InterfaceDescriptionClass(const InterfaceDescriptionClass &source)
InterfaceDescriptionClass(InterfaceDescriptionClass &&source)
Definition: util.h:1272
void Usage(const char *)
Set the usage member to a new value.
InterfaceDescriptionClass & operator=(InterfaceDescriptionClass &&source)
Definition: util.h:1283
const char * Comment() const
Definition: util.h:1267
Definition: gls_mutex.h:53
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:544
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:551
int * viewMatrix
The viewport matrix.
Definition: util.h:549
~OpenGLMatrices()
Destructor.
GlsMatrixType * projMatrix
The projection matrix.
Definition: util.h:550
OpenGLMatrices(const OpenGLMatrices &src)
Definition: scoped_ptr.h:54
Definition: texture_loader.h:56
float y
The Y component.
Definition: vertex.h:88
float x
The X component.
Definition: vertex.h:87
float z
The Z component.
Definition: vertex.h:89
int _argc
The number of arguments.
Definition: util.h:1210
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:1214
char ** _argv
The array of arguments.
Definition: util.h:1211
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:193
#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:235
#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:405
#define DISTI_FINAL
Macro to wrap the final keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:216
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:214
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:52
#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:207
The GlsMatrixAffine class.
Force inclusion of the DirectShow library.
Definition: bmpimage.h:47
std::string ResolvePath(const char *path)
bool VeryCloseToZero(X x)
Definition: util.h:163
std::ostream UTF16Outstream
A cross platform UTF-16 encoded ostream.
Definition: util.h:430
void ConvertBackslashToSlash(char *str)
const char PARSER_CLEARSTRING_DELIMETER_END[]
Used for parsing lines of clear (multiline otherwise unencoded) text.
Definition: util.h:121
bool Equal(T1 x, T2 y, float precision=0.001f)
Definition: util.h:495
const char * GetBaseName(const char *path)
std::ofstream UnicodeOutfilestream
A cross platform UTF-8 encoded ofstream.
Definition: util.h:432
bool IsNearZero(X x)
Definition: util.h:169
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:131
const int INLINE_TEXTURE_LINE_LENGTH
Definition: util.h:118
const double HIT_TOLERANCE
The hit tolerance in logical units for selecting objects in the editor.
Definition: util.h:123
void AppendTrailingSlash(char *s)
std::string ResolveRuntimeResourcePath(const char *fileName)
DynamicArray< InterfaceDescriptionClass > InterfaceListType
Typedef for a list of interface description objects.
Definition: util.h:1313
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:429
bool CalculateTexPointsFromTexCoords(DisplayObject *object)
bool CloseToZero(const X x, const X threshold=X(1e-1))
Definition: util.h:154
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:229
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:450
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:175
const char PARSER_CLEARSTRING_DELIMETER_START[]
Used for parsing lines of clear (multiline otherwise unencoded) text.
Definition: util.h:120
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:515
const T & Min(const T &x, const T &y)
Definition: util.h:505
bool IS_NEGATIVE(const X &x)
Definition: util.h:141
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:431
void TrimSpaces(std::string &entry)
bool ContainsNonBlank(const std::string &val)
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:428
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:243
std::string GetExtension(const std::string &filename)
std::ostream UnicodeOutstream
A cross platform UTF-8 encoded string.
Definition: util.h:433
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)
GlsMatrixAffine< T > FindCoordinateTransformation(const Vector &new_origin, const Vector &new_i, const Vector &new_j, const Vector &new_k)
Definition: util.h:590
bool IS_POSITIVE(const X &x)
Definition: util.h:147
GlsDefinedColorEnum
Definition: util.h:209
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:292
static void assign(char_type &c1, const char_type &c2)
Definition: util.h:274
static int_type to_int_type(const char_type &c)
Definition: util.h:398
static char_type * move(char_type *s1, const char_type *s2, size_t n)
Definition: util.h:358
std::mbstate_t state_type
Typedef for the underlying multibyte conversion state type.
Definition: util.h:269
static const char_type * find(const char_type *s, size_t n, const char_type &a)
Definition: util.h:340
static bool eq(const char_type &c1, const char_type &c2)
Definition: util.h:283
static int compare(const char_type *s1, const char_type *s2, size_t n)
Definition: util.h:302
static char_type to_char_type(const int_type &c)
Definition: util.h:390
static char_type * copy(char_type *s1, const char_type *s2, size_t n)
Definition: util.h:368
static int_type eof()
Definition: util.h:414
std::streampos pos_type
Typedef for the underlying stream position type.
Definition: util.h:267
unsigned short char_type
Typedef for the underlying char type.
Definition: util.h:265
static int_type not_eof(const int_type &c)
Definition: util.h:422
int int_type
Typedef for the underlying int type.
Definition: util.h:266
static size_t length(const char_type *s)
Definition: util.h:325
static bool eq_int_type(const int_type &c1, const int_type &c2)
Definition: util.h:407
std::streamoff off_type
Typedef for the underlying stream offset type.
Definition: util.h:268
static char_type * assign(char_type *s, size_t n, char_type a)
Definition: util.h:378
int width
The width in pixels.
Definition: util.h:799
unsigned char * pixels
Pointer to the underlying data buffer.
Definition: util.h:802
int height
The height in pixels.
Definition: util.h:800
int comprSize
The size in bytes.
Definition: util.h:801
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:1956
std::string MakeString(const char *const cStr)
Definition: util.h:1901
void Split(const std::string &s, const char delim, std::vector< std::string > &elems, const std::size_t maxElems=0)
Definition: util.h:1857
T Clamp(const T &val, const T &min, const T &max)
Definition: util.h:1844
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:85
The disti::Vertex class. A class for manipulating 3D vertices.