Mercurial > hg > forks > gldragon
view dmutil.h @ 42:3c7e1d3fa5a2
Implement OpengL extension handling through new header file dmglexts.h to
"define" the entrypoints we require and some wonderful preprocessor macro
magic to add checks for them via SDL_GL_ExtensionSupported() and initialize
function pointers with SDL_GL_GetProcAddress().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 05 Dec 2019 21:05:43 +0200 |
parents | 03b86b9c2f29 |
children | 9909014498f0 |
line wrap: on
line source
// // GLDragon - OpenGL PLY model viewer / simple benchmark // -- Miscellaneous utility functions // Programmed and designed by Matti 'ccr' Hämäläinen <ccr@tnsp.org> // (C) Copyright 2019 Tecnic Software productions (TNSP) // // See file "COPYING" for license information. // #ifndef DMUTIL_H #define DMUTIL_H 1 #include <string> #include <vector> #include <cstdio> #include <iostream> #define DMUTIL_WHITESPACE "\t\n\v\f\r " std::string dmStrLTrim(const std::string& str, const std::string& delim = DMUTIL_WHITESPACE); std::string dmStrRTrim(const std::string& str, const std::string& delim = DMUTIL_WHITESPACE); std::string dmStrTrim(const std::string& str, const std::string& delim = DMUTIL_WHITESPACE); std::vector<std::string> dmStrSplit(const std::string& str, const std::string& delim = DMUTIL_WHITESPACE); std::string dmStrJoin(const std::vector<std::string> &list, const std::string &delim); std::string dmGetPath(const std::string &path); bool dmReadText(const std::string &filename, std::string &buf, const int maxSize); bool dmFileExists(const std::string &filename, std::ios_base::openmode mode = std::ios_base::in); #endif