The latest version of this page is now maintained at http://www.frogtoss.com/labs/pages/native-project-standards.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //// | |
| // | |
| // This single-file no-dependency Processing 3 sketch demonstrates | |
| // how you can livecode side-by-side VR content in Processing and | |
| // render it in realtime! | |
| // | |
| // All comments exist to help the reader understand the approach. | |
| // | |
| // Youtube render of this sketch: | |
| // https://www.youtube.com/watch?v=E3d7d8XR4Y0&feature=youtu.be |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* ftg_core.h - v0.5 - Frogtoss Toolbox. Public domain-like license below. | |
| ftg libraries are copyright (C) 2015 Frogtoss Games, Inc. | |
| http://github.com/mlabbe/ftg_toolbox | |
| ftg header files are single file header files intended to be useful | |
| in C/C++. ftg_core contains generally useful functions | |
| Special thanks to STB for the inspiration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* returns true if the dir or file exists */ | |
| FTGDEF bool | |
| ftg_path_exists(const char *path) | |
| { | |
| #ifdef FTG_POSIX_LIKE | |
| return access(path, F_OK) != -1; | |
| #elif defined(_WIN32) | |
| ftg_wchar_t u8_path[MAX_PATH]; | |
| DWORD attrib; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* append num strings, returning heap-allocated string. | |
| caller must free() returned ptr. */ | |
| char * | |
| ftg_strcatall(size_t num, ...) | |
| { | |
| size_t i, alloc_size = 0; | |
| va_list va1, va2; | |
| char *buf, *p_buf; | |
| va_start(va1, num); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CC=/usr/bin/gcc | |
| if [[ $# -gt 0 ]] | |
| then | |
| CC=$1 | |
| fi | |
| touch ___temp.c | |
| $CC -dM -E ___temp.c | |
| rm ___temp.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // My goal is to perform endian detect in the preprocessor without | |
| // breaking C89 compatibility. YES, I know how rare big endian is in 2016. I don't care. | |
| #if (0xFF<<8) & 65280 | |
| # define LITTLE_ENDIAN | |
| #else | |
| # define BIG_ENDIAN | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // usage: FTG_STATIC_ASSERT(1==0) | |
| // error message contains "assertion_at_line_xxx" | |
| // | |
| // usage: FTG_STATIC_ASSERT_MSG(1==0, one_is_not_zero) | |
| // error message contains: "one_is_not_zero" | |
| // | |
| // tested on GCC, Clang, MSVC 98 and MSVC 2015 | |
| // | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* detect target enviroment bits */ | |
| #if _WIN64 | |
| # define FTG_BITS 64 | |
| #elif _WIN32 | |
| # define FTG_BITS 32 | |
| #endif | |
| #if __GNUC__ | |
| # if __x86_64__ || __ppc64__ | |
| # define FTG_BITS 64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import shutil | |
| import os.path | |
| class AppleBundle: | |
| def __init__(self, app_name, exe_path, icon_path, version_tuple=('1','0','0')): | |
| self.app_name = app_name | |
| self.exe_path = exe_path | |
| self.icon_path = icon_path |