├── Makefile ├── Project.xcconfig ├── README.md ├── addons.make ├── bin ├── data │ ├── .gitkeep │ ├── blowharder.png │ ├── full_pic.png │ ├── generic_platformer_tiles.png │ ├── simple_pic.png │ ├── simples_pimples_cut.png │ └── small_pic.png └── wave_function_collapseDebug.app │ └── Contents │ ├── Frameworks │ ├── GLUT.framework │ │ ├── GLUT │ │ ├── Headers │ │ ├── Resources │ │ └── Versions │ │ │ ├── A │ │ │ ├── GLUT │ │ │ ├── Headers │ │ │ │ ├── copy.h │ │ │ │ ├── extrude.h │ │ │ │ ├── glsmap.h │ │ │ │ ├── glsmapint.h │ │ │ │ ├── glut.h │ │ │ │ ├── glutbitmap.h │ │ │ │ ├── glutf90.h │ │ │ │ ├── glutstroke.h │ │ │ │ ├── gutil.h │ │ │ │ ├── intersect.h │ │ │ │ ├── port.h │ │ │ │ ├── rot.h │ │ │ │ ├── segment.h │ │ │ │ ├── tube.h │ │ │ │ ├── tube_gc.h │ │ │ │ └── vvector.h │ │ │ └── Resources │ │ │ │ ├── Caution.tiff │ │ │ │ ├── English.lproj │ │ │ │ ├── GLUT.nib │ │ │ │ │ └── objects.nib │ │ │ │ ├── GLUTClipboard.nib │ │ │ │ │ └── objects.nib │ │ │ │ ├── GLUTPreferences.nib │ │ │ │ │ └── objects.nib │ │ │ │ ├── GLUTUI.strings │ │ │ │ └── InfoPlist.strings │ │ │ │ ├── Info.plist │ │ │ │ ├── blankCursor.tiff │ │ │ │ ├── bottomCursor.tiff │ │ │ │ ├── bottomleftCursor.tiff │ │ │ │ ├── bottomrightCursor.tiff │ │ │ │ ├── crossCursor.tiff │ │ │ │ ├── cycleCursor.tiff │ │ │ │ ├── destroyCursor.tiff │ │ │ │ ├── fingerCursor.tiff │ │ │ │ ├── helpCursor.tiff │ │ │ │ ├── leftCursor.tiff │ │ │ │ ├── leftRightCursor.tiff │ │ │ │ ├── rightArrowCursor.tiff │ │ │ │ ├── rightCursor.tiff │ │ │ │ ├── sprayCursor.tiff │ │ │ │ ├── topCursor.tiff │ │ │ │ ├── topleftCursor.tiff │ │ │ │ ├── toprightCursor.tiff │ │ │ │ ├── upDownCursor.tiff │ │ │ │ └── waitCursor.tiff │ │ │ └── Current │ └── libfmodex.dylib │ ├── Info.plist │ ├── MacOS │ └── wave_function_collapseDebug │ ├── PkgInfo │ └── Resources │ └── icon-debug.icns ├── config.make ├── openFrameworks-Info.plist ├── src ├── CheckPoint.h ├── PotentialTile.cpp ├── PotentialTile.hpp ├── Tile.h ├── TileCutter.cpp ├── TileCutter.hpp ├── TileInfo.h ├── UniqueTileButton.h ├── main.cpp ├── ofApp.cpp └── ofApp.h └── wave_function_collapse.xcodeproj ├── project.pbxproj ├── project.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── awallace.xcuserdatad │ └── UserInterfaceState.xcuserstate └── xcshareddata └── xcschemes ├── wave_function_collapse Debug.xcscheme └── wave_function_collapse Release.xcscheme /Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # wave_function_collapse 2 | written in of 0.9.8 for mac 3 | 4 | Using the Wave Function Collapse algorithm by mxgmn 5 | https://github.com/mxgmn/WaveFunctionCollapse 6 | 7 | Based on this article https://trasevol.dog/2017/09/01/di19/ 8 | 9 | using tiles; 10 | 11 | Simple NES-like Platformer Tiles by surt 12 | https://opengameart.org/content/simple-nes-like-platformer-tiles 13 | 14 | Simple broad-purpose tileset by surt 15 | https://opengameart.org/content/simple-broad-purpose-tileset 16 | 17 | Generic Platformer Tiles by surt 18 | https://opengameart.org/content/generic-platformer-tiles 19 | 20 | Blowhard 2: Blow Harder by surt 21 | https://opengameart.org/content/blowhard-2-blow-harder 22 | 23 | Overworld tiles by Buch 24 | https://opengameart.org/content/overworld-tiles-0 25 | 26 | -------------------------------------------------------------------------------- /addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/addons.make -------------------------------------------------------------------------------- /bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/data/.gitkeep -------------------------------------------------------------------------------- /bin/data/blowharder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/data/blowharder.png -------------------------------------------------------------------------------- /bin/data/full_pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/data/full_pic.png -------------------------------------------------------------------------------- /bin/data/generic_platformer_tiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/data/generic_platformer_tiles.png -------------------------------------------------------------------------------- /bin/data/simple_pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/data/simple_pic.png -------------------------------------------------------------------------------- /bin/data/simples_pimples_cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/data/simples_pimples_cut.png -------------------------------------------------------------------------------- /bin/data/small_pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/data/small_pic.png -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/GLUT: -------------------------------------------------------------------------------- 1 | Versions/Current/GLUT -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/GLUT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/GLUT -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/copy.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * 4 | * Written By Linas Vepstas November 1991 5 | */ 6 | 7 | 8 | #define COPY_THREE_WORDS(A,B) { \ 9 | struct three_words { int a, b, c, }; \ 10 | *(struct three_words *) (A) = *(struct three_words *) (B); \ 11 | } 12 | 13 | #define COPY_FOUR_WORDS(A,B) { \ 14 | struct four_words { int a, b, c, d, }; \ 15 | *(struct four_words *) (A) = *(struct four_words *) (B); \ 16 | } 17 | 18 | /* ============================================================= */ 19 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/extrude.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * extrude.h 4 | * 5 | * FUNCTION: 6 | * prototypes for privately used subroutines for the tubing library 7 | * 8 | * HISTORY: 9 | * Linas Vepstas 1991 10 | */ 11 | 12 | #include "port.h" /* for gleDouble */ 13 | 14 | #ifndef M_PI 15 | #define M_PI 3.14159265358979323846 16 | #endif 17 | 18 | /* ============================================================ */ 19 | /* 20 | * Provides choice of calling subroutine, vs. invoking macro. 21 | * Basically, inlines the source, or not. 22 | * Trades performance for executable size. 23 | */ 24 | 25 | #define INLINE_INTERSECT 26 | #ifdef INLINE_INTERSECT 27 | #define INNERSECT(sect,p,n,v1,v2) { INTERSECT(sect,p,n,v1,v2); } 28 | #else 29 | #define INNERSECT(sect,p,n,v1,v2) intersect(sect,p,n,v1,v2) 30 | #endif /* INLINE_INTERSECT */ 31 | 32 | /* ============================================================ */ 33 | /* The folowing defines give a kludgy way of accessing the qmesh primitive */ 34 | 35 | /* 36 | #define bgntmesh _emu_qmesh_bgnqmesh 37 | #define endtmesh _emu_qmesh_endqmesh 38 | #define c3f _emu_qmesh_c3f 39 | #define n3f _emu_qmesh_n3f 40 | #define v3f _emu_qmesh_v3f 41 | */ 42 | 43 | /* ============================================================ */ 44 | 45 | extern void up_sanity_check (gleDouble up[3], /* up vector for contour */ 46 | int npoints, /* numpoints in poly-line */ 47 | gleDouble point_array[][3]); /* polyline */ 48 | 49 | 50 | extern void draw_raw_style_end_cap (int ncp, /* number of contour points */ 51 | gleDouble contour[][2], /* 2D contour */ 52 | gleDouble zval, /* where to draw cap */ 53 | int frontwards); /* front or back cap */ 54 | 55 | extern void draw_round_style_cap_callback (int iloop, 56 | double cap[][3], 57 | float face_color[3], 58 | gleDouble cut_vector[3], 59 | gleDouble bisect_vector[3], 60 | double norms[][3], 61 | int frontwards); 62 | 63 | extern void draw_angle_style_front_cap (int ncp, 64 | gleDouble bi[3], 65 | gleDouble point_array[][3]); 66 | 67 | extern void extrusion_raw_join (int ncp, /* number of contour points */ 68 | gleDouble contour[][2], /* 2D contour */ 69 | gleDouble cont_normal[][2],/* 2D contour normal vecs */ 70 | gleDouble up[3], /* up vector for contour */ 71 | int npoints, /* numpoints in poly-line */ 72 | gleDouble point_array[][3], /* polyline */ 73 | float color_array[][3], /* color of polyline */ 74 | gleDouble xform_array[][2][3]); /* 2D contour xforms */ 75 | 76 | 77 | extern void extrusion_round_or_cut_join (int ncp, /* number of contour points */ 78 | gleDouble contour[][2], /* 2D contour */ 79 | gleDouble cont_normal[][2],/* 2D contour normal vecs */ 80 | gleDouble up[3], /* up vector for contour */ 81 | int npoints, /* numpoints in poly-line */ 82 | gleDouble point_array[][3], /* polyline */ 83 | float color_array[][3], /* color of polyline */ 84 | gleDouble xform_array[][2][3]); /* 2D contour xforms */ 85 | 86 | 87 | extern void extrusion_angle_join (int ncp, /* number of contour points */ 88 | gleDouble contour[][2], /* 2D contour */ 89 | gleDouble cont_normal[][2],/* 2D contour normal vecs */ 90 | gleDouble up[3], /* up vector for contour */ 91 | int npoints, /* numpoints in poly-line */ 92 | gleDouble point_array[][3], /* polyline */ 93 | float color_array[][3], /* color of polyline */ 94 | gleDouble xform_array[][2][3]); /* 2D contour xforms */ 95 | 96 | /* -------------------------- end of file -------------------------------- */ 97 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/glsmap.h: -------------------------------------------------------------------------------- 1 | #ifndef __glsmap_h__ 2 | #define __glsmap_h__ 3 | 4 | /* Copyright (c) Mark J. Kilgard, 1998. */ 5 | 6 | /* This program is freely distributable without licensing fees 7 | and is provided without guarantee or warrantee expressed or 8 | implied. This program is -not- in the public domain. */ 9 | 10 | #if defined(_WIN32) 11 | 12 | /* Try hard to avoid including to avoid name space pollution, 13 | but Win32's needs APIENTRY and WINGDIAPI defined properly. */ 14 | # if 0 15 | # define WIN32_LEAN_AND_MEAN 16 | # include 17 | # else 18 | /* XXX This is from Win32's */ 19 | # ifndef APIENTRY 20 | # if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) 21 | # define APIENTRY __stdcall 22 | # else 23 | # define APIENTRY 24 | # endif 25 | # endif 26 | # ifndef CALLBACK 27 | /* XXX This is from Win32's */ 28 | # if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) 29 | # define CALLBACK __stdcall 30 | # else 31 | # define CALLBACK 32 | # endif 33 | # endif 34 | /* XXX This is from Win32's and */ 35 | # ifndef WINGDIAPI 36 | # define WINGDIAPI __declspec(dllimport) 37 | # endif 38 | /* XXX This is from Win32's */ 39 | # ifndef _WCHAR_T_DEFINED 40 | typedef unsigned short wchar_t; 41 | # define _WCHAR_T_DEFINED 42 | # endif 43 | # endif 44 | 45 | #pragma warning (disable:4244) /* Disable bogus conversion warnings. */ 46 | #pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */ 47 | 48 | #endif /* _WIN32 */ 49 | 50 | #include 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | typedef enum { 57 | SMAP_CLEAR_SMAP_TEXTURE = 0x1, 58 | SMAP_GENERATE_VIEW_MIPMAPS = 0x2, 59 | SMAP_GENERATE_SMAP_MIPMAPS = 0x4, 60 | SMAP_GENERATE_MIPMAPS = 0x6 /* both of above */ 61 | } SphereMapFlags; 62 | 63 | /* Cube view enumerants. */ 64 | enum { 65 | SMAP_FRONT = 0, 66 | SMAP_TOP = 1, 67 | SMAP_BOTTOM = 2, 68 | SMAP_LEFT = 3, 69 | SMAP_RIGHT = 4, 70 | SMAP_BACK = 5 71 | }; 72 | 73 | typedef struct _SphereMap SphereMap; 74 | 75 | extern SphereMap *smapCreateSphereMap(SphereMap *shareSmap); 76 | extern void smapDestroySphereMap(SphereMap *smap); 77 | 78 | extern void smapConfigureSphereMapMesh(SphereMap *smap, int steps, int rings, int edgeExtend); 79 | 80 | extern void smapSetSphereMapTexObj(SphereMap *smap, GLuint texobj); 81 | extern void smapSetViewTexObj(SphereMap *smap, GLuint texobj); 82 | extern void smapSetViewTexObjs(SphereMap *smap, GLuint texobjs[6]); 83 | extern void smapGetSphereMapTexObj(SphereMap *smap, GLuint *texobj); 84 | extern void smapGetViewTexObj(SphereMap *smap, GLuint *texobj); 85 | extern void smapGetViewTexObjs(SphereMap *smap, GLuint texobjs[6]); 86 | 87 | extern void smapSetFlags(SphereMap *smap, SphereMapFlags flags); 88 | extern void smapGetFlags(SphereMap *smap, SphereMapFlags *flags); 89 | 90 | extern void smapSetViewOrigin(SphereMap *smap, GLint x, GLint y); 91 | extern void smapSetSphereMapOrigin(SphereMap *smap, GLint x, GLint y); 92 | extern void smapGetViewOrigin(SphereMap *smap, GLint *x, GLint *y); 93 | extern void smapGetSphereMapOrigin(SphereMap *smap, GLint *x, GLint *y); 94 | 95 | extern void smapSetEye(SphereMap *smap, GLfloat eyex, GLfloat eyey, GLfloat eyez); 96 | extern void smapSetEyeVector(SphereMap *smap, GLfloat *eye); 97 | extern void smapSetUp(SphereMap *smap, GLfloat upx, GLfloat upy, GLfloat upz); 98 | extern void smapSetUpVector(SphereMap *smap, GLfloat *up); 99 | extern void smapSetObject(SphereMap *smap, GLfloat objx, GLfloat objy, GLfloat objz); 100 | extern void smapSetObjectVector(SphereMap *smap, GLfloat *obj); 101 | extern void smapGetEye(SphereMap *smap, GLfloat *eyex, GLfloat *eyey, GLfloat *eyez); 102 | extern void smapGetEyeVector(SphereMap *smap, GLfloat *eye); 103 | extern void smapGetUp(SphereMap *smap, GLfloat *upx, GLfloat *upy, GLfloat *upz); 104 | extern void smapGetUpVector(SphereMap *smap, GLfloat *up); 105 | extern void smapGetObject(SphereMap *smap, GLfloat *objx, GLfloat *objy, GLfloat *objz); 106 | extern void smapGetObjectVector(SphereMap *smap, GLfloat *obj); 107 | 108 | extern void smapSetNearFar(SphereMap *smap, GLfloat viewNear, GLfloat viewFar); 109 | extern void smapGetNearFar(SphereMap *smap, GLfloat *viewNear, GLfloat *viewFar); 110 | 111 | extern void smapSetSphereMapTexDim(SphereMap *smap, GLsizei texdim); 112 | extern void smapSetViewTexDim(SphereMap *smap, GLsizei texdim); 113 | extern void smapGetSphereMapTexDim(SphereMap *smap, GLsizei *texdim); 114 | extern void smapGetViewTexDim(SphereMap *smap, GLsizei *texdim); 115 | 116 | extern void smapSetContextData(SphereMap *smap, void *context); 117 | extern void smapGetContextData(SphereMap *smap, void **context); 118 | 119 | extern void smapSetPositionLightsFunc(SphereMap *smap, void (*positionLights)(int view, void *context)); 120 | extern void smapSetDrawViewFunc(SphereMap *smap, void (*drawView)(int view, void *context)); 121 | extern void smapGetPositionLightsFunc(SphereMap *smap, void (**positionLights)(int view, void *context)); 122 | extern void smapGetDrawViewFunc(SphereMap *smap, void (**drawView)(int view, void *context)); 123 | 124 | extern void smapGenViewTex(SphereMap *smap, int view); 125 | extern void smapGenViewTexs(SphereMap *smap); 126 | extern void smapGenSphereMapFromViewTexs(SphereMap *smap); 127 | extern void smapGenSphereMap(SphereMap *smap); 128 | extern void smapGenSphereMapWithOneViewTex(SphereMap *smap); 129 | 130 | extern int smapRvecToSt(float rvec[3], float st[2]); 131 | extern void smapStToRvec(float *st, float *rvec); 132 | 133 | #ifdef __cplusplus 134 | } 135 | 136 | #endif 137 | #endif /* __glsmap_h__ */ 138 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/glsmapint.h: -------------------------------------------------------------------------------- 1 | #ifndef __glsmapint_h__ 2 | #define __glsmapint_h__ 3 | 4 | /* Copyright (c) Mark J. Kilgard, 1998. */ 5 | 6 | /* This program is freely distributable without licensing fees 7 | and is provided without guarantee or warrantee expressed or 8 | implied. This program is -not- in the public domain. */ 9 | 10 | #include "glsmap.h" 11 | 12 | enum { X = 0, Y = 1, Z = 2 }; 13 | 14 | #define INITFACE(mesh) \ 15 | int steps = mesh->steps; \ 16 | int sqsteps = mesh->steps * mesh->steps 17 | 18 | #define FACE(side,y,x) \ 19 | mesh->face[(side)*sqsteps + (y)*steps + (x)] 20 | 21 | #define FACExy(side,i,j) \ 22 | (&FACE(side,i,j).x) 23 | 24 | #define FACEst(side,i,j) \ 25 | (&FACE(side,i,j).s) 26 | 27 | #define INITBACK(mesh) \ 28 | int allrings = mesh->rings + mesh->edgeExtend; \ 29 | int ringedspokes = allrings * mesh->steps 30 | 31 | #define BACK(edge,ring,spoke) \ 32 | mesh->back[(edge)*ringedspokes + (ring)*mesh->steps + (spoke)] 33 | 34 | #define BACKxy(edge,ring,spoke) \ 35 | (&BACK(edge,ring,spoke).x) 36 | 37 | #define BACKst(edge,ring,spoke) \ 38 | (&BACK(edge,ring,spoke).s) 39 | 40 | typedef struct _STXY { 41 | GLfloat s, t; 42 | GLfloat x, y; 43 | } STXY; 44 | 45 | typedef struct _SphereMapMesh { 46 | 47 | int refcnt; 48 | 49 | int steps; 50 | int rings; 51 | int edgeExtend; 52 | 53 | STXY *face; 54 | STXY *back; 55 | 56 | } SphereMapMesh; 57 | 58 | struct _SphereMap { 59 | 60 | /* Shared sphere map mesh vertex data. */ 61 | SphereMapMesh *mesh; 62 | 63 | /* Texture object ids. */ 64 | GLuint smapTexObj; 65 | GLuint viewTexObjs[6]; 66 | GLuint viewTexObj; 67 | 68 | /* Flags */ 69 | SphereMapFlags flags; 70 | 71 | /* Texture dimensions must be a power of two. */ 72 | int viewTexDim; /* view texture dimension */ 73 | int smapTexDim; /* sphere map texture dimension */ 74 | 75 | /* Viewport origins for view and sphere map rendering. */ 76 | int viewOrigin[2]; 77 | int smapOrigin[2]; 78 | 79 | /* Viewing vectors. */ 80 | GLfloat eye[3]; 81 | GLfloat up[3]; 82 | GLfloat obj[3]; 83 | 84 | /* Projection parameters. */ 85 | GLfloat viewNear; 86 | GLfloat viewFar; 87 | 88 | /* Rendering callbacks. */ 89 | void (*positionLights)(int view, void *context); 90 | void (*drawView)(int view, void *context); 91 | 92 | /* Application specified callback data. */ 93 | void *context; 94 | 95 | }; 96 | 97 | /* Library internal routines. */ 98 | extern void __smapDrawSphereMapMeshSide(SphereMapMesh *mesh, int side); 99 | extern void __smapDrawSphereMapMeshBack(SphereMapMesh *mesh); 100 | extern void __smapValidateSphereMapMesh(SphereMapMesh *mesh); 101 | 102 | #endif /* __glsmapint_h__ */ 103 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/glut.h: -------------------------------------------------------------------------------- 1 | #ifndef __glut_h__ 2 | #define __glut_h__ 3 | 4 | /* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */ 5 | 6 | /* This program is freely distributable without licensing fees and is 7 | provided without guarantee or warrantee expressed or implied. This 8 | program is -not- in the public domain. */ 9 | //#define GLUT_OF_007_HACK 10 | 11 | #if defined(_WIN32) 12 | 13 | /* GLUT 3.7 now tries to avoid including 14 | to avoid name space pollution, but Win32's 15 | needs APIENTRY and WINGDIAPI defined properly. */ 16 | # if 0 17 | # define WIN32_LEAN_AND_MEAN 18 | # include 19 | # else 20 | /* XXX This is from Win32's */ 21 | # ifndef APIENTRY 22 | # define GLUT_APIENTRY_DEFINED 23 | # if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) 24 | # define APIENTRY __stdcall 25 | # else 26 | # define APIENTRY 27 | # endif 28 | # endif 29 | /* XXX This is from Win32's */ 30 | # ifndef CALLBACK 31 | # if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) 32 | # define CALLBACK __stdcall 33 | # else 34 | # define CALLBACK 35 | # endif 36 | # endif 37 | /* XXX This is from Win32's and */ 38 | # ifndef WINGDIAPI 39 | # define GLUT_WINGDIAPI_DEFINED 40 | # define WINGDIAPI __declspec(dllimport) 41 | # endif 42 | /* XXX This is from Win32's */ 43 | # ifndef _WCHAR_T_DEFINED 44 | typedef unsigned short wchar_t; 45 | # define _WCHAR_T_DEFINED 46 | # endif 47 | # endif 48 | 49 | #pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */ 50 | #pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */ 51 | #pragma comment (lib, "glu32.lib") /* link with OpenGL Utility lib */ 52 | #pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */ 53 | 54 | #pragma warning (disable:4244) /* Disable bogus conversion warnings. */ 55 | #pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */ 56 | 57 | #endif 58 | 59 | #if defined(__APPLE__) || defined(MACOSX) 60 | #include 61 | #include 62 | #include 63 | #else 64 | #include 65 | #include 66 | #endif 67 | 68 | /* define APIENTRY and CALLBACK to null string if we aren't on Win32 */ 69 | #if !defined(_WIN32) 70 | #define APIENTRY 71 | #define GLUT_APIENTRY_DEFINED 72 | #define CALLBACK 73 | #endif 74 | 75 | #ifdef __cplusplus 76 | extern "C" { 77 | #endif 78 | 79 | /** 80 | GLUT API revision history: 81 | 82 | GLUT_API_VERSION is updated to reflect incompatible GLUT 83 | API changes (interface changes, semantic changes, deletions, 84 | or additions). 85 | 86 | GLUT_API_VERSION=1 First public release of GLUT. 11/29/94 87 | 88 | GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling, 89 | extension. Supports new input devices like tablet, dial and button 90 | box, and Spaceball. Easy to query OpenGL extensions. 91 | 92 | GLUT_API_VERSION=3 glutMenuStatus added. 93 | 94 | GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer, 95 | glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic 96 | video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc, 97 | glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat, 98 | glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!). 99 | 100 | GLUT_API_VERSION=5 glutGetProcAddress (added by BrianP) 101 | **/ 102 | #ifndef GLUT_API_VERSION /* allow this to be overriden */ 103 | #define GLUT_API_VERSION 5 104 | #endif 105 | 106 | /** 107 | GLUT implementation revision history: 108 | 109 | GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT 110 | API revisions and implementation revisions (ie, bug fixes). 111 | 112 | GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of 113 | GLUT Xlib-based implementation. 11/29/94 114 | 115 | GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of 116 | GLUT Xlib-based implementation providing GLUT version 2 117 | interfaces. 118 | 119 | GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95 120 | 121 | GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95 122 | 123 | GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95 124 | 125 | GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96 126 | 127 | GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner 128 | and video resize. 1/3/97 129 | 130 | GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines. 131 | 132 | GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release. 133 | 134 | GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling. 135 | 136 | GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support. 137 | 138 | GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface. 139 | 140 | GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa 141 | **/ 142 | #ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */ 143 | #define GLUT_XLIB_IMPLEMENTATION 15 144 | #endif 145 | 146 | /** 147 | MacOS X GLUT implementation revision history: 148 | 149 | GLUT_MACOSX_IMPLEMENTATION is updated to reflect MacOS X 150 | specific GLUT API revisions and implementation revisions 151 | (ie, bug fixes). 152 | 153 | GLUT_MACOSX_IMPLEMENTATION=1 glutSurfaceTexture. 154 | 155 | GLUT_MACOSX_IMPLEMENTATION=2 glutWMCloseFunc, glutCheckLoop. 156 | 157 | **/ 158 | #ifndef GLUT_MACOSX_IMPLEMENTATION /* Allow this to be overriden. */ 159 | #define GLUT_MACOSX_IMPLEMENTATION 2 160 | #endif 161 | 162 | /* Display mode bit masks. */ 163 | #define GLUT_RGB 0 164 | #define GLUT_RGBA GLUT_RGB 165 | #define GLUT_INDEX 1 166 | #define GLUT_SINGLE 0 167 | #define GLUT_DOUBLE 2 168 | #define GLUT_ACCUM 4 169 | #define GLUT_ALPHA 8 170 | #define GLUT_DEPTH 16 171 | #define GLUT_STENCIL 32 172 | #if (GLUT_API_VERSION >= 2) 173 | #define GLUT_MULTISAMPLE 128 174 | #define GLUT_STEREO 256 175 | #endif 176 | #if (GLUT_API_VERSION >= 3) 177 | #define GLUT_LUMINANCE 512 178 | #endif 179 | #define GLUT_NO_RECOVERY 1024 180 | 181 | /* Mouse buttons. */ 182 | #define GLUT_LEFT_BUTTON 0 183 | #define GLUT_MIDDLE_BUTTON 1 184 | #define GLUT_RIGHT_BUTTON 2 185 | 186 | /* Mouse button state. */ 187 | #define GLUT_DOWN 0 188 | #define GLUT_UP 1 189 | 190 | #if (GLUT_API_VERSION >= 2) 191 | /* function keys */ 192 | #define GLUT_KEY_F1 1 193 | #define GLUT_KEY_F2 2 194 | #define GLUT_KEY_F3 3 195 | #define GLUT_KEY_F4 4 196 | #define GLUT_KEY_F5 5 197 | #define GLUT_KEY_F6 6 198 | #define GLUT_KEY_F7 7 199 | #define GLUT_KEY_F8 8 200 | #define GLUT_KEY_F9 9 201 | #define GLUT_KEY_F10 10 202 | #define GLUT_KEY_F11 11 203 | #define GLUT_KEY_F12 12 204 | /* directional keys */ 205 | #define GLUT_KEY_LEFT 100 206 | #define GLUT_KEY_UP 101 207 | #define GLUT_KEY_RIGHT 102 208 | #define GLUT_KEY_DOWN 103 209 | #define GLUT_KEY_PAGE_UP 104 210 | #define GLUT_KEY_PAGE_DOWN 105 211 | #define GLUT_KEY_HOME 106 212 | #define GLUT_KEY_END 107 213 | #define GLUT_KEY_INSERT 108 214 | #endif 215 | 216 | /* Entry/exit state. */ 217 | #define GLUT_LEFT 0 218 | #define GLUT_ENTERED 1 219 | 220 | /* Menu usage state. */ 221 | #define GLUT_MENU_NOT_IN_USE 0 222 | #define GLUT_MENU_IN_USE 1 223 | 224 | /* Visibility state. */ 225 | #define GLUT_NOT_VISIBLE 0 226 | #define GLUT_VISIBLE 1 227 | 228 | /* Window status state. */ 229 | #define GLUT_HIDDEN 0 230 | #define GLUT_FULLY_RETAINED 1 231 | #define GLUT_PARTIALLY_RETAINED 2 232 | #define GLUT_FULLY_COVERED 3 233 | 234 | /* Color index component selection values. */ 235 | #define GLUT_RED 0 236 | #define GLUT_GREEN 1 237 | #define GLUT_BLUE 2 238 | 239 | /* Layers for use. */ 240 | #define GLUT_NORMAL 0 241 | #define GLUT_OVERLAY 1 242 | 243 | #if defined(_WIN32) 244 | /* Stroke font constants (use these in GLUT program). */ 245 | #define GLUT_STROKE_ROMAN ((void*)0) 246 | #define GLUT_STROKE_MONO_ROMAN ((void*)1) 247 | 248 | /* Bitmap font constants (use these in GLUT program). */ 249 | #define GLUT_BITMAP_9_BY_15 ((void*)2) 250 | #define GLUT_BITMAP_8_BY_13 ((void*)3) 251 | #define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4) 252 | #define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5) 253 | #if (GLUT_API_VERSION >= 3) 254 | #define GLUT_BITMAP_HELVETICA_10 ((void*)6) 255 | #define GLUT_BITMAP_HELVETICA_12 ((void*)7) 256 | #define GLUT_BITMAP_HELVETICA_18 ((void*)8) 257 | #endif 258 | #else 259 | /* Stroke font opaque addresses (use constants instead in source code). */ 260 | extern void *glutStrokeRoman; 261 | extern void *glutStrokeMonoRoman; 262 | 263 | /* Stroke font constants (use these in GLUT program). */ 264 | #define GLUT_STROKE_ROMAN (&glutStrokeRoman) 265 | #define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman) 266 | 267 | /* Bitmap font opaque addresses (use constants instead in source code). */ 268 | extern void *glutBitmap9By15; 269 | extern void *glutBitmap8By13; 270 | extern void *glutBitmapTimesRoman10; 271 | extern void *glutBitmapTimesRoman24; 272 | extern void *glutBitmapHelvetica10; 273 | extern void *glutBitmapHelvetica12; 274 | extern void *glutBitmapHelvetica18; 275 | 276 | /* Bitmap font constants (use these in GLUT program). */ 277 | #define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15) 278 | #define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13) 279 | #define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10) 280 | #define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24) 281 | #if (GLUT_API_VERSION >= 3) 282 | #define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10) 283 | #define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12) 284 | #define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18) 285 | #endif 286 | #endif 287 | 288 | /* glutGet parameters. */ 289 | #define GLUT_WINDOW_X 100 290 | #define GLUT_WINDOW_Y 101 291 | #define GLUT_WINDOW_WIDTH 102 292 | #define GLUT_WINDOW_HEIGHT 103 293 | #define GLUT_WINDOW_BUFFER_SIZE 104 294 | #define GLUT_WINDOW_STENCIL_SIZE 105 295 | #define GLUT_WINDOW_DEPTH_SIZE 106 296 | #define GLUT_WINDOW_RED_SIZE 107 297 | #define GLUT_WINDOW_GREEN_SIZE 108 298 | #define GLUT_WINDOW_BLUE_SIZE 109 299 | #define GLUT_WINDOW_ALPHA_SIZE 110 300 | #define GLUT_WINDOW_ACCUM_RED_SIZE 111 301 | #define GLUT_WINDOW_ACCUM_GREEN_SIZE 112 302 | #define GLUT_WINDOW_ACCUM_BLUE_SIZE 113 303 | #define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114 304 | #define GLUT_WINDOW_DOUBLEBUFFER 115 305 | #define GLUT_WINDOW_RGBA 116 306 | #define GLUT_WINDOW_PARENT 117 307 | #define GLUT_WINDOW_NUM_CHILDREN 118 308 | #define GLUT_WINDOW_COLORMAP_SIZE 119 309 | #if (GLUT_API_VERSION >= 2) 310 | #define GLUT_WINDOW_NUM_SAMPLES 120 311 | #define GLUT_WINDOW_STEREO 121 312 | #endif 313 | #if (GLUT_API_VERSION >= 3) 314 | #define GLUT_WINDOW_CURSOR 122 315 | #endif 316 | #define GLUT_SCREEN_WIDTH 200 317 | #define GLUT_SCREEN_HEIGHT 201 318 | #define GLUT_SCREEN_WIDTH_MM 202 319 | #define GLUT_SCREEN_HEIGHT_MM 203 320 | #define GLUT_MENU_NUM_ITEMS 300 321 | #define GLUT_DISPLAY_MODE_POSSIBLE 400 322 | #define GLUT_INIT_WINDOW_X 500 323 | #define GLUT_INIT_WINDOW_Y 501 324 | #define GLUT_INIT_WINDOW_WIDTH 502 325 | #define GLUT_INIT_WINDOW_HEIGHT 503 326 | #define GLUT_INIT_DISPLAY_MODE 504 327 | #if (GLUT_API_VERSION >= 2) 328 | #define GLUT_ELAPSED_TIME 700 329 | #endif 330 | #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) 331 | #define GLUT_WINDOW_FORMAT_ID 123 332 | #endif 333 | 334 | #if (GLUT_API_VERSION >= 2) 335 | /* glutDeviceGet parameters. */ 336 | #define GLUT_HAS_KEYBOARD 600 337 | #define GLUT_HAS_MOUSE 601 338 | #define GLUT_HAS_SPACEBALL 602 339 | #define GLUT_HAS_DIAL_AND_BUTTON_BOX 603 340 | #define GLUT_HAS_TABLET 604 341 | #define GLUT_NUM_MOUSE_BUTTONS 605 342 | #define GLUT_NUM_SPACEBALL_BUTTONS 606 343 | #define GLUT_NUM_BUTTON_BOX_BUTTONS 607 344 | #define GLUT_NUM_DIALS 608 345 | #define GLUT_NUM_TABLET_BUTTONS 609 346 | #endif 347 | #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) 348 | #define GLUT_DEVICE_IGNORE_KEY_REPEAT 610 349 | #define GLUT_DEVICE_KEY_REPEAT 611 350 | #define GLUT_HAS_JOYSTICK 612 351 | #define GLUT_OWNS_JOYSTICK 613 352 | #define GLUT_JOYSTICK_BUTTONS 614 353 | #define GLUT_JOYSTICK_AXES 615 354 | #define GLUT_JOYSTICK_POLL_RATE 616 355 | #endif 356 | 357 | #if (GLUT_API_VERSION >= 3) 358 | /* glutLayerGet parameters. */ 359 | #define GLUT_OVERLAY_POSSIBLE 800 360 | #define GLUT_LAYER_IN_USE 801 361 | #define GLUT_HAS_OVERLAY 802 362 | #define GLUT_TRANSPARENT_INDEX 803 363 | #define GLUT_NORMAL_DAMAGED 804 364 | #define GLUT_OVERLAY_DAMAGED 805 365 | 366 | #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) 367 | /* glutVideoResizeGet parameters. */ 368 | #define GLUT_VIDEO_RESIZE_POSSIBLE 900 369 | #define GLUT_VIDEO_RESIZE_IN_USE 901 370 | #define GLUT_VIDEO_RESIZE_X_DELTA 902 371 | #define GLUT_VIDEO_RESIZE_Y_DELTA 903 372 | #define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904 373 | #define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905 374 | #define GLUT_VIDEO_RESIZE_X 906 375 | #define GLUT_VIDEO_RESIZE_Y 907 376 | #define GLUT_VIDEO_RESIZE_WIDTH 908 377 | #define GLUT_VIDEO_RESIZE_HEIGHT 909 378 | #endif 379 | 380 | /* glutUseLayer parameters. */ 381 | #define GLUT_NORMAL 0 382 | #define GLUT_OVERLAY 1 383 | 384 | /* glutGetModifiers return mask. */ 385 | #define GLUT_ACTIVE_SHIFT 1 386 | #define GLUT_ACTIVE_CTRL 2 387 | #define GLUT_ACTIVE_ALT 4 388 | 389 | /* glutSetCursor parameters. */ 390 | /* Basic arrows. */ 391 | #define GLUT_CURSOR_RIGHT_ARROW 0 392 | #define GLUT_CURSOR_LEFT_ARROW 1 393 | /* Symbolic cursor shapes. */ 394 | #define GLUT_CURSOR_INFO 2 395 | #define GLUT_CURSOR_DESTROY 3 396 | #define GLUT_CURSOR_HELP 4 397 | #define GLUT_CURSOR_CYCLE 5 398 | #define GLUT_CURSOR_SPRAY 6 399 | #define GLUT_CURSOR_WAIT 7 400 | #define GLUT_CURSOR_TEXT 8 401 | #define GLUT_CURSOR_CROSSHAIR 9 402 | /* Directional cursors. */ 403 | #define GLUT_CURSOR_UP_DOWN 10 404 | #define GLUT_CURSOR_LEFT_RIGHT 11 405 | /* Sizing cursors. */ 406 | #define GLUT_CURSOR_TOP_SIDE 12 407 | #define GLUT_CURSOR_BOTTOM_SIDE 13 408 | #define GLUT_CURSOR_LEFT_SIDE 14 409 | #define GLUT_CURSOR_RIGHT_SIDE 15 410 | #define GLUT_CURSOR_TOP_LEFT_CORNER 16 411 | #define GLUT_CURSOR_TOP_RIGHT_CORNER 17 412 | #define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18 413 | #define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19 414 | /* Inherit from parent window. */ 415 | #define GLUT_CURSOR_INHERIT 100 416 | /* Blank cursor. */ 417 | #define GLUT_CURSOR_NONE 101 418 | /* Fullscreen crosshair (if available). */ 419 | #define GLUT_CURSOR_FULL_CROSSHAIR 102 420 | #endif 421 | 422 | /* GLUT initialization sub-API. */ 423 | extern void APIENTRY glutInit(int *argcp, char **argv); 424 | extern void APIENTRY glutInitDisplayMode(unsigned int mode); 425 | #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) 426 | extern void APIENTRY glutInitDisplayString(const char *string); 427 | #endif 428 | extern void APIENTRY glutInitWindowPosition(int x, int y); 429 | extern void APIENTRY glutInitWindowSize(int width, int height); 430 | extern void APIENTRY glutMainLoop(void); 431 | 432 | /* GLUT window sub-API. */ 433 | extern int APIENTRY glutCreateWindow(const char *title); 434 | extern int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height); 435 | extern void APIENTRY glutDestroyWindow(int win); 436 | extern void APIENTRY glutPostRedisplay(void); 437 | #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11) 438 | extern void APIENTRY glutPostWindowRedisplay(int win); 439 | #endif 440 | extern void APIENTRY glutSwapBuffers(void); 441 | extern int APIENTRY glutGetWindow(void); 442 | extern void APIENTRY glutSetWindow(int win); 443 | extern void APIENTRY glutSetWindowTitle(const char *title); 444 | extern void APIENTRY glutSetIconTitle(const char *title); 445 | extern void APIENTRY glutPositionWindow(int x, int y); 446 | extern void APIENTRY glutReshapeWindow(int width, int height); 447 | extern void APIENTRY glutPopWindow(void); 448 | extern void APIENTRY glutPushWindow(void); 449 | extern void APIENTRY glutIconifyWindow(void); 450 | extern void APIENTRY glutShowWindow(void); 451 | extern void APIENTRY glutHideWindow(void); 452 | #if (GLUT_API_VERSION >= 3) 453 | extern void APIENTRY glutFullScreen(void); 454 | extern void APIENTRY glutSetCursor(int cursor); 455 | #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) 456 | extern void APIENTRY glutWarpPointer(int x, int y); 457 | #if (GLUT_MACOSX_IMPLEMENTATION >= 1) 458 | /* surface texturing API Mac OS X specific 459 | * Note: 460 | * glutSurfaceTexture has been deprecated, use GL_EXT_framebuffer_object 461 | */ 462 | #ifdef MAC_OS_X_VERSION_10_5 463 | extern void APIENTRY glutSurfaceTexture (GLenum target, GLenum internalformat, int surfacewin); AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 464 | #else 465 | extern void APIENTRY glutSurfaceTexture (GLenum target, GLenum internalformat, int surfacewin); 466 | #endif 467 | #endif 468 | #if (GLUT_MACOSX_IMPLEMENTATION >= 2) 469 | /* Mac OS X specific API */ 470 | extern void APIENTRY glutWMCloseFunc(void (*func)(void)); 471 | extern void APIENTRY glutCheckLoop(void); 472 | #endif 473 | #endif 474 | 475 | /* GLUT overlay sub-API. */ 476 | extern void APIENTRY glutEstablishOverlay(void); 477 | extern void APIENTRY glutRemoveOverlay(void); 478 | extern void APIENTRY glutUseLayer(GLenum layer); 479 | extern void APIENTRY glutPostOverlayRedisplay(void); 480 | #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11) 481 | extern void APIENTRY glutPostWindowOverlayRedisplay(int win); 482 | #endif 483 | extern void APIENTRY glutShowOverlay(void); 484 | extern void APIENTRY glutHideOverlay(void); 485 | #endif 486 | 487 | /* GLUT menu sub-API. */ 488 | extern int APIENTRY glutCreateMenu(void (*)(int)); 489 | extern void APIENTRY glutDestroyMenu(int menu); 490 | extern int APIENTRY glutGetMenu(void); 491 | extern void APIENTRY glutSetMenu(int menu); 492 | extern void APIENTRY glutAddMenuEntry(const char *label, int value); 493 | extern void APIENTRY glutAddSubMenu(const char *label, int submenu); 494 | extern void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value); 495 | extern void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu); 496 | extern void APIENTRY glutRemoveMenuItem(int item); 497 | extern void APIENTRY glutAttachMenu(int button); 498 | extern void APIENTRY glutDetachMenu(int button); 499 | 500 | /* GLUT window callback sub-API. */ 501 | extern void APIENTRY glutDisplayFunc(void (*func)(void)); 502 | extern void APIENTRY glutReshapeFunc(void (*func)(int width, int height)); 503 | extern void APIENTRY glutKeyboardFunc(void (*func)(unsigned char key, int x, int y)); 504 | extern void APIENTRY glutMouseFunc(void (*func)(int button, int state, int x, int y)); 505 | extern void APIENTRY glutMotionFunc(void (*func)(int x, int y)); 506 | extern void APIENTRY glutPassiveMotionFunc(void (*func)(int x, int y)); 507 | extern void APIENTRY glutEntryFunc(void (*func)(int state)); 508 | extern void APIENTRY glutVisibilityFunc(void (*func)(int state)); 509 | extern void APIENTRY glutIdleFunc(void (*func)(void)); 510 | extern void APIENTRY glutTimerFunc(unsigned int millis, void (*func)(int value), int value); 511 | extern void APIENTRY glutMenuStateFunc(void (*func)(int state)); 512 | #if (GLUT_API_VERSION >= 2) 513 | extern void APIENTRY glutSpecialFunc(void (*func)(int key, int x, int y)); 514 | extern void APIENTRY glutSpaceballMotionFunc(void (*func)(int x, int y, int z)); 515 | extern void APIENTRY glutSpaceballRotateFunc(void (*func)(int x, int y, int z)); 516 | extern void APIENTRY glutSpaceballButtonFunc(void (*func)(int button, int state)); 517 | extern void APIENTRY glutButtonBoxFunc(void (*func)(int button, int state)); 518 | extern void APIENTRY glutDialsFunc(void (*func)(int dial, int value)); 519 | extern void APIENTRY glutTabletMotionFunc(void (*func)(int x, int y)); 520 | extern void APIENTRY glutTabletButtonFunc(void (*func)(int button, int state, int x, int y)); 521 | #if (GLUT_API_VERSION >= 3) 522 | extern void APIENTRY glutMenuStatusFunc(void (*func)(int status, int x, int y)); 523 | extern void APIENTRY glutOverlayDisplayFunc(void (*func)(void)); 524 | #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) 525 | extern void APIENTRY glutWindowStatusFunc(void (*func)(int state)); 526 | #endif 527 | #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) 528 | extern void APIENTRY glutKeyboardUpFunc(void (*func)(unsigned char key, int x, int y)); 529 | extern void APIENTRY glutSpecialUpFunc(void (*func)(int key, int x, int y)); 530 | extern void APIENTRY glutJoystickFunc(void (*func)(unsigned int buttonMask, int x, int y, int z), int pollInterval); 531 | //#ifdef GLUT_OF_007_HACK 532 | extern void APIENTRY glutDragEventFunc(void (*func)(char ** fileNames, int nFiles, int dragX, int dragY)); 533 | //#endif 534 | #endif 535 | #endif 536 | #endif 537 | 538 | /* GLUT color index sub-API. */ 539 | extern void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue); 540 | extern GLfloat APIENTRY glutGetColor(int ndx, int component); 541 | extern void APIENTRY glutCopyColormap(int win); 542 | 543 | /* GLUT state retrieval sub-API. */ 544 | extern int APIENTRY glutGet(GLenum type); 545 | extern int APIENTRY glutDeviceGet(GLenum type); 546 | #if (GLUT_API_VERSION >= 2) 547 | /* GLUT extension support sub-API */ 548 | extern int APIENTRY glutExtensionSupported(const char *name); 549 | #endif 550 | #if (GLUT_API_VERSION >= 3) 551 | extern int APIENTRY glutGetModifiers(void); 552 | extern int APIENTRY glutLayerGet(GLenum type); 553 | #endif 554 | #if (GLUT_API_VERSION >= 5) 555 | extern void * APIENTRY glutGetProcAddress(const char *procName); 556 | #endif 557 | 558 | /* GLUT font sub-API */ 559 | extern void APIENTRY glutBitmapCharacter(void *font, int character); 560 | extern int APIENTRY glutBitmapWidth(void *font, int character); 561 | extern void APIENTRY glutStrokeCharacter(void *font, int character); 562 | extern int APIENTRY glutStrokeWidth(void *font, int character); 563 | #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) 564 | extern int APIENTRY glutBitmapLength(void *font, const unsigned char *string); 565 | extern int APIENTRY glutStrokeLength(void *font, const unsigned char *string); 566 | #endif 567 | 568 | /* GLUT pre-built models sub-API */ 569 | extern void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks); 570 | extern void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); 571 | extern void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); 572 | extern void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); 573 | extern void APIENTRY glutWireCube(GLdouble size); 574 | extern void APIENTRY glutSolidCube(GLdouble size); 575 | extern void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); 576 | extern void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); 577 | extern void APIENTRY glutWireDodecahedron(void); 578 | extern void APIENTRY glutSolidDodecahedron(void); 579 | extern void APIENTRY glutWireTeapot(GLdouble size); 580 | extern void APIENTRY glutSolidTeapot(GLdouble size); 581 | extern void APIENTRY glutWireOctahedron(void); 582 | extern void APIENTRY glutSolidOctahedron(void); 583 | extern void APIENTRY glutWireTetrahedron(void); 584 | extern void APIENTRY glutSolidTetrahedron(void); 585 | extern void APIENTRY glutWireIcosahedron(void); 586 | extern void APIENTRY glutSolidIcosahedron(void); 587 | 588 | #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) 589 | /* GLUT video resize sub-API. */ 590 | extern int APIENTRY glutVideoResizeGet(GLenum param); 591 | extern void APIENTRY glutSetupVideoResizing(void); 592 | extern void APIENTRY glutStopVideoResizing(void); 593 | extern void APIENTRY glutVideoResize(int x, int y, int width, int height); 594 | extern void APIENTRY glutVideoPan(int x, int y, int width, int height); 595 | 596 | /* GLUT debugging sub-API. */ 597 | extern void APIENTRY glutReportErrors(void); 598 | #endif 599 | 600 | #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) 601 | /* GLUT device control sub-API. */ 602 | /* glutSetKeyRepeat modes. */ 603 | #define GLUT_KEY_REPEAT_OFF 0 604 | #define GLUT_KEY_REPEAT_ON 1 605 | #define GLUT_KEY_REPEAT_DEFAULT 2 606 | 607 | /* Joystick button masks. */ 608 | #define GLUT_JOYSTICK_BUTTON_A 1 609 | #define GLUT_JOYSTICK_BUTTON_B 2 610 | #define GLUT_JOYSTICK_BUTTON_C 4 611 | #define GLUT_JOYSTICK_BUTTON_D 8 612 | 613 | extern void APIENTRY glutIgnoreKeyRepeat(int ignore); 614 | extern void APIENTRY glutSetKeyRepeat(int repeatMode); 615 | extern void APIENTRY glutForceJoystickFunc(void); 616 | 617 | /* GLUT game mode sub-API. */ 618 | /* glutGameModeGet. */ 619 | #define GLUT_GAME_MODE_ACTIVE 0 620 | #define GLUT_GAME_MODE_POSSIBLE 1 621 | #define GLUT_GAME_MODE_WIDTH 2 622 | #define GLUT_GAME_MODE_HEIGHT 3 623 | #define GLUT_GAME_MODE_PIXEL_DEPTH 4 624 | #define GLUT_GAME_MODE_REFRESH_RATE 5 625 | #define GLUT_GAME_MODE_DISPLAY_CHANGED 6 626 | 627 | extern void APIENTRY glutGameModeString(const char *string); 628 | extern int APIENTRY glutEnterGameMode(void); 629 | extern void APIENTRY glutLeaveGameMode(void); 630 | extern int APIENTRY glutGameModeGet(GLenum mode); 631 | #endif 632 | 633 | #ifdef __cplusplus 634 | } 635 | 636 | #endif 637 | 638 | #ifdef GLUT_APIENTRY_DEFINED 639 | # undef GLUT_APIENTRY_DEFINED 640 | # undef APIENTRY 641 | #endif 642 | 643 | #ifdef GLUT_WINGDIAPI_DEFINED 644 | # undef GLUT_WINGDIAPI_DEFINED 645 | # undef WINGDIAPI 646 | #endif 647 | 648 | #endif /* __glut_h__ */ 649 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/glutbitmap.h: -------------------------------------------------------------------------------- 1 | #ifndef __glutbitmap_h__ 2 | #define __glutbitmap_h__ 3 | 4 | /* Copyright (c) Mark J. Kilgard, 1994. */ 5 | 6 | /* This program is freely distributable without licensing fees 7 | and is provided without guarantee or warrantee expressed or 8 | implied. This program is -not- in the public domain. */ 9 | 10 | #include "glut.h" 11 | 12 | typedef struct { 13 | const GLsizei width; 14 | const GLsizei height; 15 | const GLfloat xorig; 16 | const GLfloat yorig; 17 | const GLfloat advance; 18 | const GLubyte *bitmap; 19 | } BitmapCharRec, *BitmapCharPtr; 20 | 21 | typedef struct { 22 | const char *name; 23 | const int num_chars; 24 | const int first; 25 | const BitmapCharRec * const *ch; 26 | } BitmapFontRec, *BitmapFontPtr; 27 | 28 | typedef void *GLUTbitmapFont; 29 | 30 | #endif /* __glutbitmap_h__ */ 31 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/glutf90.h: -------------------------------------------------------------------------------- 1 | #ifndef __glutf90_h__ 2 | #define __glutf90_h__ 3 | 4 | /* Copyright (c) Mark J. Kilgard & Willam F. Mitchell, 1998. */ 5 | 6 | /* This program is freely distributable without licensing fees 7 | and is provided without guarantee or warrantee expressed or 8 | implied. This program is -not- in the public domain. */ 9 | 10 | /* This header provides the binding interface for William Mitchell's 11 | f90gl Fortran 90 GLUT binding. Other GLUT language bindings 12 | can and should use this interace. */ 13 | 14 | /* I appreciate the guidance from William Mitchell 15 | (mitchell@cam.nist.gov) in developing this friend interface 16 | for use by the f90gl package. See ../../README.fortran */ 17 | 18 | #include 19 | 20 | #ifndef GLUTCALLBACK 21 | #define GLUTCALLBACK 22 | #endif 23 | #ifndef APIENTRY 24 | #define APIENTRY 25 | #endif 26 | 27 | /* Which callback enumerants for the __glutSetFCB/__glutGetFCB routines. */ 28 | /* NOTE These values are part of a binary interface for the f90gl Fortran 29 | 90 binding and so must NOT changes (additions are allowed). */ 30 | 31 | /* GLUTwindow callbacks. */ 32 | #define GLUT_FCB_DISPLAY 0 /* GLUTdisplayFCB */ 33 | #define GLUT_FCB_RESHAPE 1 /* GLUTreshapeFCB */ 34 | #define GLUT_FCB_MOUSE 2 /* GLUTmouseFCB */ 35 | #define GLUT_FCB_MOTION 3 /* GLUTmotionFCB */ 36 | #define GLUT_FCB_PASSIVE 4 /* GLUTpassiveFCB */ 37 | #define GLUT_FCB_ENTRY 5 /* GLUTentryFCB */ 38 | #define GLUT_FCB_KEYBOARD 6 /* GLUTkeyboardFCB */ 39 | #define GLUT_FCB_KEYBOARD_UP 7 /* GLUTkeyboardFCB */ 40 | #define GLUT_FCB_WINDOW_STATUS 8 /* GLUTwindowStatusFCB */ 41 | #define GLUT_FCB_VISIBILITY 9 /* GLUTvisibilityFCB */ 42 | #define GLUT_FCB_SPECIAL 10 /* GLUTspecialFCB */ 43 | #define GLUT_FCB_SPECIAL_UP 11 /* GLUTspecialFCB */ 44 | #define GLUT_FCB_BUTTON_BOX 12 /* GLUTbuttonBoxFCB */ 45 | #define GLUT_FCB_DIALS 13 /* GLUTdialsFCB */ 46 | #define GLUT_FCB_SPACE_MOTION 14 /* GLUTspaceMotionFCB */ 47 | #define GLUT_FCB_SPACE_ROTATE 15 /* GLUTspaceRotateFCB */ 48 | #define GLUT_FCB_SPACE_BUTTON 16 /* GLUTspaceButtonFCB */ 49 | #define GLUT_FCB_TABLET_MOTION 17 /* GLUTtabletMotionFCB */ 50 | #define GLUT_FCB_TABLET_BUTTON 18 /* GLUTtabletButtonFCB */ 51 | #define GLUT_FCB_JOYSTICK 19 /* GLUTjoystickFCB */ 52 | #define GLUT_FCB_WMCLOSE 20 /* GLUTwmcloseFCB */ 53 | /* Non-GLUTwindow callbacks. */ 54 | #define GLUT_FCB_OVERLAY_DISPLAY 100 /* GLUTdisplayFCB */ 55 | #define GLUT_FCB_SELECT 101 /* GLUTselectFCB */ 56 | #define GLUT_FCB_TIMER 102 /* GLUTtimerFCB */ 57 | 58 | /* GLUT Fortran callback function types. */ 59 | typedef void (GLUTCALLBACK *GLUTdisplayFCB) (void); 60 | typedef void (GLUTCALLBACK *GLUTwmcloseFCB) (void); 61 | typedef void (GLUTCALLBACK *GLUTreshapeFCB) (int *, int *); 62 | /* NOTE the pressed key is int, not unsigned char for Fortran! */ 63 | typedef void (GLUTCALLBACK *GLUTkeyboardFCB) (int *, int *, int *); 64 | typedef void (GLUTCALLBACK *GLUTmouseFCB) (int *, int *, int *, int *); 65 | typedef void (GLUTCALLBACK *GLUTmotionFCB) (int *, int *); 66 | typedef void (GLUTCALLBACK *GLUTpassiveFCB) (int *, int *); 67 | typedef void (GLUTCALLBACK *GLUTentryFCB) (int *); 68 | typedef void (GLUTCALLBACK *GLUTwindowStatusFCB) (int *); 69 | typedef void (GLUTCALLBACK *GLUTvisibilityFCB) (int *); 70 | typedef void (GLUTCALLBACK *GLUTspecialFCB) (int *, int *, int *); 71 | typedef void (GLUTCALLBACK *GLUTbuttonBoxFCB) (int *, int *); 72 | typedef void (GLUTCALLBACK *GLUTdialsFCB) (int *, int *); 73 | typedef void (GLUTCALLBACK *GLUTspaceMotionFCB) (int *, int *, int *); 74 | typedef void (GLUTCALLBACK *GLUTspaceRotateFCB) (int *, int *, int *); 75 | typedef void (GLUTCALLBACK *GLUTspaceButtonFCB) (int *, int *); 76 | typedef void (GLUTCALLBACK *GLUTtabletMotionFCB) (int *, int *); 77 | typedef void (GLUTCALLBACK *GLUTtabletButtonFCB) (int *, int *, int *, int *); 78 | typedef void (GLUTCALLBACK *GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z); 79 | 80 | typedef void (GLUTCALLBACK *GLUTselectFCB) (int *); 81 | typedef void (GLUTCALLBACK *GLUTtimerFCB) (int *); 82 | typedef void (GLUTCALLBACK *GLUTmenuStateFCB) (int *); /* DEPRICATED. */ 83 | typedef void (GLUTCALLBACK *GLUTmenuStatusFCB) (int *, int *, int *); 84 | typedef void (GLUTCALLBACK *GLUTidleFCB) (void); 85 | 86 | /* Functions that set and return Fortran callback functions. */ 87 | extern void* APIENTRY __glutGetFCB(int which); 88 | extern void APIENTRY __glutSetFCB(int which, void *func); 89 | 90 | #endif /* __glutf90_h__ */ 91 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/glutstroke.h: -------------------------------------------------------------------------------- 1 | #ifndef __glutstroke_h__ 2 | #define __glutstroke_h__ 3 | 4 | /* Copyright (c) Mark J. Kilgard, 1994. */ 5 | 6 | /* This program is freely distributable without licensing fees 7 | and is provided without guarantee or warrantee expressed or 8 | implied. This program is -not- in the public domain. */ 9 | 10 | #if defined(_WIN32) 11 | #pragma warning (disable:4244) /* disable bogus conversion warnings */ 12 | #pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */ 13 | #endif 14 | 15 | typedef struct { 16 | float x; 17 | float y; 18 | } CoordRec, *CoordPtr; 19 | 20 | typedef struct { 21 | int num_coords; 22 | const CoordRec *coord; 23 | } StrokeRec, *StrokePtr; 24 | 25 | typedef struct { 26 | int num_strokes; 27 | const StrokeRec *stroke; 28 | float center; 29 | float right; 30 | } StrokeCharRec, *StrokeCharPtr; 31 | 32 | typedef struct { 33 | const char *name; 34 | int num_chars; 35 | const StrokeCharRec *ch; 36 | float top; 37 | float bottom; 38 | } StrokeFontRec, *StrokeFontPtr; 39 | 40 | typedef void *GLUTstrokeFont; 41 | 42 | #endif /* __glutstroke_h__ */ 43 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/gutil.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * gutil.h 4 | * 5 | * FUNCTION: 6 | * Provide utilities that allow rotation to occur 7 | * around any axis. 8 | * 9 | * HISTORY: 10 | * created by Linas Vepstas 1990 11 | * added single & double precision, June 1991, Linas Vepstas 12 | */ 13 | 14 | #ifndef __GUTIL_H__ 15 | #define __GUTIL_H__ 16 | 17 | #ifdef __GUTIL_DOUBLE 18 | #define gutDouble double 19 | #else 20 | #define gutDouble float 21 | #endif 22 | 23 | 24 | #ifdef _NO_PROTO /* NO ANSI C PROTOTYPING */ 25 | 26 | /* Rotation Utilities */ 27 | extern void rot_axis_f (); 28 | extern void rot_about_axis_f (); 29 | extern void rot_omega_f (); 30 | extern void urot_axis_f (); 31 | extern void urot_about_axis_f (); 32 | extern void urot_omega_f (); 33 | 34 | /* double-precision versions */ 35 | extern void rot_axis_d (); 36 | extern void rot_about_axis_d (); 37 | extern void rot_omega_d (); 38 | extern void urot_axis_d (); 39 | extern void urot_about_axis_d (); 40 | extern void urot_omega_d (); 41 | 42 | /* viewpoint functions */ 43 | extern void uview_direction_d (); 44 | extern void uview_direction_f (); 45 | extern void uviewpoint_d (); 46 | extern void uviewpoint_f (); 47 | 48 | #else /* _NO_PROTO */ /* ANSI C PROTOTYPING */ 49 | 50 | /* Rotation Utilities */ 51 | extern void rot_axis_f (float omega, float axis[3]); 52 | extern void rot_about_axis_f (float angle, float axis[3]); 53 | extern void rot_omega_f (float axis[3]); 54 | extern void urot_axis_f (float m[4][4], float omega, float axis[3]); 55 | extern void urot_about_axis_f (float m[4][4], float angle, float axis[3]); 56 | extern void urot_omega_f (float m[4][4], float axis[3]); 57 | 58 | /* double-precision versions */ 59 | extern void rot_axis_d (double omega, double axis[3]); 60 | extern void rot_about_axis_d (double angle, double axis[3]); 61 | extern void rot_omega_d (double axis[3]); 62 | extern void urot_axis_d (double m[4][4], double omega, double axis[3]); 63 | extern void urot_about_axis_d (double m[4][4], double angle, double axis[3]); 64 | extern void urot_omega_d (double m[4][4], double axis[3]); 65 | 66 | /* viewpoint functions */ 67 | extern void uview_direction_d (double m[4][4], /* returned */ 68 | double v21[3], /* input */ 69 | double up[3]); /* input */ 70 | 71 | extern void uview_direction_f (float m[4][4], /* returned */ 72 | float v21[3], /* input */ 73 | float up[3]); /* input */ 74 | 75 | extern void uviewpoint_d (double m[4][4], /* returned */ 76 | double v1[3], /* input */ 77 | double v2[3], /* input */ 78 | double up[3]); /* input */ 79 | 80 | extern void uviewpoint_f (float m[4][4], /* returned */ 81 | float v1[3], /* input */ 82 | float v2[3], /* input */ 83 | float up[3]); /* input */ 84 | 85 | #endif /* _NO_PROTO */ 86 | 87 | #endif /* _GUTIL_H__ */ 88 | 89 | /* ------------------- end of file ---------------------- */ 90 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/intersect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FUNCTION: 3 | * This file contains a number of utilities useful to 3D graphics in 4 | * general, and to the generation of tubing and extrusions in particular 5 | * 6 | * HISTORY: 7 | * Written by Linas Vepstas, August 1991 8 | * Updated to correctly handle degenerate cases, Linas, February 1993 9 | */ 10 | 11 | #include 12 | #include "port.h" 13 | #include "vvector.h" 14 | 15 | #define BACKWARDS_INTERSECT (2) 16 | 17 | /* ========================================================== */ 18 | /* 19 | * the Degenerate_Tolerance token represents the greatest amount by 20 | * which different scales in a graphics environment can differ before 21 | * they should be considered "degenerate". That is, when one vector is 22 | * a million times longer than another, changces are that the second will 23 | * be less than a pixel int, and therefore was probably meant to be 24 | * degenerate (by the CAD package, etc.) But what should this tolerance 25 | * be? At least 1 in onethousand (since screen sizes are 1K pixels), but 26 | * les than 1 in 4 million (since this is the limit of single-precision 27 | * floating point accuracy). Of course, if double precision were used, 28 | * then the tolerance could be increased. 29 | * 30 | * Potentially, this naive assumption could cause problems if the CAD 31 | * package attempts to zoom in on small details, and turns out, certain 32 | * points should not hvae been degenerate. The problem presented here 33 | * is that the tolerance could run out before single-precision ran 34 | * out, and so the CAD packages would perceive this as a "bug". 35 | * One alternative is to fiddle around & try to tighten the tolerance. 36 | * However, the right alternative is to code the graphics pipeline in 37 | * double-precision (and tighten the tolerance). 38 | * 39 | * By the way, note that Degernate Tolerance is a "dimensionless" 40 | * quantitiy -- it has no units -- it does not measure feet, inches, 41 | * millimeters or pixels. It is used only in the computations of ratios 42 | * and relative lengths. 43 | */ 44 | 45 | /* 46 | * Right now, the tolerance is set to 2 parts in a million, which 47 | * corresponds to a 19-bit distinction of mantissas. Note that 48 | * single-precsion numbers have 24 bit mantissas. 49 | */ 50 | 51 | #define DEGENERATE_TOLERANCE (0.000002) 52 | 53 | /* ========================================================== */ 54 | /* 55 | * The macro and subroutine INTERSECT are designed to compute the 56 | * intersection of a line (defined by the points v1 and v2) and a plane 57 | * (defined as plane which is normal to the vector n, and contains the 58 | * point p). Both return the point sect, which is the point of 59 | * interesection. 60 | * 61 | * This MACRO attemps to be fairly robust by checking for a divide by 62 | * zero. 63 | */ 64 | 65 | /* ========================================================== */ 66 | /* 67 | * HACK ALERT 68 | * The intersection parameter t has the nice property that if t>1, 69 | * then the intersection is "in front of" p1, and if t<0, then the 70 | * intersection is "behind" p2. Unfortunately, as the intersecting plane 71 | * and the line become parallel, t wraps through infinity -- i.e. t can 72 | * become so large that t becomes "greater than infinity" and comes back 73 | * as a negative number (i.e. winding number hopped by one unit). We 74 | * have no way of detecting this situation without adding gazzillions 75 | * of lines of code of topological algebra to detect the winding number; 76 | * and this would be incredibly difficult, and ruin performance. 77 | * 78 | * Thus, we've installed a cheap hack for use by the "cut style" drawing 79 | * routines. If t proves to be a large negative number (more negative 80 | * than -5), then we assume that t was positive and wound through 81 | * infinity. This makes most cuts look good, without introducing bogus 82 | * cuts at infinity. 83 | */ 84 | /* ========================================================== */ 85 | 86 | #define INTERSECT(sect,p,n,v1,v2) \ 87 | { \ 88 | gleDouble deno, numer, t, omt; \ 89 | \ 90 | deno = (v1[0] - v2[0]) * n[0]; \ 91 | deno += (v1[1] - v2[1]) * n[1]; \ 92 | deno += (v1[2] - v2[2]) * n[2]; \ 93 | \ 94 | if (deno == 0.0) { \ 95 | VEC_COPY (n, v1); \ 96 | /* printf ("Intersect: Warning: line is coplanar with plane \n"); */ \ 97 | } else { \ 98 | \ 99 | numer = (p[0] - v2[0]) * n[0]; \ 100 | numer += (p[1] - v2[1]) * n[1]; \ 101 | numer += (p[2] - v2[2]) * n[2]; \ 102 | \ 103 | t = numer / deno; \ 104 | omt = 1.0 - t; \ 105 | \ 106 | sect[0] = t * v1[0] + omt * v2[0]; \ 107 | sect[1] = t * v1[1] + omt * v2[1]; \ 108 | sect[2] = t * v1[2] + omt * v2[2]; \ 109 | } \ 110 | } 111 | 112 | /* ========================================================== */ 113 | /* 114 | * The macro and subroutine BISECTING_PLANE compute a normal vector that 115 | * describes the bisecting plane between three points (v1, v2 and v3). 116 | * This bisecting plane has the following properties: 117 | * 1) it contains the point v2 118 | * 2) the angle it makes with v21 == v2 - v1 is equal to the angle it 119 | * makes with v32 == v3 - v2 120 | * 3) it is perpendicular to the plane defined by v1, v2, v3. 121 | * 122 | * Having input v1, v2, and v3, it returns a unit vector n. 123 | * 124 | * In some cases, the user may specify degenerate points, and still 125 | * expect "reasonable" or "obvious" behaviour. The "expected" 126 | * behaviour for these degenerate cases is: 127 | * 128 | * 1) if v1 == v2 == v3, then return n=0 129 | * 2) if v1 == v2, then return v32 (normalized). 130 | * 3) if v2 == v3, then return v21 (normalized). 131 | * 4) if v1, v2 and v3 co-linear, then return v21 (normalized). 132 | * 133 | * Mathematically, these special cases "make sense" -- we just have to 134 | * code around potential divide-by-zero's in the code below. 135 | */ 136 | 137 | /* ========================================================== */ 138 | 139 | #define BISECTING_PLANE(valid,n,v1,v2,v3) \ 140 | { \ 141 | double v21[3], v32[3]; \ 142 | double len21, len32; \ 143 | double vdot; \ 144 | \ 145 | VEC_DIFF (v21, v2, v1); \ 146 | VEC_DIFF (v32, v3, v2); \ 147 | \ 148 | VEC_LENGTH (len21, v21); \ 149 | VEC_LENGTH (len32, v32); \ 150 | \ 151 | if (len21 <= DEGENERATE_TOLERANCE * len32) { \ 152 | \ 153 | if (len32 == 0.0) { \ 154 | /* all three points lie ontop of one-another */ \ 155 | VEC_ZERO (n); \ 156 | valid = FALSE; \ 157 | } else { \ 158 | /* return a normalized copy of v32 as bisector */ \ 159 | len32 = 1.0 / len32; \ 160 | VEC_SCALE (n, len32, v32); \ 161 | valid = TRUE; \ 162 | } \ 163 | \ 164 | } else { \ 165 | \ 166 | valid = TRUE; \ 167 | \ 168 | if (len32 <= DEGENERATE_TOLERANCE * len21) { \ 169 | /* return a normalized copy of v21 as bisector */ \ 170 | len21 = 1.0 / len21; \ 171 | VEC_SCALE (n, len21, v21); \ 172 | \ 173 | } else { \ 174 | \ 175 | /* normalize v21 to be of unit length */ \ 176 | len21 = 1.0 / len21; \ 177 | VEC_SCALE (v21, len21, v21); \ 178 | \ 179 | /* normalize v32 to be of unit length */ \ 180 | len32 = 1.0 / len32; \ 181 | VEC_SCALE (v32, len32, v32); \ 182 | \ 183 | VEC_DOT_PRODUCT (vdot, v32, v21); \ 184 | \ 185 | /* if vdot == 1 or -1, then points are colinear */ \ 186 | if ((vdot >= (1.0-DEGENERATE_TOLERANCE)) || \ 187 | (vdot <= (-1.0+DEGENERATE_TOLERANCE))) { \ 188 | VEC_COPY (n, v21); \ 189 | } else { \ 190 | \ 191 | /* go do the full computation */ \ 192 | n[0] = vdot * (v32[0] + v21[0]) - v32[0] - v21[0]; \ 193 | n[1] = vdot * (v32[1] + v21[1]) - v32[1] - v21[1]; \ 194 | n[2] = vdot * (v32[2] + v21[2]) - v32[2] - v21[2]; \ 195 | \ 196 | /* if above if-test's passed, \ 197 | * n should NEVER be of zero length */ \ 198 | VEC_NORMALIZE (n); \ 199 | } \ 200 | } \ 201 | } \ 202 | } 203 | 204 | /* ========================================================== */ 205 | /* 206 | * The block of code below is ifdef'd out, and is here for reference 207 | * purposes only. It performs the "mathematically right thing" for 208 | * computing a bisecting plane, but is, unfortunately, subject ot noise 209 | * in the presence of near degenerate points. Since computer graphics, 210 | * due to sloppy coding, laziness, or correctness, is filled with 211 | * degenerate points, we can't really use this version. The code above 212 | * is far more appropriate for graphics. 213 | */ 214 | 215 | #ifdef MATHEMATICALLY_EXACT_GRAPHICALLY_A_KILLER 216 | #define BISECTING_PLANE(n,v1,v2,v3) \ 217 | { \ 218 | double v21[3], v32[3]; \ 219 | double len21, len32; \ 220 | double vdot; \ 221 | \ 222 | VEC_DIFF (v21, v2, v1); \ 223 | VEC_DIFF (v32, v3, v2); \ 224 | \ 225 | VEC_LENGTH (len21, v21); \ 226 | VEC_LENGTH (len32, v32); \ 227 | \ 228 | if (len21 == 0.0) { \ 229 | \ 230 | if (len32 == 0.0) { \ 231 | /* all three points lie ontop of one-another */ \ 232 | VEC_ZERO (n); \ 233 | valid = FALSE; \ 234 | } else { \ 235 | /* return a normalized copy of v32 as bisector */ \ 236 | len32 = 1.0 / len32; \ 237 | VEC_SCALE (n, len32, v32); \ 238 | } \ 239 | \ 240 | } else { \ 241 | \ 242 | /* normalize v21 to be of unit length */ \ 243 | len21 = 1.0 / len21; \ 244 | VEC_SCALE (v21, len21, v21); \ 245 | \ 246 | if (len32 == 0.0) { \ 247 | /* return a normalized copy of v21 as bisector */ \ 248 | VEC_COPY (n, v21); \ 249 | } else { \ 250 | \ 251 | /* normalize v32 to be of unit length */ \ 252 | len32 = 1.0 / len32; \ 253 | VEC_SCALE (v32, len32, v32); \ 254 | \ 255 | VEC_DOT_PRODUCT (vdot, v32, v21); \ 256 | \ 257 | /* if vdot == 1 or -1, then points are colinear */ \ 258 | if ((vdot == 1.0) || (vdot == -1.0)) { \ 259 | VEC_COPY (n, v21); \ 260 | } else { \ 261 | \ 262 | /* go do the full computation */ \ 263 | n[0] = vdot * (v32[0] + v21[0]) - v32[0] - v21[0]; \ 264 | n[1] = vdot * (v32[1] + v21[1]) - v32[1] - v21[1]; \ 265 | n[2] = vdot * (v32[2] + v21[2]) - v32[2] - v21[2]; \ 266 | \ 267 | /* if above if-test's passed, \ 268 | * n should NEVER be of zero length */ \ 269 | VEC_NORMALIZE (n); \ 270 | } \ 271 | } \ 272 | } \ 273 | } 274 | #endif 275 | 276 | /* ========================================================== */ 277 | /* 278 | * This macro computes the plane perpendicular to the the plane 279 | * defined by three points, and whose normal vector is givven as the 280 | * difference between the two vectors ... 281 | * 282 | * (See way below for the "math" model if you want to understand this. 283 | * The comments about relative errors above apply here.) 284 | */ 285 | 286 | #define CUTTING_PLANE(valid,n,v1,v2,v3) \ 287 | { \ 288 | double v21[3], v32[3]; \ 289 | double len21, len32; \ 290 | double lendiff; \ 291 | \ 292 | VEC_DIFF (v21, v2, v1); \ 293 | VEC_DIFF (v32, v3, v2); \ 294 | \ 295 | VEC_LENGTH (len21, v21); \ 296 | VEC_LENGTH (len32, v32); \ 297 | \ 298 | if (len21 <= DEGENERATE_TOLERANCE * len32) { \ 299 | \ 300 | if (len32 == 0.0) { \ 301 | /* all three points lie ontop of one-another */ \ 302 | VEC_ZERO (n); \ 303 | valid = FALSE; \ 304 | } else { \ 305 | /* return a normalized copy of v32 as cut-vector */ \ 306 | len32 = 1.0 / len32; \ 307 | VEC_SCALE (n, len32, v32); \ 308 | valid = TRUE; \ 309 | } \ 310 | \ 311 | } else { \ 312 | \ 313 | valid = TRUE; \ 314 | \ 315 | if (len32 <= DEGENERATE_TOLERANCE * len21) { \ 316 | /* return a normalized copy of v21 as cut vector */ \ 317 | len21 = 1.0 / len21; \ 318 | VEC_SCALE (n, len21, v21); \ 319 | } else { \ 320 | \ 321 | /* normalize v21 to be of unit length */ \ 322 | len21 = 1.0 / len21; \ 323 | VEC_SCALE (v21, len21, v21); \ 324 | \ 325 | /* normalize v32 to be of unit length */ \ 326 | len32 = 1.0 / len32; \ 327 | VEC_SCALE (v32, len32, v32); \ 328 | \ 329 | VEC_DIFF (n, v21, v32); \ 330 | VEC_LENGTH (lendiff, n); \ 331 | \ 332 | /* if the perp vector is very small, then the two \ 333 | * vectors are darn near collinear, and the cut \ 334 | * vector is probably poorly defined. */ \ 335 | if (lendiff < DEGENERATE_TOLERANCE) { \ 336 | VEC_ZERO (n); \ 337 | valid = FALSE; \ 338 | } else { \ 339 | lendiff = 1.0 / lendiff; \ 340 | VEC_SCALE (n, lendiff, n); \ 341 | } \ 342 | } \ 343 | } \ 344 | } 345 | 346 | /* ========================================================== */ 347 | 348 | #ifdef MATHEMATICALLY_EXACT_GRAPHICALLY_A_KILLER 349 | #define CUTTING_PLANE(n,v1,v2,v3) \ 350 | { \ 351 | double v21[3], v32[3]; \ 352 | \ 353 | VEC_DIFF (v21, v2, v1); \ 354 | VEC_DIFF (v32, v3, v2); \ 355 | \ 356 | VEC_NORMALIZE (v21); \ 357 | VEC_NORMALIZE (v32); \ 358 | \ 359 | VEC_DIFF (n, v21, v32); \ 360 | VEC_NORMALIZE (n); \ 361 | } 362 | #endif 363 | 364 | 365 | /* ============================================================ */ 366 | /* This macro is used in several places to cycle through a series of 367 | * points to find the next non-degenerate point in a series */ 368 | 369 | #define FIND_NON_DEGENERATE_POINT(inext,npoints,len,diff,point_array) \ 370 | { \ 371 | gleDouble slen; \ 372 | gleDouble summa[3]; \ 373 | \ 374 | do { \ 375 | /* get distance to next point */ \ 376 | VEC_DIFF (diff, point_array[inext+1], point_array[inext]); \ 377 | VEC_LENGTH (len, diff); \ 378 | VEC_SUM (summa, point_array[inext+1], point_array[inext]); \ 379 | VEC_LENGTH (slen, summa); \ 380 | slen *= DEGENERATE_TOLERANCE; \ 381 | inext ++; \ 382 | } while ((len <= slen) && (inext < npoints-1)); \ 383 | } 384 | 385 | /* ========================================================== */ 386 | 387 | extern int bisecting_plane (gleDouble n[3], /* returned */ 388 | gleDouble v1[3], /* input */ 389 | gleDouble v2[3], /* input */ 390 | gleDouble v3[3]); /* input */ 391 | 392 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/port.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * port.h 4 | * 5 | * FUNCTION: 6 | * This file contains defines for porting the tubing toolkit from GL to 7 | * OpenGL to some callback scheme. 8 | * 9 | * HISTORY: 10 | * Created by Linas Vepstas -- February 1993 11 | * Added auto texture coord generation hacks, Linas April 1994 12 | */ 13 | 14 | #ifndef __GLE_PORT_H__ 15 | #define __GLE_PORT_H__ 16 | 17 | 18 | #ifndef TRUE 19 | #define TRUE 1 20 | #endif 21 | 22 | #ifndef FALSE 23 | #define FALSE 0 24 | #endif 25 | 26 | #ifndef M_PI 27 | #define M_PI 3.14159265358979323846 28 | #endif 29 | 30 | /* ====================================================== */ 31 | /* Some compilers can't handle multiply-subscripted array's */ 32 | 33 | #ifdef FUNKY_C 34 | typedef gleDouble gleVector; 35 | #define AVAL(arr,n,i,j) arr(6*n+3*i+j) 36 | #define VVAL(arr,n,i) arr(3*n+i) 37 | 38 | #else /* FUNKY_C */ 39 | typedef double gleVector[3]; 40 | typedef double glePoint[2]; 41 | #define AVAL(arr,n,i,j) arr[n][i][j] 42 | #define VVAL(arr,n,i) arr[n][i]; 43 | 44 | #endif /* FUNKY_C */ 45 | 46 | /* ====================================================== */ 47 | /* These are used to convey info about topography to the 48 | * texture mapping routines */ 49 | 50 | #define FRONT 1 51 | #define BACK 2 52 | #define FRONT_CAP 3 53 | #define BACK_CAP 4 54 | #define FILLET 5 55 | 56 | /* ====================================================== */ 57 | 58 | #define __GLE_DOUBLE 59 | 60 | /* ====================================================== */ 61 | 62 | #ifdef __GLE_DOUBLE 63 | #ifndef gleDouble 64 | #define gleDouble double 65 | #endif 66 | #define urot_axis(a,b,c) urot_axis_d(a,b,c) 67 | #define uview_direction(a,b,c) uview_direction_d(a,b,c) 68 | #define uviewpoint(a,b,c,d) uviewpoint_d(a,b,c,d) 69 | #define MULTMATRIX(m) MULTMATRIX_D(m) 70 | #define LOADMATRIX(m) LOADMATRIX_D(m) 71 | #define V3F(x,j,id) V3F_D(x,j,id) 72 | #define N3F(x) N3F_D(x) 73 | #define T2F(x,y) T2F_D(x,y) 74 | #else 75 | #define gleDouble float 76 | #define urot_axis(a,b,c) urot_axis_f(a,b,c) 77 | #define uview_direction(a,b,c) uview_direction_f(a,b,c) 78 | #define uviewpoint(a,b,c,d) uviewpoint_f(a,b,c,d) 79 | #define MULTMATRIX(m) MULTMATRIX_F(m) 80 | #define LOADMATRIX(m) LOADMATRIX_F(m) 81 | #define V3F(x,j,id) V3F_F(x,j,id) 82 | #define N3F(x) N3F_F(x) 83 | #define T2F(x,y) T2F_F(x,y) 84 | #endif 85 | 86 | /* ====================================================== */ 87 | 88 | #if (defined DEBUG_GL_32 || DEBUG_OPENGL_10) 89 | #undef GL_32 90 | #undef OPENGL_10 91 | 92 | #define BGNTMESH(i,len) printf ("bgntmesh() \n"); 93 | #define ENDTMESH() printf ("endtmesh() \n"); 94 | #define BGNPOLYGON() printf ("bgnpolygon() \n"); 95 | #define ENDPOLYGON() printf ("endpolygon() \n"); 96 | #define V3F_F(x,j,id) printf ("v3f(x) %f %f %f \n", x[0], x[1], x[2]); 97 | #define V3F_D(x,j,id) printf ("v3d(x) %f %f %f \n", x[0], x[1], x[2]); 98 | #define N3F_F(x) printf ("n3f(x) %f %f %f \n", x[0], x[1], x[2]); 99 | #define N3F_D(x) printf ("n3d(x) %f %f %f \n", x[0], x[1], x[2]); 100 | #define C3F(x) printf ("c3f(x) %f %f %f \n", x[0], x[1], x[2]); 101 | 102 | #define POPMATRIX() printf ("popmatrix () \n"); 103 | #define PUSHMATRIX() printf ("pushmatrix() \n"); 104 | #define MULTMATRIX_F(x) MULTMATRIX_D(x) 105 | #define LOADMATRIX_F(x) LOADMATRIX_D(x) 106 | 107 | 108 | #define LOADMATRIX_D(x) { \ 109 | int i, j; \ 110 | printf ("loadmatrix (x) \n"); \ 111 | for (i=0; i<4; i++) { \ 112 | for (j=0; j<4; j++) { \ 113 | printf ( "%f ", x[i][j]); \ 114 | } \ 115 | printf (" \n"); \ 116 | } \ 117 | } 118 | 119 | #define MULTMATRIX_D(x) { \ 120 | int i, j; \ 121 | printf ("multmatrix (x) \n"); \ 122 | for (i=0; i<4; i++) { \ 123 | for (j=0; j<4; j++) { \ 124 | printf ( "%f ", x[i][j]); \ 125 | } \ 126 | printf (" \n"); \ 127 | } \ 128 | } 129 | 130 | #define __IS_LIGHTING_ON (1) 131 | 132 | #endif 133 | 134 | /* ====================================================== */ 135 | 136 | #ifdef GL_32 137 | 138 | #include 139 | 140 | #define BGNTMESH(i,len) bgntmesh() 141 | #define ENDTMESH() endtmesh() 142 | #define BGNPOLYGON() bgnpolygon() 143 | #define ENDPOLYGON() endpolygon() 144 | #define V3F_F(x,j,id) v3f(x) 145 | #define V3F_D(x,j,id) v3d(x) 146 | #define N3F_F(x) n3f(x) 147 | #define T2F_F(x,y) 148 | #define T2F_D(x,y) 149 | #define C3F(x) c3f(x) 150 | 151 | #define POPMATRIX() popmatrix () 152 | #define PUSHMATRIX() pushmatrix() 153 | #define MULTMATRIX_F(x) multmatrix (x) 154 | #define LOADMATRIX_F(x) loadmatrix (x) 155 | 156 | #define N3F_D(x) { \ 157 | float nnn[3]; \ 158 | nnn[0] = (float) x[0]; \ 159 | nnn[1] = (float) x[1]; \ 160 | nnn[2] = (float) x[2]; \ 161 | n3f (nnn); \ 162 | } 163 | 164 | #define LOADMATRIX_D(x) { \ 165 | int i, j; \ 166 | float mmm[4][4]; \ 167 | for (i=0; i<4; i++) { \ 168 | for (j=0; j<4; j++) { \ 169 | mmm[i][j] = (float) x[i][j]; \ 170 | } \ 171 | } \ 172 | loadmatrix(mmm); \ 173 | } 174 | 175 | #define MULTMATRIX_D(x) { \ 176 | int i, j; \ 177 | float mmm[4][4]; \ 178 | for (i=0; i<4; i++) { \ 179 | for (j=0; j<4; j++) { \ 180 | mmm[i][j] = (float) x[i][j]; \ 181 | } \ 182 | } \ 183 | multmatrix(mmm); \ 184 | } 185 | 186 | /* #define __IS_LIGHTING_ON (MSINGLE == getmmode()) */ 187 | #define __IS_LIGHTING_ON (extrusion_join_style & TUBE_LIGHTING_ON) 188 | 189 | #endif /* GL_32 */ 190 | 191 | /* ====================================================== */ 192 | #ifdef OPENGL_10 193 | 194 | #if defined(_WIN32) 195 | #include 196 | #pragma warning (disable:4244) /* disable bogus conversion warnings */ 197 | #endif 198 | #include 199 | #include 200 | 201 | /* 202 | #define N3F_F(x) { \ 203 | float nnn[3]; \ 204 | nnn[0] = - (float) x[0]; \ 205 | nnn[1] = - (float) x[1]; \ 206 | nnn[2] = - (float) x[2]; \ 207 | glNormal3fv (nnn); \ 208 | } 209 | #define N3F_D(x) { \ 210 | float nnn[3]; \ 211 | nnn[0] = - (float) x[0]; \ 212 | nnn[1] = - (float) x[1]; \ 213 | nnn[2] = - (float) x[2]; \ 214 | glNormal3fv (nnn); \ 215 | } 216 | */ 217 | 218 | #define C3F(x) glColor3fv(x) 219 | #define T2F_F(x,y) glTexCoord2f(x,y) 220 | #define T2F_D(x,y) glTexCoord2d(x,y) 221 | 222 | #define POPMATRIX() glPopMatrix() 223 | #define PUSHMATRIX() glPushMatrix() 224 | 225 | #define MULTMATRIX_F(x) glMultMatrixf ((const GLfloat *)x) 226 | #define LOADMATRIX_F(x) glLoadMatrixf ((const GLfloat *)x) 227 | 228 | #define MULTMATRIX_D(x) glMultMatrixd ((const GLdouble *)x) 229 | #define LOADMATRIX_D(x) glLoadMatrixd ((const GLdouble *)x) 230 | 231 | #define __IS_LIGHTING_ON (glIsEnabled(GL_LIGHTING)) 232 | 233 | /* ====================================================== */ 234 | #ifdef AUTO_TEXTURE 235 | 236 | #define BGNTMESH(i,len) { \ 237 | if(_gle_gc -> bgn_gen_texture) (*(_gle_gc -> bgn_gen_texture))(i,len);\ 238 | glBegin (GL_TRIANGLE_STRIP); \ 239 | } 240 | 241 | #define BGNPOLYGON() { \ 242 | if(_gle_gc -> bgn_gen_texture) (*(_gle_gc -> bgn_gen_texture))();\ 243 | glBegin (GL_POLYGON); \ 244 | } 245 | 246 | #define N3F_F(x) { \ 247 | if(_gle_gc -> n3f_gen_texture) (*(_gle_gc -> n3f_gen_texture))(x); \ 248 | glNormal3fv(x); \ 249 | } 250 | 251 | #define N3F_D(x) { \ 252 | if(_gle_gc -> n3d_gen_texture) (*(_gle_gc -> n3d_gen_texture))(x); \ 253 | glNormal3dv(x); \ 254 | } 255 | 256 | #define V3F_F(x,j,id) { \ 257 | if(_gle_gc -> v3f_gen_texture) (*(_gle_gc -> v3f_gen_texture))(x,j,id);\ 258 | glVertex3fv(x); \ 259 | } 260 | 261 | #define V3F_D(x,j,id) { \ 262 | if(_gle_gc -> v3d_gen_texture) (*(_gle_gc -> v3d_gen_texture))(x,j,id); \ 263 | glVertex3dv(x); \ 264 | } 265 | 266 | #define ENDTMESH() { \ 267 | if(_gle_gc -> end_gen_texture) (*(_gle_gc -> end_gen_texture))(); \ 268 | glEnd (); \ 269 | } 270 | 271 | #define ENDPOLYGON() { \ 272 | if(_gle_gc -> end_gen_texture) (*(_gle_gc -> end_gen_texture))(); \ 273 | glEnd (); \ 274 | } 275 | 276 | /* ====================================================== */ 277 | #else /* AUTO_TEXTURE */ 278 | 279 | #define BGNTMESH(i,len) glBegin (GL_TRIANGLE_STRIP); 280 | #define BGNPOLYGON() glBegin (GL_POLYGON); 281 | 282 | #define N3F_F(x) glNormal3fv(x) 283 | #define N3F_D(x) glNormal3dv(x) 284 | #define V3F_F(x,j,id) glVertex3fv(x); 285 | #define V3F_D(x,j,id) glVertex3dv(x); 286 | 287 | #define ENDTMESH() glEnd () 288 | #define ENDPOLYGON() glEnd() 289 | 290 | #endif /* AUTO_TEXTURE */ 291 | 292 | #endif /* OPENGL_10 */ 293 | 294 | /* ====================================================== */ 295 | 296 | 297 | #endif /* __GLE_PORT_H__ */ 298 | /* ================== END OF FILE ======================= */ 299 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/rot.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * rot.h 4 | * 5 | * FUNCTION: 6 | * rotation matrix utilities 7 | * 8 | * HISTORY: 9 | * Linas Vepstas Aug 1990 10 | */ 11 | 12 | /* ========================================================== */ 13 | /* 14 | * The MACROS below generate and return more traditional rotation 15 | * matrices -- matrices for rotations about principal axes. 16 | */ 17 | /* ========================================================== */ 18 | 19 | #define ROTX_CS(m,cosine,sine) \ 20 | { \ 21 | /* rotation about the x-axis */ \ 22 | \ 23 | m[0][0] = 1.0; \ 24 | m[0][1] = 0.0; \ 25 | m[0][2] = 0.0; \ 26 | m[0][3] = 0.0; \ 27 | \ 28 | m[1][0] = 0.0; \ 29 | m[1][1] = (cosine); \ 30 | m[1][2] = (sine); \ 31 | m[1][3] = 0.0; \ 32 | \ 33 | m[2][0] = 0.0; \ 34 | m[2][1] = -(sine); \ 35 | m[2][2] = (cosine); \ 36 | m[2][3] = 0.0; \ 37 | \ 38 | m[3][0] = 0.0; \ 39 | m[3][1] = 0.0; \ 40 | m[3][2] = 0.0; \ 41 | m[3][3] = 1.0; \ 42 | } 43 | 44 | /* ========================================================== */ 45 | 46 | #define ROTY_CS(m,cosine,sine) \ 47 | { \ 48 | /* rotation about the y-axis */ \ 49 | \ 50 | m[0][0] = (cosine); \ 51 | m[0][1] = 0.0; \ 52 | m[0][2] = -(sine); \ 53 | m[0][3] = 0.0; \ 54 | \ 55 | m[1][0] = 0.0; \ 56 | m[1][1] = 1.0; \ 57 | m[1][2] = 0.0; \ 58 | m[1][3] = 0.0; \ 59 | \ 60 | m[2][0] = (sine); \ 61 | m[2][1] = 0.0; \ 62 | m[2][2] = (cosine); \ 63 | m[2][3] = 0.0; \ 64 | \ 65 | m[3][0] = 0.0; \ 66 | m[3][1] = 0.0; \ 67 | m[3][2] = 0.0; \ 68 | m[3][3] = 1.0; \ 69 | } 70 | 71 | /* ========================================================== */ 72 | 73 | #define ROTZ_CS(m,cosine,sine) \ 74 | { \ 75 | /* rotation about the z-axis */ \ 76 | \ 77 | m[0][0] = (cosine); \ 78 | m[0][1] = (sine); \ 79 | m[0][2] = 0.0; \ 80 | m[0][3] = 0.0; \ 81 | \ 82 | m[1][0] = -(sine); \ 83 | m[1][1] = (cosine); \ 84 | m[1][2] = 0.0; \ 85 | m[1][3] = 0.0; \ 86 | \ 87 | m[2][0] = 0.0; \ 88 | m[2][1] = 0.0; \ 89 | m[2][2] = 1.0; \ 90 | m[2][3] = 0.0; \ 91 | \ 92 | m[3][0] = 0.0; \ 93 | m[3][1] = 0.0; \ 94 | m[3][2] = 0.0; \ 95 | m[3][3] = 1.0; \ 96 | } 97 | 98 | /* ========================================================== */ 99 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/segment.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * MODULE: segment.h 4 | * 5 | * FUNCTION: 6 | * Contains function prototypes for segment drawing subroutines. 7 | * These are used only internally, and are not to be exported to 8 | * the user. 9 | * 10 | * HISTORY: 11 | * Create by Linas Vepstas 12 | * Added tube.h include to define gleDouble, tad February 2002 13 | */ 14 | 15 | /* ============================================================ */ 16 | 17 | #include "tube.h" 18 | 19 | extern void draw_segment_plain (int ncp, /* number of contour points */ 20 | gleDouble front_contour[][3], 21 | gleDouble back_contour[][3], 22 | int inext, double len); 23 | 24 | extern void draw_segment_color (int ncp, /* number of contour points */ 25 | gleDouble front_contour[][3], 26 | gleDouble back_contour[][3], 27 | float color_last[3], 28 | float color_next[3], 29 | int inext, double len); 30 | 31 | extern void draw_segment_edge_n (int ncp, /* number of contour points */ 32 | gleDouble front_contour[][3], 33 | gleDouble back_contour[][3], 34 | double norm_cont[][3], 35 | int inext, double len); 36 | 37 | extern void draw_segment_c_and_edge_n (int ncp, 38 | gleDouble front_contour[][3], 39 | gleDouble back_contour[][3], 40 | double norm_cont[][3], 41 | float color_last[3], 42 | float color_next[3], 43 | int inext, double len); 44 | 45 | extern void draw_segment_facet_n (int ncp, 46 | gleDouble front_contour[][3], 47 | gleDouble back_contour[][3], 48 | double norm_cont[][3], 49 | int inext, double len); 50 | 51 | extern void draw_segment_c_and_facet_n (int ncp, 52 | gleDouble front_contour[][3], 53 | gleDouble back_contour[][3], 54 | double norm_cont[][3], 55 | float color_last[3], 56 | float color_next[3], 57 | int inext, double len); 58 | 59 | /* ============================================================ */ 60 | 61 | extern void draw_binorm_segment_edge_n (int ncp, 62 | double front_contour[][3], 63 | double back_contour[][3], 64 | double front_norm[][3], 65 | double back_norm[][3], 66 | int inext, double len); 67 | 68 | extern void draw_binorm_segment_c_and_edge_n (int ncp, 69 | double front_contour[][3], 70 | double back_contour[][3], 71 | double front_norm[][3], 72 | double back_norm[][3], 73 | float color_last[3], 74 | float color_next[3], 75 | int inext, double len); 76 | 77 | extern void draw_binorm_segment_facet_n (int ncp, 78 | double front_contour[][3], 79 | double back_contour[][3], 80 | double front_norm[][3], 81 | double back_norm[][3], 82 | int inext, double len); 83 | 84 | extern void draw_binorm_segment_c_and_facet_n (int ncp, 85 | double front_contour[][3], 86 | double back_contour[][3], 87 | double front_norm[][3], 88 | double back_norm[][3], 89 | float color_last[3], 90 | float color_next[3], 91 | int inext, double len); 92 | 93 | extern void draw_angle_style_back_cap (int ncp, /* number of contour points */ 94 | gleDouble bi[3], /* biscetor */ 95 | gleDouble point_array[][3]); /* polyline */ 96 | 97 | /* -------------------------- end of file -------------------------------- */ 98 | 99 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/tube.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tube.h 3 | * 4 | * FUNCTION: 5 | * Tubing and Extrusion header file. 6 | * This file provides protypes and defines for the extrusion 7 | * and tubing primitives. 8 | * 9 | * HISTORY: 10 | * Linas Vepstas 1990, 1991 11 | */ 12 | 13 | #ifndef __TUBE_H__ 14 | #define __TUBE_H__ 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /** 21 | GLE API revision history: 22 | 23 | GLE_API_VERSION is updated to reflect GLE API changes (interface 24 | changes, semantic changes, deletions, or additions). 25 | 26 | GLE_API_VERSION=228 GLUT 3.7 release of GLE. 27 | **/ 28 | #ifndef GLE_API_VERSION /* allow this to be overriden */ 29 | #define GLE_API_VERSION 228 30 | #endif 31 | 32 | /* some types */ 33 | #ifndef gleDouble 34 | #define gleDouble double 35 | #endif 36 | typedef gleDouble gleAffine[2][3]; 37 | 38 | /* ====================================================== */ 39 | 40 | /* defines for tubing join styles */ 41 | #define TUBE_JN_RAW 0x1 42 | #define TUBE_JN_ANGLE 0x2 43 | #define TUBE_JN_CUT 0x3 44 | #define TUBE_JN_ROUND 0x4 45 | #define TUBE_JN_MASK 0xf /* mask bits */ 46 | #define TUBE_JN_CAP 0x10 47 | 48 | /* determine how normal vectors are to be handled */ 49 | #define TUBE_NORM_FACET 0x100 50 | #define TUBE_NORM_EDGE 0x200 51 | #define TUBE_NORM_PATH_EDGE 0x400 /* for spiral, lathe, helix primitives */ 52 | #define TUBE_NORM_MASK 0xf00 /* mask bits */ 53 | 54 | /* closed or open countours */ 55 | #define TUBE_CONTOUR_CLOSED 0x1000 56 | 57 | #define GLE_TEXTURE_ENABLE 0x10000 58 | #define GLE_TEXTURE_STYLE_MASK 0xff 59 | #define GLE_TEXTURE_VERTEX_FLAT 1 60 | #define GLE_TEXTURE_NORMAL_FLAT 2 61 | #define GLE_TEXTURE_VERTEX_CYL 3 62 | #define GLE_TEXTURE_NORMAL_CYL 4 63 | #define GLE_TEXTURE_VERTEX_SPH 5 64 | #define GLE_TEXTURE_NORMAL_SPH 6 65 | #define GLE_TEXTURE_VERTEX_MODEL_FLAT 7 66 | #define GLE_TEXTURE_NORMAL_MODEL_FLAT 8 67 | #define GLE_TEXTURE_VERTEX_MODEL_CYL 9 68 | #define GLE_TEXTURE_NORMAL_MODEL_CYL 10 69 | #define GLE_TEXTURE_VERTEX_MODEL_SPH 11 70 | #define GLE_TEXTURE_NORMAL_MODEL_SPH 12 71 | 72 | #ifdef GL_32 73 | /* HACK for GL 3.2 -- needed because no way to tell if lighting is on. */ 74 | #define TUBE_LIGHTING_ON 0x80000000 75 | 76 | #define gleExtrusion extrusion 77 | #define gleSetJoinStyle setjoinstyle 78 | #define gleGetJoinStyle getjoinstyle 79 | #define glePolyCone polycone 80 | #define glePolyCylinder polycylinder 81 | #define gleSuperExtrusion super_extrusion 82 | #define gleTwistExtrusion twist_extrusion 83 | #define gleSpiral spiral 84 | #define gleLathe lathe 85 | #define gleHelicoid helicoid 86 | #define gleToroid toroid 87 | #define gleScrew screw 88 | 89 | #endif /* GL_32 */ 90 | 91 | extern int gleGetJoinStyle (void); 92 | extern void gleSetJoinStyle (int style); /* bitwise OR of flags */ 93 | extern int gleGetNumSlices(void); 94 | extern void gleSetNumSlices(int slices); 95 | 96 | /* draw polyclinder, specified as a polyline */ 97 | extern void glePolyCylinder (int npoints, /* num points in polyline */ 98 | gleDouble point_array[][3], /* polyline vertces */ 99 | float color_array[][3], /* colors at polyline verts */ 100 | gleDouble radius); /* radius of polycylinder */ 101 | 102 | /* draw polycone, specified as a polyline with radii */ 103 | extern void glePolyCone (int npoints, /* numpoints in poly-line */ 104 | gleDouble point_array[][3], /* polyline vertices */ 105 | float color_array[][3], /* colors at polyline verts */ 106 | gleDouble radius_array[]); /* cone radii at polyline verts */ 107 | 108 | /* extrude arbitrary 2D contour along arbitrary 3D path */ 109 | extern void gleExtrusion (int ncp, /* number of contour points */ 110 | gleDouble contour[][2], /* 2D contour */ 111 | gleDouble cont_normal[][2], /* 2D contour normals */ 112 | gleDouble up[3], /* up vector for contour */ 113 | int npoints, /* numpoints in poly-line */ 114 | gleDouble point_array[][3], /* polyline vertices */ 115 | float color_array[][3]); /* colors at polyline verts */ 116 | 117 | /* extrude 2D contour, specifying local rotations (twists) */ 118 | extern void gleTwistExtrusion (int ncp, /* number of contour points */ 119 | gleDouble contour[][2], /* 2D contour */ 120 | gleDouble cont_normal[][2], /* 2D contour normals */ 121 | gleDouble up[3], /* up vector for contour */ 122 | int npoints, /* numpoints in poly-line */ 123 | gleDouble point_array[][3], /* polyline vertices */ 124 | float color_array[][3], /* color at polyline verts */ 125 | gleDouble twist_array[]); /* countour twists (in degrees) */ 126 | 127 | /* extrude 2D contour, specifying local affine tranformations */ 128 | extern void gleSuperExtrusion (int ncp, /* number of contour points */ 129 | gleDouble contour[][2], /* 2D contour */ 130 | gleDouble cont_normal[][2], /* 2D contour normals */ 131 | gleDouble up[3], /* up vector for contour */ 132 | int npoints, /* numpoints in poly-line */ 133 | gleDouble point_array[][3], /* polyline vertices */ 134 | float color_array[][3], /* color at polyline verts */ 135 | gleDouble xform_array[][2][3]); /* 2D contour xforms */ 136 | 137 | /* spiral moves contour along helical path by parallel transport */ 138 | extern void gleSpiral (int ncp, /* number of contour points */ 139 | gleDouble contour[][2], /* 2D contour */ 140 | gleDouble cont_normal[][2], /* 2D contour normals */ 141 | gleDouble up[3], /* up vector for contour */ 142 | gleDouble startRadius, /* spiral starts in x-y plane */ 143 | gleDouble drdTheta, /* change in radius per revolution */ 144 | gleDouble startZ, /* starting z value */ 145 | gleDouble dzdTheta, /* change in Z per revolution */ 146 | gleDouble startXform[2][3], /* starting contour affine xform */ 147 | gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */ 148 | gleDouble startTheta, /* start angle in x-y plane */ 149 | gleDouble sweepTheta); /* degrees to spiral around */ 150 | 151 | /* lathe moves contour along helical path by helically shearing 3D space */ 152 | extern void gleLathe (int ncp, /* number of contour points */ 153 | gleDouble contour[][2], /* 2D contour */ 154 | gleDouble cont_normal[][2], /* 2D contour normals */ 155 | gleDouble up[3], /* up vector for contour */ 156 | gleDouble startRadius, /* spiral starts in x-y plane */ 157 | gleDouble drdTheta, /* change in radius per revolution */ 158 | gleDouble startZ, /* starting z value */ 159 | gleDouble dzdTheta, /* change in Z per revolution */ 160 | gleDouble startXform[2][3], /* starting contour affine xform */ 161 | gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */ 162 | gleDouble startTheta, /* start angle in x-y plane */ 163 | gleDouble sweepTheta); /* degrees to spiral around */ 164 | 165 | /* similar to spiral, except contour is a circle */ 166 | extern void gleHelicoid (gleDouble rToroid, /* circle contour (torus) radius */ 167 | gleDouble startRadius, /* spiral starts in x-y plane */ 168 | gleDouble drdTheta, /* change in radius per revolution */ 169 | gleDouble startZ, /* starting z value */ 170 | gleDouble dzdTheta, /* change in Z per revolution */ 171 | gleDouble startXform[2][3], /* starting contour affine xform */ 172 | gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */ 173 | gleDouble startTheta, /* start angle in x-y plane */ 174 | gleDouble sweepTheta); /* degrees to spiral around */ 175 | 176 | /* similar to lathe, except contour is a circle */ 177 | extern void gleToroid (gleDouble rToroid, /* circle contour (torus) radius */ 178 | gleDouble startRadius, /* spiral starts in x-y plane */ 179 | gleDouble drdTheta, /* change in radius per revolution */ 180 | gleDouble startZ, /* starting z value */ 181 | gleDouble dzdTheta, /* change in Z per revolution */ 182 | gleDouble startXform[2][3], /* starting contour affine xform */ 183 | gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */ 184 | gleDouble startTheta, /* start angle in x-y plane */ 185 | gleDouble sweepTheta); /* degrees to spiral around */ 186 | 187 | /* draws a screw shape */ 188 | extern void gleScrew (int ncp, /* number of contour points */ 189 | gleDouble contour[][2], /* 2D contour */ 190 | gleDouble cont_normal[][2], /* 2D contour normals */ 191 | gleDouble up[3], /* up vector for contour */ 192 | gleDouble startz, /* start of segment */ 193 | gleDouble endz, /* end of segment */ 194 | gleDouble twist); /* number of rotations */ 195 | 196 | extern void gleTextureMode (int mode); 197 | 198 | #ifdef __cplusplus 199 | } 200 | 201 | #endif 202 | #endif /* __TUBE_H__ */ 203 | /* ================== END OF FILE ======================= */ 204 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/tube_gc.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * tube_gc.h 4 | * 5 | * FUNCTION: 6 | * This file allows for easy changes to changes in the way the extrusion 7 | * library handles state info (i.e. context). 8 | * 9 | * HISTORY: 10 | * Linas Vepstas --- February 1993 11 | * Added auto texture coord generation hacks, Linas April 1994 12 | * Added tube.h include to define gleDouble, tad February 2002 13 | */ 14 | 15 | #include "tube.h" 16 | #include "port.h" /* for gleVector */ 17 | 18 | typedef float gleColor[3]; 19 | typedef double gleTwoVec[2]; 20 | 21 | typedef struct { 22 | 23 | /* public methods */ 24 | void (*bgn_gen_texture) (int, double); 25 | void (*n3f_gen_texture) (float *); 26 | void (*n3d_gen_texture) (double *); 27 | void (*v3f_gen_texture) (float *, int, int); 28 | void (*v3d_gen_texture) (double *, int, int); 29 | void (*end_gen_texture) (void); 30 | 31 | /* protected members -- "general knowledge" stuff */ 32 | int join_style; 33 | 34 | /* arguments passed into extrusion code */ 35 | int ncp; /* number of contour points */ 36 | gleTwoVec *contour; /* 2D contour */ 37 | gleTwoVec *cont_normal; /* 2D contour normals */ 38 | gleDouble *up; /* up vector */ 39 | int npoints; /* number of points in polyline */ 40 | gleVector *point_array; /* path */ 41 | gleColor *color_array; /* path colors */ 42 | gleAffine *xform_array; /* contour xforms */ 43 | 44 | /* private members, used by texturing code */ 45 | int num_vert; 46 | int segment_number; 47 | double segment_length; 48 | double accum_seg_len; 49 | double prev_x; 50 | double prev_y; 51 | 52 | void (*save_bgn_gen_texture) (int, double); 53 | void (*save_n3f_gen_texture) (float *); 54 | void (*save_n3d_gen_texture) (double *); 55 | void (*save_v3f_gen_texture) (float *, int, int); 56 | void (*save_v3d_gen_texture) (double *, int, int); 57 | void (*save_end_gen_texture) (void); 58 | 59 | } gleGC; 60 | 61 | extern gleGC *_gle_gc; 62 | extern gleGC * gleCreateGC (void); 63 | 64 | #define INIT_GC() {if (!_gle_gc) _gle_gc = gleCreateGC(); } 65 | #define extrusion_join_style (_gle_gc->join_style) 66 | 67 | #define __TUBE_CLOSE_CONTOUR (extrusion_join_style & TUBE_CONTOUR_CLOSED) 68 | #define __TUBE_DRAW_CAP (extrusion_join_style & TUBE_JN_CAP) 69 | #define __TUBE_DRAW_FACET_NORMALS (extrusion_join_style & TUBE_NORM_FACET) 70 | #define __TUBE_DRAW_PATH_EDGE_NORMALS (extrusion_join_style & TUBE_NORM_PATH_EDGE) 71 | 72 | #define __TUBE_STYLE (extrusion_join_style & TUBE_JN_MASK) 73 | #define __TUBE_RAW_JOIN (extrusion_join_style & TUBE_JN_RAW) 74 | #define __TUBE_CUT_JOIN (extrusion_join_style & TUBE_JN_CUT) 75 | #define __TUBE_ANGLE_JOIN (extrusion_join_style & TUBE_JN_ANGLE) 76 | #define __TUBE_ROUND_JOIN (extrusion_join_style & TUBE_JN_ROUND) 77 | 78 | /* ======================= END OF FILE ========================== */ 79 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Headers/vvector.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * vvector.h 4 | * 5 | * FUNCTION: 6 | * This file contains a number of utilities useful for handling 7 | * 3D vectors 8 | * 9 | * HISTORY: 10 | * Written by Linas Vepstas, August 1991 11 | * Added 2D code, March 1993 12 | * Added Outer products, C++ proofed, Linas Vepstas October 1993 13 | */ 14 | 15 | #ifndef __GUTIL_VECTOR_H__ 16 | #define __GUTIL_VECTOR_H__ 17 | 18 | #if defined(__cplusplus) || defined(c_plusplus) 19 | extern "C" { 20 | #endif 21 | 22 | 23 | #include 24 | #include "port.h" 25 | 26 | /* ========================================================== */ 27 | /* Zero out a 2D vector */ 28 | 29 | #define VEC_ZERO_2(a) \ 30 | { \ 31 | (a)[0] = (a)[1] = 0.0; \ 32 | } 33 | 34 | /* ========================================================== */ 35 | /* Zero out a 3D vector */ 36 | 37 | #define VEC_ZERO(a) \ 38 | { \ 39 | (a)[0] = (a)[1] = (a)[2] = 0.0; \ 40 | } 41 | 42 | /* ========================================================== */ 43 | /* Zero out a 4D vector */ 44 | 45 | #define VEC_ZERO_4(a) \ 46 | { \ 47 | (a)[0] = (a)[1] = (a)[2] = (a)[3] = 0.0; \ 48 | } 49 | 50 | /* ========================================================== */ 51 | /* Vector copy */ 52 | 53 | #define VEC_COPY_2(b,a) \ 54 | { \ 55 | (b)[0] = (a)[0]; \ 56 | (b)[1] = (a)[1]; \ 57 | } 58 | 59 | /* ========================================================== */ 60 | /* Copy 3D vector */ 61 | 62 | #define VEC_COPY(b,a) \ 63 | { \ 64 | (b)[0] = (a)[0]; \ 65 | (b)[1] = (a)[1]; \ 66 | (b)[2] = (a)[2]; \ 67 | } 68 | 69 | /* ========================================================== */ 70 | /* Copy 4D vector */ 71 | 72 | #define VEC_COPY_4(b,a) \ 73 | { \ 74 | (b)[0] = (a)[0]; \ 75 | (b)[1] = (a)[1]; \ 76 | (b)[2] = (a)[2]; \ 77 | (b)[3] = (a)[3]; \ 78 | } 79 | 80 | /* ========================================================== */ 81 | /* Vector difference */ 82 | 83 | #define VEC_DIFF_2(v21,v2,v1) \ 84 | { \ 85 | (v21)[0] = (v2)[0] - (v1)[0]; \ 86 | (v21)[1] = (v2)[1] - (v1)[1]; \ 87 | } 88 | 89 | /* ========================================================== */ 90 | /* Vector difference */ 91 | 92 | #define VEC_DIFF(v21,v2,v1) \ 93 | { \ 94 | (v21)[0] = (v2)[0] - (v1)[0]; \ 95 | (v21)[1] = (v2)[1] - (v1)[1]; \ 96 | (v21)[2] = (v2)[2] - (v1)[2]; \ 97 | } 98 | 99 | /* ========================================================== */ 100 | /* Vector difference */ 101 | 102 | #define VEC_DIFF_4(v21,v2,v1) \ 103 | { \ 104 | (v21)[0] = (v2)[0] - (v1)[0]; \ 105 | (v21)[1] = (v2)[1] - (v1)[1]; \ 106 | (v21)[2] = (v2)[2] - (v1)[2]; \ 107 | (v21)[3] = (v2)[3] - (v1)[3]; \ 108 | } 109 | 110 | /* ========================================================== */ 111 | /* Vector sum */ 112 | 113 | #define VEC_SUM_2(v21,v2,v1) \ 114 | { \ 115 | (v21)[0] = (v2)[0] + (v1)[0]; \ 116 | (v21)[1] = (v2)[1] + (v1)[1]; \ 117 | } 118 | 119 | /* ========================================================== */ 120 | /* Vector sum */ 121 | 122 | #define VEC_SUM(v21,v2,v1) \ 123 | { \ 124 | (v21)[0] = (v2)[0] + (v1)[0]; \ 125 | (v21)[1] = (v2)[1] + (v1)[1]; \ 126 | (v21)[2] = (v2)[2] + (v1)[2]; \ 127 | } 128 | 129 | /* ========================================================== */ 130 | /* Vector sum */ 131 | 132 | #define VEC_SUM_4(v21,v2,v1) \ 133 | { \ 134 | (v21)[0] = (v2)[0] + (v1)[0]; \ 135 | (v21)[1] = (v2)[1] + (v1)[1]; \ 136 | (v21)[2] = (v2)[2] + (v1)[2]; \ 137 | (v21)[3] = (v2)[3] + (v1)[3]; \ 138 | } 139 | 140 | /* ========================================================== */ 141 | /* scalar times vector */ 142 | 143 | #define VEC_SCALE_2(c,a,b) \ 144 | { \ 145 | (c)[0] = (a)*(b)[0]; \ 146 | (c)[1] = (a)*(b)[1]; \ 147 | } 148 | 149 | /* ========================================================== */ 150 | /* scalar times vector */ 151 | 152 | #define VEC_SCALE(c,a,b) \ 153 | { \ 154 | (c)[0] = (a)*(b)[0]; \ 155 | (c)[1] = (a)*(b)[1]; \ 156 | (c)[2] = (a)*(b)[2]; \ 157 | } 158 | 159 | /* ========================================================== */ 160 | /* scalar times vector */ 161 | 162 | #define VEC_SCALE_4(c,a,b) \ 163 | { \ 164 | (c)[0] = (a)*(b)[0]; \ 165 | (c)[1] = (a)*(b)[1]; \ 166 | (c)[2] = (a)*(b)[2]; \ 167 | (c)[3] = (a)*(b)[3]; \ 168 | } 169 | 170 | /* ========================================================== */ 171 | /* accumulate scaled vector */ 172 | 173 | #define VEC_ACCUM_2(c,a,b) \ 174 | { \ 175 | (c)[0] += (a)*(b)[0]; \ 176 | (c)[1] += (a)*(b)[1]; \ 177 | } 178 | 179 | /* ========================================================== */ 180 | /* accumulate scaled vector */ 181 | 182 | #define VEC_ACCUM(c,a,b) \ 183 | { \ 184 | (c)[0] += (a)*(b)[0]; \ 185 | (c)[1] += (a)*(b)[1]; \ 186 | (c)[2] += (a)*(b)[2]; \ 187 | } 188 | 189 | /* ========================================================== */ 190 | /* accumulate scaled vector */ 191 | 192 | #define VEC_ACCUM_4(c,a,b) \ 193 | { \ 194 | (c)[0] += (a)*(b)[0]; \ 195 | (c)[1] += (a)*(b)[1]; \ 196 | (c)[2] += (a)*(b)[2]; \ 197 | (c)[3] += (a)*(b)[3]; \ 198 | } 199 | 200 | /* ========================================================== */ 201 | /* Vector dot product */ 202 | 203 | #define VEC_DOT_PRODUCT_2(c,a,b) \ 204 | { \ 205 | c = (a)[0]*(b)[0] + (a)[1]*(b)[1]; \ 206 | } 207 | 208 | /* ========================================================== */ 209 | /* Vector dot product */ 210 | 211 | #define VEC_DOT_PRODUCT(c,a,b) \ 212 | { \ 213 | c = (a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2]; \ 214 | } 215 | 216 | /* ========================================================== */ 217 | /* Vector dot product */ 218 | 219 | #define VEC_DOT_PRODUCT_4(c,a,b) \ 220 | { \ 221 | c = (a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2] + (a)[3]*(b)[3] ; \ 222 | } 223 | 224 | /* ========================================================== */ 225 | /* vector impact parameter (squared) */ 226 | 227 | #define VEC_IMPACT_SQ(bsq,direction,position) \ 228 | { \ 229 | gleDouble vlen, llel; \ 230 | VEC_DOT_PRODUCT (vlen, position, position); \ 231 | VEC_DOT_PRODUCT (llel, direction, position); \ 232 | bsq = vlen - llel*llel; \ 233 | } 234 | 235 | /* ========================================================== */ 236 | /* vector impact parameter */ 237 | 238 | #define VEC_IMPACT(bsq,direction,position) \ 239 | { \ 240 | VEC_IMPACT_SQ(bsq,direction,position); \ 241 | bsq = sqrt (bsq); \ 242 | } 243 | 244 | /* ========================================================== */ 245 | /* Vector length */ 246 | 247 | #define VEC_LENGTH_2(vlen,a) \ 248 | { \ 249 | vlen = a[0]*a[0] + a[1]*a[1]; \ 250 | vlen = sqrt (vlen); \ 251 | } 252 | 253 | /* ========================================================== */ 254 | /* Vector length */ 255 | 256 | #define VEC_LENGTH(vlen,a) \ 257 | { \ 258 | vlen = (a)[0]*(a)[0] + (a)[1]*(a)[1]; \ 259 | vlen += (a)[2]*(a)[2]; \ 260 | vlen = sqrt (vlen); \ 261 | } 262 | 263 | /* ========================================================== */ 264 | /* Vector length */ 265 | 266 | #define VEC_LENGTH_4(vlen,a) \ 267 | { \ 268 | vlen = (a)[0]*(a)[0] + (a)[1]*(a)[1]; \ 269 | vlen += (a)[2]*(a)[2]; \ 270 | vlen += (a)[3] * (a)[3]; \ 271 | vlen = sqrt (vlen); \ 272 | } 273 | 274 | /* ========================================================== */ 275 | /* distance between two points */ 276 | 277 | #define VEC_DISTANCE(vlen,va,vb) \ 278 | { \ 279 | gleDouble tmp[4]; \ 280 | VEC_DIFF (tmp, vb, va); \ 281 | VEC_LENGTH (vlen, tmp); \ 282 | } 283 | 284 | /* ========================================================== */ 285 | /* Vector length */ 286 | 287 | #define VEC_CONJUGATE_LENGTH(vlen,a) \ 288 | { \ 289 | vlen = 1.0 - a[0]*a[0] - a[1]*a[1] - a[2]*a[2];\ 290 | vlen = sqrt (vlen); \ 291 | } 292 | 293 | /* ========================================================== */ 294 | /* Vector length */ 295 | 296 | #define VEC_NORMALIZE(a) \ 297 | { \ 298 | double vlen; \ 299 | VEC_LENGTH (vlen,a); \ 300 | if (vlen != 0.0) { \ 301 | vlen = 1.0 / vlen; \ 302 | a[0] *= vlen; \ 303 | a[1] *= vlen; \ 304 | a[2] *= vlen; \ 305 | } \ 306 | } 307 | 308 | /* ========================================================== */ 309 | /* Vector length */ 310 | 311 | #define VEC_RENORMALIZE(a,newlen) \ 312 | { \ 313 | double vlen; \ 314 | VEC_LENGTH (vlen,a); \ 315 | if (vlen != 0.0) { \ 316 | vlen = newlen / vlen; \ 317 | a[0] *= vlen; \ 318 | a[1] *= vlen; \ 319 | a[2] *= vlen; \ 320 | } \ 321 | } 322 | 323 | /* ========================================================== */ 324 | /* 3D Vector cross product yeilding vector */ 325 | 326 | #define VEC_CROSS_PRODUCT(c,a,b) \ 327 | { \ 328 | c[0] = (a)[1] * (b)[2] - (a)[2] * (b)[1]; \ 329 | c[1] = (a)[2] * (b)[0] - (a)[0] * (b)[2]; \ 330 | c[2] = (a)[0] * (b)[1] - (a)[1] * (b)[0]; \ 331 | } 332 | 333 | /* ========================================================== */ 334 | /* Vector perp -- assumes that n is of unit length 335 | * accepts vector v, subtracts out any component parallel to n */ 336 | 337 | #define VEC_PERP(vp,v,n) \ 338 | { \ 339 | double vdot; \ 340 | \ 341 | VEC_DOT_PRODUCT (vdot, v, n); \ 342 | vp[0] = (v)[0] - (vdot) * (n)[0]; \ 343 | vp[1] = (v)[1] - (vdot) * (n)[1]; \ 344 | vp[2] = (v)[2] - (vdot) * (n)[2]; \ 345 | } 346 | 347 | /* ========================================================== */ 348 | /* Vector parallel -- assumes that n is of unit length 349 | * accepts vector v, subtracts out any component perpendicular to n */ 350 | 351 | #define VEC_PARALLEL(vp,v,n) \ 352 | { \ 353 | double vdot; \ 354 | \ 355 | VEC_DOT_PRODUCT (vdot, v, n); \ 356 | vp[0] = (vdot) * (n)[0]; \ 357 | vp[1] = (vdot) * (n)[1]; \ 358 | vp[2] = (vdot) * (n)[2]; \ 359 | } 360 | 361 | /* ========================================================== */ 362 | /* Vector reflection -- assumes n is of unit length */ 363 | /* Takes vector v, reflects it against reflector n, and returns vr */ 364 | 365 | #define VEC_REFLECT(vr,v,n) \ 366 | { \ 367 | double vdot; \ 368 | \ 369 | VEC_DOT_PRODUCT (vdot, v, n); \ 370 | vr[0] = (v)[0] - 2.0 * (vdot) * (n)[0]; \ 371 | vr[1] = (v)[1] - 2.0 * (vdot) * (n)[1]; \ 372 | vr[2] = (v)[2] - 2.0 * (vdot) * (n)[2]; \ 373 | } 374 | 375 | /* ========================================================== */ 376 | /* Vector blending */ 377 | /* Takes two vectors a, b, blends them together */ 378 | 379 | #define VEC_BLEND(vr,sa,a,sb,b) \ 380 | { \ 381 | \ 382 | vr[0] = (sa) * (a)[0] + (sb) * (b)[0]; \ 383 | vr[1] = (sa) * (a)[1] + (sb) * (b)[1]; \ 384 | vr[2] = (sa) * (a)[2] + (sb) * (b)[2]; \ 385 | } 386 | 387 | /* ========================================================== */ 388 | /* Vector print */ 389 | 390 | #define VEC_PRINT_2(a) \ 391 | { \ 392 | double vlen; \ 393 | VEC_LENGTH_2 (vlen, a); \ 394 | printf (" a is %f %f length of a is %f \n", a[0], a[1], vlen); \ 395 | } 396 | 397 | /* ========================================================== */ 398 | /* Vector print */ 399 | 400 | #define VEC_PRINT(a) \ 401 | { \ 402 | double vlen; \ 403 | VEC_LENGTH (vlen, (a)); \ 404 | printf (" a is %f %f %f length of a is %f \n", (a)[0], (a)[1], (a)[2], vlen); \ 405 | } 406 | 407 | /* ========================================================== */ 408 | /* Vector print */ 409 | 410 | #define VEC_PRINT_4(a) \ 411 | { \ 412 | double vlen; \ 413 | VEC_LENGTH_4 (vlen, (a)); \ 414 | printf (" a is %f %f %f %f length of a is %f \n", \ 415 | (a)[0], (a)[1], (a)[2], (a)[3], vlen); \ 416 | } 417 | 418 | /* ========================================================== */ 419 | /* print matrix */ 420 | 421 | #define MAT_PRINT_4X4(mmm) { \ 422 | int i,j; \ 423 | printf ("matrix mmm is \n"); \ 424 | if (mmm == NULL) { \ 425 | printf (" Null \n"); \ 426 | } else { \ 427 | for (i=0; i<4; i++) { \ 428 | for (j=0; j<4; j++) { \ 429 | printf ("%f ", mmm[i][j]); \ 430 | } \ 431 | printf (" \n"); \ 432 | } \ 433 | } \ 434 | } 435 | 436 | /* ========================================================== */ 437 | /* print matrix */ 438 | 439 | #define MAT_PRINT_3X3(mmm) { \ 440 | int i,j; \ 441 | printf ("matrix mmm is \n"); \ 442 | if (mmm == NULL) { \ 443 | printf (" Null \n"); \ 444 | } else { \ 445 | for (i=0; i<3; i++) { \ 446 | for (j=0; j<3; j++) { \ 447 | printf ("%f ", mmm[i][j]); \ 448 | } \ 449 | printf (" \n"); \ 450 | } \ 451 | } \ 452 | } 453 | 454 | /* ========================================================== */ 455 | /* print matrix */ 456 | 457 | #define MAT_PRINT_2X3(mmm) { \ 458 | int i,j; \ 459 | printf ("matrix mmm is \n"); \ 460 | if (mmm == NULL) { \ 461 | printf (" Null \n"); \ 462 | } else { \ 463 | for (i=0; i<2; i++) { \ 464 | for (j=0; j<3; j++) { \ 465 | printf ("%f ", mmm[i][j]); \ 466 | } \ 467 | printf (" \n"); \ 468 | } \ 469 | } \ 470 | } 471 | 472 | /* ========================================================== */ 473 | /* initialize matrix */ 474 | 475 | #define IDENTIFY_MATRIX_3X3(m) \ 476 | { \ 477 | m[0][0] = 1.0; \ 478 | m[0][1] = 0.0; \ 479 | m[0][2] = 0.0; \ 480 | \ 481 | m[1][0] = 0.0; \ 482 | m[1][1] = 1.0; \ 483 | m[1][2] = 0.0; \ 484 | \ 485 | m[2][0] = 0.0; \ 486 | m[2][1] = 0.0; \ 487 | m[2][2] = 1.0; \ 488 | } 489 | 490 | /* ========================================================== */ 491 | /* initialize matrix */ 492 | 493 | #define IDENTIFY_MATRIX_4X4(m) \ 494 | { \ 495 | m[0][0] = 1.0; \ 496 | m[0][1] = 0.0; \ 497 | m[0][2] = 0.0; \ 498 | m[0][3] = 0.0; \ 499 | \ 500 | m[1][0] = 0.0; \ 501 | m[1][1] = 1.0; \ 502 | m[1][2] = 0.0; \ 503 | m[1][3] = 0.0; \ 504 | \ 505 | m[2][0] = 0.0; \ 506 | m[2][1] = 0.0; \ 507 | m[2][2] = 1.0; \ 508 | m[2][3] = 0.0; \ 509 | \ 510 | m[3][0] = 0.0; \ 511 | m[3][1] = 0.0; \ 512 | m[3][2] = 0.0; \ 513 | m[3][3] = 1.0; \ 514 | } 515 | 516 | /* ========================================================== */ 517 | /* matrix copy */ 518 | 519 | #define COPY_MATRIX_2X2(b,a) \ 520 | { \ 521 | b[0][0] = a[0][0]; \ 522 | b[0][1] = a[0][1]; \ 523 | \ 524 | b[1][0] = a[1][0]; \ 525 | b[1][1] = a[1][1]; \ 526 | \ 527 | } 528 | 529 | /* ========================================================== */ 530 | /* matrix copy */ 531 | 532 | #define COPY_MATRIX_2X3(b,a) \ 533 | { \ 534 | b[0][0] = a[0][0]; \ 535 | b[0][1] = a[0][1]; \ 536 | b[0][2] = a[0][2]; \ 537 | \ 538 | b[1][0] = a[1][0]; \ 539 | b[1][1] = a[1][1]; \ 540 | b[1][2] = a[1][2]; \ 541 | } 542 | 543 | /* ========================================================== */ 544 | /* matrix copy */ 545 | 546 | #define COPY_MATRIX_3X3(b,a) \ 547 | { \ 548 | b[0][0] = a[0][0]; \ 549 | b[0][1] = a[0][1]; \ 550 | b[0][2] = a[0][2]; \ 551 | \ 552 | b[1][0] = a[1][0]; \ 553 | b[1][1] = a[1][1]; \ 554 | b[1][2] = a[1][2]; \ 555 | \ 556 | b[2][0] = a[2][0]; \ 557 | b[2][1] = a[2][1]; \ 558 | b[2][2] = a[2][2]; \ 559 | } 560 | 561 | /* ========================================================== */ 562 | /* matrix copy */ 563 | 564 | #define COPY_MATRIX_4X4(b,a) \ 565 | { \ 566 | b[0][0] = a[0][0]; \ 567 | b[0][1] = a[0][1]; \ 568 | b[0][2] = a[0][2]; \ 569 | b[0][3] = a[0][3]; \ 570 | \ 571 | b[1][0] = a[1][0]; \ 572 | b[1][1] = a[1][1]; \ 573 | b[1][2] = a[1][2]; \ 574 | b[1][3] = a[1][3]; \ 575 | \ 576 | b[2][0] = a[2][0]; \ 577 | b[2][1] = a[2][1]; \ 578 | b[2][2] = a[2][2]; \ 579 | b[2][3] = a[2][3]; \ 580 | \ 581 | b[3][0] = a[3][0]; \ 582 | b[3][1] = a[3][1]; \ 583 | b[3][2] = a[3][2]; \ 584 | b[3][3] = a[3][3]; \ 585 | } 586 | 587 | /* ========================================================== */ 588 | /* matrix transpose */ 589 | 590 | #define TRANSPOSE_MATRIX_2X2(b,a) \ 591 | { \ 592 | b[0][0] = a[0][0]; \ 593 | b[0][1] = a[1][0]; \ 594 | \ 595 | b[1][0] = a[0][1]; \ 596 | b[1][1] = a[1][1]; \ 597 | } 598 | 599 | /* ========================================================== */ 600 | /* matrix transpose */ 601 | 602 | #define TRANSPOSE_MATRIX_3X3(b,a) \ 603 | { \ 604 | b[0][0] = a[0][0]; \ 605 | b[0][1] = a[1][0]; \ 606 | b[0][2] = a[2][0]; \ 607 | \ 608 | b[1][0] = a[0][1]; \ 609 | b[1][1] = a[1][1]; \ 610 | b[1][2] = a[2][1]; \ 611 | \ 612 | b[2][0] = a[0][2]; \ 613 | b[2][1] = a[1][2]; \ 614 | b[2][2] = a[2][2]; \ 615 | } 616 | 617 | /* ========================================================== */ 618 | /* matrix transpose */ 619 | 620 | #define TRANSPOSE_MATRIX_4X4(b,a) \ 621 | { \ 622 | b[0][0] = a[0][0]; \ 623 | b[0][1] = a[1][0]; \ 624 | b[0][2] = a[2][0]; \ 625 | b[0][3] = a[3][0]; \ 626 | \ 627 | b[1][0] = a[0][1]; \ 628 | b[1][1] = a[1][1]; \ 629 | b[1][2] = a[2][1]; \ 630 | b[1][3] = a[3][1]; \ 631 | \ 632 | b[2][0] = a[0][2]; \ 633 | b[2][1] = a[1][2]; \ 634 | b[2][2] = a[2][2]; \ 635 | b[2][3] = a[3][2]; \ 636 | \ 637 | b[3][0] = a[0][3]; \ 638 | b[3][1] = a[1][3]; \ 639 | b[3][2] = a[2][3]; \ 640 | b[3][3] = a[3][3]; \ 641 | } 642 | 643 | /* ========================================================== */ 644 | /* multiply matrix by scalar */ 645 | 646 | #define SCALE_MATRIX_2X2(b,s,a) \ 647 | { \ 648 | b[0][0] = (s) * a[0][0]; \ 649 | b[0][1] = (s) * a[0][1]; \ 650 | \ 651 | b[1][0] = (s) * a[1][0]; \ 652 | b[1][1] = (s) * a[1][1]; \ 653 | } 654 | 655 | /* ========================================================== */ 656 | /* multiply matrix by scalar */ 657 | 658 | #define SCALE_MATRIX_3X3(b,s,a) \ 659 | { \ 660 | b[0][0] = (s) * a[0][0]; \ 661 | b[0][1] = (s) * a[0][1]; \ 662 | b[0][2] = (s) * a[0][2]; \ 663 | \ 664 | b[1][0] = (s) * a[1][0]; \ 665 | b[1][1] = (s) * a[1][1]; \ 666 | b[1][2] = (s) * a[1][2]; \ 667 | \ 668 | b[2][0] = (s) * a[2][0]; \ 669 | b[2][1] = (s) * a[2][1]; \ 670 | b[2][2] = (s) * a[2][2]; \ 671 | } 672 | 673 | /* ========================================================== */ 674 | /* multiply matrix by scalar */ 675 | 676 | #define SCALE_MATRIX_4X4(b,s,a) \ 677 | { \ 678 | b[0][0] = (s) * a[0][0]; \ 679 | b[0][1] = (s) * a[0][1]; \ 680 | b[0][2] = (s) * a[0][2]; \ 681 | b[0][3] = (s) * a[0][3]; \ 682 | \ 683 | b[1][0] = (s) * a[1][0]; \ 684 | b[1][1] = (s) * a[1][1]; \ 685 | b[1][2] = (s) * a[1][2]; \ 686 | b[1][3] = (s) * a[1][3]; \ 687 | \ 688 | b[2][0] = (s) * a[2][0]; \ 689 | b[2][1] = (s) * a[2][1]; \ 690 | b[2][2] = (s) * a[2][2]; \ 691 | b[2][3] = (s) * a[2][3]; \ 692 | \ 693 | b[3][0] = s * a[3][0]; \ 694 | b[3][1] = s * a[3][1]; \ 695 | b[3][2] = s * a[3][2]; \ 696 | b[3][3] = s * a[3][3]; \ 697 | } 698 | 699 | /* ========================================================== */ 700 | /* multiply matrix by scalar */ 701 | 702 | #define ACCUM_SCALE_MATRIX_2X2(b,s,a) \ 703 | { \ 704 | b[0][0] += (s) * a[0][0]; \ 705 | b[0][1] += (s) * a[0][1]; \ 706 | \ 707 | b[1][0] += (s) * a[1][0]; \ 708 | b[1][1] += (s) * a[1][1]; \ 709 | } 710 | 711 | /* +========================================================== */ 712 | /* multiply matrix by scalar */ 713 | 714 | #define ACCUM_SCALE_MATRIX_3X3(b,s,a) \ 715 | { \ 716 | b[0][0] += (s) * a[0][0]; \ 717 | b[0][1] += (s) * a[0][1]; \ 718 | b[0][2] += (s) * a[0][2]; \ 719 | \ 720 | b[1][0] += (s) * a[1][0]; \ 721 | b[1][1] += (s) * a[1][1]; \ 722 | b[1][2] += (s) * a[1][2]; \ 723 | \ 724 | b[2][0] += (s) * a[2][0]; \ 725 | b[2][1] += (s) * a[2][1]; \ 726 | b[2][2] += (s) * a[2][2]; \ 727 | } 728 | 729 | /* +========================================================== */ 730 | /* multiply matrix by scalar */ 731 | 732 | #define ACCUM_SCALE_MATRIX_4X4(b,s,a) \ 733 | { \ 734 | b[0][0] += (s) * a[0][0]; \ 735 | b[0][1] += (s) * a[0][1]; \ 736 | b[0][2] += (s) * a[0][2]; \ 737 | b[0][3] += (s) * a[0][3]; \ 738 | \ 739 | b[1][0] += (s) * a[1][0]; \ 740 | b[1][1] += (s) * a[1][1]; \ 741 | b[1][2] += (s) * a[1][2]; \ 742 | b[1][3] += (s) * a[1][3]; \ 743 | \ 744 | b[2][0] += (s) * a[2][0]; \ 745 | b[2][1] += (s) * a[2][1]; \ 746 | b[2][2] += (s) * a[2][2]; \ 747 | b[2][3] += (s) * a[2][3]; \ 748 | \ 749 | b[3][0] += (s) * a[3][0]; \ 750 | b[3][1] += (s) * a[3][1]; \ 751 | b[3][2] += (s) * a[3][2]; \ 752 | b[3][3] += (s) * a[3][3]; \ 753 | } 754 | 755 | /* +========================================================== */ 756 | /* matrix product */ 757 | /* c[x][y] = a[x][0]*b[0][y]+a[x][1]*b[1][y]+a[x][2]*b[2][y]+a[x][3]*b[3][y];*/ 758 | 759 | #define MATRIX_PRODUCT_2X2(c,a,b) \ 760 | { \ 761 | c[0][0] = a[0][0]*b[0][0]+a[0][1]*b[1][0]; \ 762 | c[0][1] = a[0][0]*b[0][1]+a[0][1]*b[1][1]; \ 763 | \ 764 | c[1][0] = a[1][0]*b[0][0]+a[1][1]*b[1][0]; \ 765 | c[1][1] = a[1][0]*b[0][1]+a[1][1]*b[1][1]; \ 766 | \ 767 | } 768 | 769 | /* ========================================================== */ 770 | /* matrix product */ 771 | /* c[x][y] = a[x][0]*b[0][y]+a[x][1]*b[1][y]+a[x][2]*b[2][y]+a[x][3]*b[3][y];*/ 772 | 773 | #define MATRIX_PRODUCT_3X3(c,a,b) \ 774 | { \ 775 | c[0][0] = a[0][0]*b[0][0]+a[0][1]*b[1][0]+a[0][2]*b[2][0]; \ 776 | c[0][1] = a[0][0]*b[0][1]+a[0][1]*b[1][1]+a[0][2]*b[2][1]; \ 777 | c[0][2] = a[0][0]*b[0][2]+a[0][1]*b[1][2]+a[0][2]*b[2][2]; \ 778 | \ 779 | c[1][0] = a[1][0]*b[0][0]+a[1][1]*b[1][0]+a[1][2]*b[2][0]; \ 780 | c[1][1] = a[1][0]*b[0][1]+a[1][1]*b[1][1]+a[1][2]*b[2][1]; \ 781 | c[1][2] = a[1][0]*b[0][2]+a[1][1]*b[1][2]+a[1][2]*b[2][2]; \ 782 | \ 783 | c[2][0] = a[2][0]*b[0][0]+a[2][1]*b[1][0]+a[2][2]*b[2][0]; \ 784 | c[2][1] = a[2][0]*b[0][1]+a[2][1]*b[1][1]+a[2][2]*b[2][1]; \ 785 | c[2][2] = a[2][0]*b[0][2]+a[2][1]*b[1][2]+a[2][2]*b[2][2]; \ 786 | } 787 | 788 | /* ========================================================== */ 789 | /* matrix product */ 790 | /* c[x][y] = a[x][0]*b[0][y]+a[x][1]*b[1][y]+a[x][2]*b[2][y]+a[x][3]*b[3][y];*/ 791 | 792 | #define MATRIX_PRODUCT_4X4(c,a,b) \ 793 | { \ 794 | c[0][0] = a[0][0]*b[0][0]+a[0][1]*b[1][0]+a[0][2]*b[2][0]+a[0][3]*b[3][0];\ 795 | c[0][1] = a[0][0]*b[0][1]+a[0][1]*b[1][1]+a[0][2]*b[2][1]+a[0][3]*b[3][1];\ 796 | c[0][2] = a[0][0]*b[0][2]+a[0][1]*b[1][2]+a[0][2]*b[2][2]+a[0][3]*b[3][2];\ 797 | c[0][3] = a[0][0]*b[0][3]+a[0][1]*b[1][3]+a[0][2]*b[2][3]+a[0][3]*b[3][3];\ 798 | \ 799 | c[1][0] = a[1][0]*b[0][0]+a[1][1]*b[1][0]+a[1][2]*b[2][0]+a[1][3]*b[3][0];\ 800 | c[1][1] = a[1][0]*b[0][1]+a[1][1]*b[1][1]+a[1][2]*b[2][1]+a[1][3]*b[3][1];\ 801 | c[1][2] = a[1][0]*b[0][2]+a[1][1]*b[1][2]+a[1][2]*b[2][2]+a[1][3]*b[3][2];\ 802 | c[1][3] = a[1][0]*b[0][3]+a[1][1]*b[1][3]+a[1][2]*b[2][3]+a[1][3]*b[3][3];\ 803 | \ 804 | c[2][0] = a[2][0]*b[0][0]+a[2][1]*b[1][0]+a[2][2]*b[2][0]+a[2][3]*b[3][0];\ 805 | c[2][1] = a[2][0]*b[0][1]+a[2][1]*b[1][1]+a[2][2]*b[2][1]+a[2][3]*b[3][1];\ 806 | c[2][2] = a[2][0]*b[0][2]+a[2][1]*b[1][2]+a[2][2]*b[2][2]+a[2][3]*b[3][2];\ 807 | c[2][3] = a[2][0]*b[0][3]+a[2][1]*b[1][3]+a[2][2]*b[2][3]+a[2][3]*b[3][3];\ 808 | \ 809 | c[3][0] = a[3][0]*b[0][0]+a[3][1]*b[1][0]+a[3][2]*b[2][0]+a[3][3]*b[3][0];\ 810 | c[3][1] = a[3][0]*b[0][1]+a[3][1]*b[1][1]+a[3][2]*b[2][1]+a[3][3]*b[3][1];\ 811 | c[3][2] = a[3][0]*b[0][2]+a[3][1]*b[1][2]+a[3][2]*b[2][2]+a[3][3]*b[3][2];\ 812 | c[3][3] = a[3][0]*b[0][3]+a[3][1]*b[1][3]+a[3][2]*b[2][3]+a[3][3]*b[3][3];\ 813 | } 814 | 815 | /* ========================================================== */ 816 | /* matrix times vector */ 817 | 818 | #define MAT_DOT_VEC_2X2(p,m,v) \ 819 | { \ 820 | p[0] = m[0][0]*v[0] + m[0][1]*v[1]; \ 821 | p[1] = m[1][0]*v[0] + m[1][1]*v[1]; \ 822 | } 823 | 824 | /* ========================================================== */ 825 | /* matrix times vector */ 826 | 827 | #define MAT_DOT_VEC_3X3(p,m,v) \ 828 | { \ 829 | p[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2]; \ 830 | p[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2]; \ 831 | p[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2]; \ 832 | } 833 | 834 | /* ========================================================== */ 835 | /* matrix times vector */ 836 | 837 | #define MAT_DOT_VEC_4X4(p,m,v) \ 838 | { \ 839 | p[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2] + m[0][3]*v[3]; \ 840 | p[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2] + m[1][3]*v[3]; \ 841 | p[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2] + m[2][3]*v[3]; \ 842 | p[3] = m[3][0]*v[0] + m[3][1]*v[1] + m[3][2]*v[2] + m[3][3]*v[3]; \ 843 | } 844 | 845 | /* ========================================================== */ 846 | /* vector transpose times matrix */ 847 | /* p[j] = v[0]*m[0][j] + v[1]*m[1][j] + v[2]*m[2][j]; */ 848 | 849 | #define VEC_DOT_MAT_3X3(p,v,m) \ 850 | { \ 851 | p[0] = v[0]*m[0][0] + v[1]*m[1][0] + v[2]*m[2][0]; \ 852 | p[1] = v[0]*m[0][1] + v[1]*m[1][1] + v[2]*m[2][1]; \ 853 | p[2] = v[0]*m[0][2] + v[1]*m[1][2] + v[2]*m[2][2]; \ 854 | } 855 | 856 | /* ========================================================== */ 857 | /* affine matrix times vector */ 858 | /* The matrix is assumed to be an affine matrix, with last two 859 | * entries representing a translation */ 860 | 861 | #define MAT_DOT_VEC_2X3(p,m,v) \ 862 | { \ 863 | p[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]; \ 864 | p[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]; \ 865 | } 866 | 867 | /* ========================================================== */ 868 | /* inverse transpose of matrix times vector 869 | * 870 | * This macro computes inverse transpose of matrix m, 871 | * and multiplies vector v into it, to yeild vector p 872 | * 873 | * DANGER !!! Do Not use this on normal vectors!!! 874 | * It will leave normals the wrong length !!! 875 | * See macro below for use on normals. 876 | */ 877 | 878 | #define INV_TRANSP_MAT_DOT_VEC_2X2(p,m,v) \ 879 | { \ 880 | gleDouble det; \ 881 | \ 882 | det = m[0][0]*m[1][1] - m[0][1]*m[1][0]; \ 883 | p[0] = m[1][1]*v[0] - m[1][0]*v[1]; \ 884 | p[1] = - m[0][1]*v[0] + m[0][0]*v[1]; \ 885 | \ 886 | /* if matrix not singular, and not orthonormal, then renormalize */ \ 887 | if ((det!=1.0) && (det != 0.0)) { \ 888 | det = 1.0 / det; \ 889 | p[0] *= det; \ 890 | p[1] *= det; \ 891 | } \ 892 | } 893 | 894 | /* ========================================================== */ 895 | /* transform normal vector by inverse transpose of matrix 896 | * and then renormalize the vector 897 | * 898 | * This macro computes inverse transpose of matrix m, 899 | * and multiplies vector v into it, to yeild vector p 900 | * Vector p is then normalized. 901 | */ 902 | 903 | 904 | #define NORM_XFORM_2X2(p,m,v) \ 905 | { \ 906 | double mlen; \ 907 | \ 908 | /* do nothing if off-diagonals are zero and diagonals are \ 909 | * equal */ \ 910 | if ((m[0][1] != 0.0) || (m[1][0] != 0.0) || (m[0][0] != m[1][1])) { \ 911 | p[0] = m[1][1]*v[0] - m[1][0]*v[1]; \ 912 | p[1] = - m[0][1]*v[0] + m[0][0]*v[1]; \ 913 | \ 914 | mlen = p[0]*p[0] + p[1]*p[1]; \ 915 | mlen = 1.0 / sqrt (mlen); \ 916 | p[0] *= mlen; \ 917 | p[1] *= mlen; \ 918 | } else { \ 919 | VEC_COPY_2 (p, v); \ 920 | } \ 921 | } 922 | 923 | /* ========================================================== */ 924 | /* outer product of vector times vector transpose 925 | * 926 | * The outer product of vector v and vector transpose t yeilds 927 | * dyadic matrix m. 928 | */ 929 | 930 | #define OUTER_PRODUCT_2X2(m,v,t) \ 931 | { \ 932 | m[0][0] = v[0] * t[0]; \ 933 | m[0][1] = v[0] * t[1]; \ 934 | \ 935 | m[1][0] = v[1] * t[0]; \ 936 | m[1][1] = v[1] * t[1]; \ 937 | } 938 | 939 | /* ========================================================== */ 940 | /* outer product of vector times vector transpose 941 | * 942 | * The outer product of vector v and vector transpose t yeilds 943 | * dyadic matrix m. 944 | */ 945 | 946 | #define OUTER_PRODUCT_3X3(m,v,t) \ 947 | { \ 948 | m[0][0] = v[0] * t[0]; \ 949 | m[0][1] = v[0] * t[1]; \ 950 | m[0][2] = v[0] * t[2]; \ 951 | \ 952 | m[1][0] = v[1] * t[0]; \ 953 | m[1][1] = v[1] * t[1]; \ 954 | m[1][2] = v[1] * t[2]; \ 955 | \ 956 | m[2][0] = v[2] * t[0]; \ 957 | m[2][1] = v[2] * t[1]; \ 958 | m[2][2] = v[2] * t[2]; \ 959 | } 960 | 961 | /* ========================================================== */ 962 | /* outer product of vector times vector transpose 963 | * 964 | * The outer product of vector v and vector transpose t yeilds 965 | * dyadic matrix m. 966 | */ 967 | 968 | #define OUTER_PRODUCT_4X4(m,v,t) \ 969 | { \ 970 | m[0][0] = v[0] * t[0]; \ 971 | m[0][1] = v[0] * t[1]; \ 972 | m[0][2] = v[0] * t[2]; \ 973 | m[0][3] = v[0] * t[3]; \ 974 | \ 975 | m[1][0] = v[1] * t[0]; \ 976 | m[1][1] = v[1] * t[1]; \ 977 | m[1][2] = v[1] * t[2]; \ 978 | m[1][3] = v[1] * t[3]; \ 979 | \ 980 | m[2][0] = v[2] * t[0]; \ 981 | m[2][1] = v[2] * t[1]; \ 982 | m[2][2] = v[2] * t[2]; \ 983 | m[2][3] = v[2] * t[3]; \ 984 | \ 985 | m[3][0] = v[3] * t[0]; \ 986 | m[3][1] = v[3] * t[1]; \ 987 | m[3][2] = v[3] * t[2]; \ 988 | m[3][3] = v[3] * t[3]; \ 989 | } 990 | 991 | /* +========================================================== */ 992 | /* outer product of vector times vector transpose 993 | * 994 | * The outer product of vector v and vector transpose t yeilds 995 | * dyadic matrix m. 996 | */ 997 | 998 | #define ACCUM_OUTER_PRODUCT_2X2(m,v,t) \ 999 | { \ 1000 | m[0][0] += v[0] * t[0]; \ 1001 | m[0][1] += v[0] * t[1]; \ 1002 | \ 1003 | m[1][0] += v[1] * t[0]; \ 1004 | m[1][1] += v[1] * t[1]; \ 1005 | } 1006 | 1007 | /* +========================================================== */ 1008 | /* outer product of vector times vector transpose 1009 | * 1010 | * The outer product of vector v and vector transpose t yeilds 1011 | * dyadic matrix m. 1012 | */ 1013 | 1014 | #define ACCUM_OUTER_PRODUCT_3X3(m,v,t) \ 1015 | { \ 1016 | m[0][0] += v[0] * t[0]; \ 1017 | m[0][1] += v[0] * t[1]; \ 1018 | m[0][2] += v[0] * t[2]; \ 1019 | \ 1020 | m[1][0] += v[1] * t[0]; \ 1021 | m[1][1] += v[1] * t[1]; \ 1022 | m[1][2] += v[1] * t[2]; \ 1023 | \ 1024 | m[2][0] += v[2] * t[0]; \ 1025 | m[2][1] += v[2] * t[1]; \ 1026 | m[2][2] += v[2] * t[2]; \ 1027 | } 1028 | 1029 | /* +========================================================== */ 1030 | /* outer product of vector times vector transpose 1031 | * 1032 | * The outer product of vector v and vector transpose t yeilds 1033 | * dyadic matrix m. 1034 | */ 1035 | 1036 | #define ACCUM_OUTER_PRODUCT_4X4(m,v,t) \ 1037 | { \ 1038 | m[0][0] += v[0] * t[0]; \ 1039 | m[0][1] += v[0] * t[1]; \ 1040 | m[0][2] += v[0] * t[2]; \ 1041 | m[0][3] += v[0] * t[3]; \ 1042 | \ 1043 | m[1][0] += v[1] * t[0]; \ 1044 | m[1][1] += v[1] * t[1]; \ 1045 | m[1][2] += v[1] * t[2]; \ 1046 | m[1][3] += v[1] * t[3]; \ 1047 | \ 1048 | m[2][0] += v[2] * t[0]; \ 1049 | m[2][1] += v[2] * t[1]; \ 1050 | m[2][2] += v[2] * t[2]; \ 1051 | m[2][3] += v[2] * t[3]; \ 1052 | \ 1053 | m[3][0] += v[3] * t[0]; \ 1054 | m[3][1] += v[3] * t[1]; \ 1055 | m[3][2] += v[3] * t[2]; \ 1056 | m[3][3] += v[3] * t[3]; \ 1057 | } 1058 | 1059 | /* +========================================================== */ 1060 | /* determinant of matrix 1061 | * 1062 | * Computes determinant of matrix m, returning d 1063 | */ 1064 | 1065 | #define DETERMINANT_2X2(d,m) \ 1066 | { \ 1067 | d = m[0][0] * m[1][1] - m[0][1] * m[1][0]; \ 1068 | } 1069 | 1070 | /* ========================================================== */ 1071 | /* determinant of matrix 1072 | * 1073 | * Computes determinant of matrix m, returning d 1074 | */ 1075 | 1076 | #define DETERMINANT_3X3(d,m) \ 1077 | { \ 1078 | d = m[0][0] * (m[1][1]*m[2][2] - m[1][2] * m[2][1]); \ 1079 | d -= m[0][1] * (m[1][0]*m[2][2] - m[1][2] * m[2][0]); \ 1080 | d += m[0][2] * (m[1][0]*m[2][1] - m[1][1] * m[2][0]); \ 1081 | } 1082 | 1083 | /* ========================================================== */ 1084 | /* i,j,th cofactor of a 4x4 matrix 1085 | * 1086 | */ 1087 | 1088 | #define COFACTOR_4X4_IJ(fac,m,i,j) \ 1089 | { \ 1090 | int ii[4], jj[4], k; \ 1091 | \ 1092 | /* compute which row, columnt to skip */ \ 1093 | for (k=0; k 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | GLUT 9 | CFBundleGetInfoString 10 | 3.4.0, Copyright (c) 2001-2008 Apple Inc., All Rights Reserved 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.apple.glut 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 3.4.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | GLUT-3.4.0 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/blankCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/blankCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/bottomCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/bottomCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/bottomleftCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/bottomleftCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/bottomrightCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/bottomrightCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/crossCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/crossCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/cycleCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/cycleCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/destroyCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/destroyCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/fingerCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/fingerCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/helpCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/helpCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/leftCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/leftCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/leftRightCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/leftRightCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/rightArrowCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/rightArrowCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/rightCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/rightCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/sprayCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/sprayCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/topCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/topCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/topleftCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/topleftCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/toprightCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/toprightCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/upDownCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/upDownCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/waitCursor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/A/Resources/waitCursor.tiff -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/GLUT.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Frameworks/libfmodex.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Frameworks/libfmodex.dylib -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16G29 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | wave_function_collapseDebug 11 | CFBundleIconFile 12 | icon-debug.icns 13 | CFBundleIdentifier 14 | cc.openFrameworks.ofapp 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | ???? 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 1.0 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 9C40b 31 | DTPlatformVersion 32 | GM 33 | DTSDKBuild 34 | 17C76 35 | DTSDKName 36 | macosx10.13 37 | DTXcode 38 | 0920 39 | DTXcodeBuild 40 | 9C40b 41 | 42 | 43 | -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/MacOS/wave_function_collapseDebug: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/MacOS/wave_function_collapseDebug -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /bin/wave_function_collapseDebug.app/Contents/Resources/icon-debug.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/bin/wave_function_collapseDebug.app/Contents/Resources/icon-debug.icns -------------------------------------------------------------------------------- /config.make: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # CONFIGURE PROJECT MAKEFILE (optional) 3 | # This file is where we make project specific configurations. 4 | ################################################################################ 5 | 6 | ################################################################################ 7 | # OF ROOT 8 | # The location of your root openFrameworks installation 9 | # (default) OF_ROOT = ../../.. 10 | ################################################################################ 11 | # OF_ROOT = ../../.. 12 | 13 | ################################################################################ 14 | # PROJECT ROOT 15 | # The location of the project - a starting place for searching for files 16 | # (default) PROJECT_ROOT = . (this directory) 17 | # 18 | ################################################################################ 19 | # PROJECT_ROOT = . 20 | 21 | ################################################################################ 22 | # PROJECT SPECIFIC CHECKS 23 | # This is a project defined section to create internal makefile flags to 24 | # conditionally enable or disable the addition of various features within 25 | # this makefile. For instance, if you want to make changes based on whether 26 | # GTK is installed, one might test that here and create a variable to check. 27 | ################################################################################ 28 | # None 29 | 30 | ################################################################################ 31 | # PROJECT EXTERNAL SOURCE PATHS 32 | # These are fully qualified paths that are not within the PROJECT_ROOT folder. 33 | # Like source folders in the PROJECT_ROOT, these paths are subject to 34 | # exlclusion via the PROJECT_EXLCUSIONS list. 35 | # 36 | # (default) PROJECT_EXTERNAL_SOURCE_PATHS = (blank) 37 | # 38 | # Note: Leave a leading space when adding list items with the += operator 39 | ################################################################################ 40 | # PROJECT_EXTERNAL_SOURCE_PATHS = 41 | 42 | ################################################################################ 43 | # PROJECT EXCLUSIONS 44 | # These makefiles assume that all folders in your current project directory 45 | # and any listed in the PROJECT_EXTERNAL_SOURCH_PATHS are are valid locations 46 | # to look for source code. The any folders or files that match any of the 47 | # items in the PROJECT_EXCLUSIONS list below will be ignored. 48 | # 49 | # Each item in the PROJECT_EXCLUSIONS list will be treated as a complete 50 | # string unless teh user adds a wildcard (%) operator to match subdirectories. 51 | # GNU make only allows one wildcard for matching. The second wildcard (%) is 52 | # treated literally. 53 | # 54 | # (default) PROJECT_EXCLUSIONS = (blank) 55 | # 56 | # Will automatically exclude the following: 57 | # 58 | # $(PROJECT_ROOT)/bin% 59 | # $(PROJECT_ROOT)/obj% 60 | # $(PROJECT_ROOT)/%.xcodeproj 61 | # 62 | # Note: Leave a leading space when adding list items with the += operator 63 | ################################################################################ 64 | # PROJECT_EXCLUSIONS = 65 | 66 | ################################################################################ 67 | # PROJECT LINKER FLAGS 68 | # These flags will be sent to the linker when compiling the executable. 69 | # 70 | # (default) PROJECT_LDFLAGS = -Wl,-rpath=./libs 71 | # 72 | # Note: Leave a leading space when adding list items with the += operator 73 | ################################################################################ 74 | 75 | # Currently, shared libraries that are needed are copied to the 76 | # $(PROJECT_ROOT)/bin/libs directory. The following LDFLAGS tell the linker to 77 | # add a runtime path to search for those shared libraries, since they aren't 78 | # incorporated directly into the final executable application binary. 79 | # TODO: should this be a default setting? 80 | # PROJECT_LDFLAGS=-Wl,-rpath=./libs 81 | 82 | ################################################################################ 83 | # PROJECT DEFINES 84 | # Create a space-delimited list of DEFINES. The list will be converted into 85 | # CFLAGS with the "-D" flag later in the makefile. 86 | # 87 | # (default) PROJECT_DEFINES = (blank) 88 | # 89 | # Note: Leave a leading space when adding list items with the += operator 90 | ################################################################################ 91 | # PROJECT_DEFINES = 92 | 93 | ################################################################################ 94 | # PROJECT CFLAGS 95 | # This is a list of fully qualified CFLAGS required when compiling for this 96 | # project. These CFLAGS will be used IN ADDITION TO the PLATFORM_CFLAGS 97 | # defined in your platform specific core configuration files. These flags are 98 | # presented to the compiler BEFORE the PROJECT_OPTIMIZATION_CFLAGS below. 99 | # 100 | # (default) PROJECT_CFLAGS = (blank) 101 | # 102 | # Note: Before adding PROJECT_CFLAGS, note that the PLATFORM_CFLAGS defined in 103 | # your platform specific configuration file will be applied by default and 104 | # further flags here may not be needed. 105 | # 106 | # Note: Leave a leading space when adding list items with the += operator 107 | ################################################################################ 108 | # PROJECT_CFLAGS = 109 | 110 | ################################################################################ 111 | # PROJECT OPTIMIZATION CFLAGS 112 | # These are lists of CFLAGS that are target-specific. While any flags could 113 | # be conditionally added, they are usually limited to optimization flags. 114 | # These flags are added BEFORE the PROJECT_CFLAGS. 115 | # 116 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets. 117 | # 118 | # (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank) 119 | # 120 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG flags are only applied to DEBUG targets. 121 | # 122 | # (default) PROJECT_OPTIMIZATION_CFLAGS_DEBUG = (blank) 123 | # 124 | # Note: Before adding PROJECT_OPTIMIZATION_CFLAGS, please note that the 125 | # PLATFORM_OPTIMIZATION_CFLAGS defined in your platform specific configuration 126 | # file will be applied by default and further optimization flags here may not 127 | # be needed. 128 | # 129 | # Note: Leave a leading space when adding list items with the += operator 130 | ################################################################################ 131 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE = 132 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG = 133 | 134 | ################################################################################ 135 | # PROJECT COMPILERS 136 | # Custom compilers can be set for CC and CXX 137 | # (default) PROJECT_CXX = (blank) 138 | # (default) PROJECT_CC = (blank) 139 | # Note: Leave a leading space when adding list items with the += operator 140 | ################################################################################ 141 | # PROJECT_CXX = 142 | # PROJECT_CC = 143 | -------------------------------------------------------------------------------- /openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/CheckPoint.h: -------------------------------------------------------------------------------- 1 | // 2 | // CheckPoint.h 3 | // wave_function_collapse 4 | // 5 | // Created by Andrew Wallace on 3/20/18. 6 | // 7 | 8 | #ifndef CheckPoint_h 9 | #define CheckPoint_h 10 | 11 | #include "ofMain.h" 12 | 13 | class MoveInfo{ 14 | public: 15 | 16 | int col; 17 | int row; 18 | int idNum; 19 | 20 | void clear(){ 21 | col = -1; 22 | row = -1; 23 | idNum = -1; 24 | } 25 | 26 | void set(int _col, int _row, int _id){ 27 | col = _col; 28 | row = _row; 29 | idNum = _id; 30 | } 31 | 32 | }; 33 | 34 | class CheckPoint{ 35 | public: 36 | 37 | CheckPoint * prevPoint; 38 | CheckPoint * nextPoint; 39 | 40 | MoveInfo thisMove; 41 | 42 | vector badMoves; //these will be rules out even though they may seem OK just from reading the board 43 | 44 | CheckPoint(CheckPoint * _prevMove){ 45 | prevPoint = _prevMove; 46 | if (prevPoint != NULL){ 47 | prevPoint->nextPoint = this; 48 | } 49 | 50 | nextPoint = NULL; 51 | 52 | thisMove.clear(); 53 | } 54 | 55 | void move(int col, int row, int idNum){ 56 | thisMove.set(col, row, idNum); 57 | //cout<<"set move: "<badMoves.clear(); 70 | nextPoint->prune(); 71 | delete nextPoint; 72 | } 73 | 74 | nextPoint = NULL; 75 | 76 | } 77 | 78 | int getDepth(){ 79 | if (prevPoint == NULL){ 80 | return 0; 81 | }else{ 82 | return prevPoint->getDepth()+1; 83 | } 84 | } 85 | 86 | 87 | 88 | }; 89 | 90 | 91 | #endif /* CheckPoint_h */ 92 | -------------------------------------------------------------------------------- /src/PotentialTile.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // PotentialTile.cpp 3 | // wave_function_collapse 4 | // 5 | // Created by Andrew Wallace on 3/20/18. 6 | // 7 | 8 | #include "PotentialTile.hpp" 9 | 10 | 11 | void PotentialTile::reset(int maxNumIDs, int _x, int _y){ 12 | state = STATE_INACTIVE; 13 | potentialIDs.clear(); 14 | for (int i=0; i goodIDs; 43 | for (int i=0; i=0; i--){ 49 | bool isGood = false; 50 | for (int k=0; k=0; i--){ 64 | // cout<=0; i--){ 72 | if (potentialIDs[i] == id){ 73 | potentialIDs.erase( potentialIDs.begin()+i ); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/PotentialTile.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // PotentialTile.hpp 3 | // wave_function_collapse 4 | // 5 | // Created by Andrew Wallace on 3/20/18. 6 | // 7 | 8 | #ifndef PotentialTile_hpp 9 | #define PotentialTile_hpp 10 | 11 | #include "ofMain.h" 12 | #include "Tile.h" 13 | 14 | enum tileState { STATE_INACTIVE, STATE_ACTIVE, STATE_SET }; 15 | 16 | class PotentialTile{ 17 | public: 18 | 19 | void reset(int maxNumIDs, int _x, int _y); 20 | void set(int id); 21 | int getRandPotentialID(); 22 | 23 | void ruleOutBasedOnNeightbor(Tile other, int dirToCheck); 24 | void ruleOutID(int id); 25 | 26 | tileState state; 27 | vector potentialIDs; 28 | int setID; 29 | 30 | int x,y; 31 | 32 | }; 33 | 34 | #endif /* PotentialTile_hpp */ 35 | -------------------------------------------------------------------------------- /src/Tile.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tile.h 3 | // wave_function_collapse 4 | // 5 | // Created by Andrew Wallace on 3/19/18. 6 | // 7 | 8 | #ifndef Tile_h 9 | #define Tile_h 10 | 11 | #include "ofMain.h" 12 | 13 | class NeighborInfo{ 14 | public: 15 | int idNum; 16 | float freq; 17 | }; 18 | 19 | class Tile{ 20 | public: 21 | ofImage pic; 22 | int idNum; 23 | 24 | //0-N, 1-E, 2-S, 3-W 25 | vector neighbors[4]; 26 | 27 | void resetNeighborInfo(){ 28 | for (int i=0; i<4; i++){ 29 | neighbors[i].clear(); 30 | } 31 | } 32 | 33 | void noteNeighbor(int dir, int neighborID){ 34 | //is this already in the list? 35 | for (int i=0; i &choices){ 50 | for (int i=0; i 1 && tileSize &sourceTiles, vector> &sourceImage, int &sourceCols, int &sourceRows, int &_tileSize){ 103 | //source tiles 104 | sourceTiles.clear(); 105 | for (int i=0; i &sourceTiles, vector> &sourceImage, int &sourceCols, int &sourceRows, int &_tileSize); 27 | 28 | ofImage sourcePic; 29 | int tileSize; 30 | int cols, rows; 31 | 32 | ofImage testTile, testTileB, testTileC; 33 | 34 | vector allTiles; 35 | vector uniqueTiles; 36 | 37 | bool ready; 38 | }; 39 | 40 | #endif /* TileCutter_hpp */ 41 | -------------------------------------------------------------------------------- /src/TileInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // TileInfo.h 3 | // wave_function_collapse 4 | // 5 | // Created by Andrew Wallace on 3/21/18. 6 | // 7 | 8 | #ifndef TileInfo_h 9 | #define TileInfo_h 10 | 11 | 12 | #include "ofMain.h" 13 | 14 | //used in Tile Cutter 15 | class TileInfo{ 16 | public: 17 | 18 | ofImage pic; 19 | int originalX, originalY; 20 | 21 | int idNum; 22 | }; 23 | 24 | #endif /* TileInfo_h */ 25 | -------------------------------------------------------------------------------- /src/UniqueTileButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // UniqueTileButton.h 3 | // wave_function_collapse 4 | // 5 | // Created by Andrew Wallace on 3/21/18. 6 | // 7 | 8 | #ifndef UniqueTileButton_h 9 | #define UniqueTileButton_h 10 | 11 | #include "ofMain.h" 12 | 13 | class UniqueTileButton{ 14 | public: 15 | 16 | ofRectangle box; 17 | int idNum; 18 | 19 | void setup(int x, int y, int tileSize, int _id){ 20 | box.x = x; 21 | box.y = y; 22 | box.width = tileSize; 23 | box.height = tileSize; 24 | idNum = _id; 25 | } 26 | 27 | bool checkClick(int mouseX, int mouseY){ 28 | return box.inside(mouseX, mouseY); 29 | } 30 | 31 | void draw(ofImage pic, bool isSelected){ 32 | ofSetColor(255); 33 | pic.draw(box.x, box.y, box.width, box.height); 34 | 35 | if (isSelected){ 36 | ofSetColor(0); 37 | ofDrawRectangle(box.x-1, box.y-1, box.width+2, box.height+2); 38 | ofDrawRectangle(box.x-2, box.y-2, box.width+4, box.height+4); 39 | } 40 | } 41 | 42 | }; 43 | 44 | 45 | #endif /* UniqueTileButton_h */ 46 | 47 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1200,608,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //tiles from https://opengameart.org/content/simple-nes-like-platformer-tiles 4 | 5 | //-------------------------------------------------------------- 6 | void ofApp::setup(){ 7 | autoPlay = false; 8 | fastForward = false; 9 | 10 | useTileCutter = true; 11 | useFreq = true; 12 | freqWeight = 0.6f; 13 | 14 | ofSetBackgroundColor(240); 15 | 16 | tileCutter.setup("simples_pimples_cut.png"); 17 | 18 | rootMove = new CheckPoint(NULL); 19 | 20 | //testing 21 | if (false){ 22 | tileCutter.cut(); 23 | tileCutter.setData(sourceTiles, sourceImage, sourceCols, sourceRows, tileSize); 24 | reset(); 25 | resizeOutput(10, 8); 26 | } 27 | 28 | } 29 | 30 | //-------------------------------------------------------------- 31 | void ofApp::resizeOutput(int newCols, int newRows){ 32 | outputCols = MAX(newCols,2); 33 | outputRows = MAX(newRows,2); 34 | 35 | for (int i=0; i sourceCols*tileSize ){ 69 | curY += tileSize+spacing; 70 | curX = spacing; 71 | } 72 | //cout<prune(); 98 | curMove = new CheckPoint(rootMove); 99 | curMove->move(ofRandom(outputCols), ofRandom(outputRows), ofRandom(sourceTiles.size())) ; 100 | updateBoardFromMove(curMove); 101 | } 102 | 103 | //-------------------------------------------------------------- 104 | void ofApp::setSourceFromString(string map){ 105 | int curX = 0; 106 | int curY = 0; 107 | for (int i=0; i0){ 147 | sourceTiles[id].noteNeighbor(0, sourceImage[x][y-1]); 148 | } 149 | 150 | //check to the east 151 | if (x0){ 162 | sourceTiles[id].noteNeighbor(3, sourceImage[x-1][y]); 163 | } 164 | } 165 | } 166 | 167 | 168 | //tetsing info 169 | string labels[4] = {"North", "East", "South", "West" }; 170 | for (int i=0; igetDepth()< choices; 214 | for (int x=0; x tileChoices = getTileChoicesWithFreq( choices[thisChoice].x, choices[thisChoice].y ); 239 | float totalFreq = 0; 240 | for (int i=0; imove( choices[thisChoice].x, choices[thisChoice].y, choices[thisChoice].potentialIDs[thisTile]); 256 | 257 | } 258 | 259 | //-------------------------------------------------------------- 260 | vector ofApp::getTileChoicesWithFreq(int col, int row){ 261 | vector tileChoices; 262 | for (int i=0; i 0){ 271 | if (outputImage[col][row-1].state == STATE_SET){ 272 | int thisID = outputImage[col][row-1].setID; 273 | sourceTiles[thisID].addNeighborFreq(2, tileChoices); 274 | } 275 | } 276 | 277 | //check the tile to our east 278 | if (col < outputCols-1){ 279 | if (outputImage[col+1][row].state == STATE_SET){ 280 | int thisID = outputImage[col+1][row].setID; 281 | sourceTiles[thisID].addNeighborFreq(3, tileChoices); 282 | } 283 | } 284 | 285 | //check the tile to our south 286 | if (row < outputRows-1){ 287 | if (outputImage[col][row+1].state == STATE_SET){ 288 | int thisID = outputImage[col][row+1].setID; 289 | sourceTiles[thisID].addNeighborFreq(0, tileChoices); 290 | } 291 | } 292 | 293 | //check the tile to our west 294 | if (col > 0){ 295 | if (outputImage[col-1][row].state == STATE_SET){ 296 | int thisID = outputImage[col-1][row].setID; 297 | sourceTiles[thisID].addNeighborFreq(1, tileChoices); 298 | } 299 | } 300 | 301 | //multiply them by the weight and then give them all at least 1 frequency 302 | for (int i=0; ithisMove; 325 | if (move.col == -1){ 326 | cout<<"empty move"<badMoves.size(); i++){ 335 | MoveInfo badMove = point->badMoves[i]; 336 | outputImage[badMove.col][badMove.row].ruleOutID(badMove.idNum); 337 | cout<<"hey brah don't do "< 0){ 344 | outputImage[move.col][move.row-1].ruleOutBasedOnNeightbor( sourceTiles[outputImage[move.col][move.row].setID], 0); 345 | } 346 | 347 | //east 348 | if (move.col < outputCols-1){ 349 | outputImage[move.col+1][move.row].ruleOutBasedOnNeightbor( sourceTiles[outputImage[move.col][move.row].setID], 1); 350 | } 351 | 352 | //south 353 | if (move.row < outputRows-1){ 354 | outputImage[move.col][move.row+1].ruleOutBasedOnNeightbor( sourceTiles[outputImage[move.col][move.row].setID], 2); 355 | } 356 | 357 | //west 358 | if (move.col > 0){ 359 | outputImage[move.col-1][move.row].ruleOutBasedOnNeightbor( sourceTiles[outputImage[move.col][move.row].setID], 3); 360 | } 361 | 362 | //validate 363 | validateBoard(); 364 | } 365 | 366 | //-------------------------------------------------------------- 367 | //if any potential tiles have no options, this move is dirt! 368 | void ofApp::validateBoard(){ 369 | bool boardIsValid = true; 370 | for (int x=0; xprevPoint->ruleOutMove(curMove->thisMove); 382 | revertToCheckPoint(curMove->prevPoint); 383 | } 384 | } 385 | 386 | //-------------------------------------------------------------- 387 | void ofApp::update(){ 388 | if (useTileCutter && !tileCutter.ready){ 389 | return; 390 | } 391 | 392 | if (autoPlay){ 393 | int cycles = 1; 394 | if (fastForward){ 395 | cycles = 20; 396 | } 397 | for (int i=0; igetDepth()<getDepth() == 0){ 480 | needFirstMove = true; 481 | } 482 | 483 | curMove = rootMove; 484 | //int steps =0; 485 | while(curMove != point){ 486 | //steps++; 487 | //cout<<"step: "<nextPoint; 490 | } 491 | 492 | updateBoardFromMove(curMove); 493 | 494 | curMove->prune(); 495 | 496 | } 497 | 498 | //-------------------------------------------------------------- 499 | void ofApp::keyPressed(int key){ 500 | //tile cutter commands 501 | if (useTileCutter && !tileCutter.ready){ 502 | if (key == OF_KEY_UP){ 503 | tileCutter.adjustTileSize(1); 504 | } 505 | if (key == OF_KEY_DOWN){ 506 | tileCutter.adjustTileSize(-1); 507 | } 508 | if (key == OF_KEY_RETURN){ 509 | tileCutter.cut(); 510 | tileCutter.setData(sourceTiles, sourceImage, sourceCols, sourceRows, tileSize); 511 | reset(); 512 | resizeOutput(30, 20); 513 | } 514 | return; 515 | } 516 | 517 | if (key == ' '){ 518 | advance(); 519 | updateBoardFromMove(curMove); 520 | } 521 | 522 | if (key == 'z'){ 523 | curMove->prevPoint->ruleOutMove(curMove->thisMove); 524 | revertToCheckPoint(curMove->prevPoint); 525 | } 526 | 527 | if (key == 'a'){ 528 | autoPlay = !autoPlay; 529 | } 530 | if (key == 'f'){ 531 | fastForward = !fastForward; 532 | } 533 | 534 | 535 | if (key == 'r'){ 536 | resetOutput(); 537 | needFirstMove = true; 538 | } 539 | 540 | //frequency 541 | if (key == 'q'){ 542 | useFreq = !useFreq; 543 | } 544 | if (key == '-' && freqWeight > 0){ 545 | freqWeight -= 0.1f; 546 | } 547 | if (key == '+'){ 548 | freqWeight += 0.1f; 549 | } 550 | 551 | //resizing the canvas 552 | if (key == OF_KEY_UP){ 553 | resizeOutput(outputCols, outputRows-1); 554 | } 555 | if (key == OF_KEY_DOWN){ 556 | resizeOutput(outputCols, outputRows+1); 557 | } 558 | if (key == OF_KEY_LEFT){ 559 | resizeOutput(outputCols-1, outputRows); 560 | } 561 | if (key == OF_KEY_RIGHT){ 562 | resizeOutput(outputCols+1, outputRows); 563 | } 564 | 565 | } 566 | 567 | //-------------------------------------------------------------- 568 | void ofApp::keyReleased(int key){ 569 | 570 | } 571 | 572 | //-------------------------------------------------------------- 573 | void ofApp::mouseMoved(int x, int y ){ 574 | 575 | } 576 | 577 | //-------------------------------------------------------------- 578 | void ofApp::mouseDragged(int x, int y, int button){ 579 | if (x < sourceCols*tileSize && y getTileChoicesWithFreq(int col, int row); 25 | void updateBoardFromMove(CheckPoint * point); 26 | void validateBoard(); 27 | 28 | void update(); 29 | void draw(); 30 | 31 | void resetOutput(); 32 | void revertToCheckPoint(CheckPoint * point); 33 | 34 | void keyPressed(int key); 35 | void keyReleased(int key); 36 | void mouseMoved(int x, int y ); 37 | void mouseDragged(int x, int y, int button); 38 | void mousePressed(int x, int y, int button); 39 | void mouseReleased(int x, int y, int button); 40 | void mouseEntered(int x, int y); 41 | void mouseExited(int x, int y); 42 | void windowResized(int w, int h); 43 | void dragEvent(ofDragInfo dragInfo); 44 | void gotMessage(ofMessage msg); 45 | 46 | void drawOnSourceImage(int x, int y, int newID); 47 | 48 | int tileSize; 49 | vector sourceTiles; 50 | 51 | bool needFirstMove; 52 | bool needToGetNeighborInfo; 53 | bool isDone; 54 | 55 | int sourceCols, sourceRows; 56 | vector< vector > sourceImage; 57 | 58 | int outputCols, outputRows; 59 | vector< vector > outputImage; 60 | 61 | CheckPoint * rootMove; 62 | CheckPoint * curMove; 63 | 64 | TileCutter tileCutter; 65 | bool useTileCutter; 66 | 67 | vector uniqueButtons; 68 | int curSelectedButton; 69 | 70 | bool autoPlay; 71 | bool fastForward; 72 | bool useFreq; 73 | float freqWeight; 74 | 75 | 76 | }; 77 | -------------------------------------------------------------------------------- /wave_function_collapse.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 573E3EB32062931F0099F17E /* TileCutter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 573E3EB12062931F0099F17E /* TileCutter.cpp */; }; 11 | 57FB634A206173B000279F06 /* PotentialTile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57FB6348206173B000279F06 /* PotentialTile.cpp */; }; 12 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; }; 13 | E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1D0A3A1BDC003C02F2 /* main.cpp */; }; 14 | E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXContainerItemProxy section */ 18 | E4328147138ABC890047C5CB /* PBXContainerItemProxy */ = { 19 | isa = PBXContainerItemProxy; 20 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 21 | proxyType = 2; 22 | remoteGlobalIDString = E4B27C1510CBEB8E00536013; 23 | remoteInfo = openFrameworks; 24 | }; 25 | E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 28 | proxyType = 1; 29 | remoteGlobalIDString = E4B27C1410CBEB8E00536013; 30 | remoteInfo = openFrameworks; 31 | }; 32 | /* End PBXContainerItemProxy section */ 33 | 34 | /* Begin PBXCopyFilesBuildPhase section */ 35 | E4C2427710CC5ABF004149E2 /* CopyFiles */ = { 36 | isa = PBXCopyFilesBuildPhase; 37 | buildActionMask = 2147483647; 38 | dstPath = ""; 39 | dstSubfolderSpec = 10; 40 | files = ( 41 | ); 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | /* End PBXCopyFilesBuildPhase section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | 573E3EB12062931F0099F17E /* TileCutter.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TileCutter.cpp; sourceTree = ""; }; 48 | 573E3EB22062931F0099F17E /* TileCutter.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = TileCutter.hpp; sourceTree = ""; }; 49 | 573E3EB4206293290099F17E /* TileInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TileInfo.h; sourceTree = ""; }; 50 | 573E3EB520629C050099F17E /* UniqueTileButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UniqueTileButton.h; sourceTree = ""; }; 51 | 57FB63472060868C00279F06 /* Tile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Tile.h; sourceTree = ""; }; 52 | 57FB6348206173B000279F06 /* PotentialTile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PotentialTile.cpp; sourceTree = ""; }; 53 | 57FB6349206173B000279F06 /* PotentialTile.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = PotentialTile.hpp; sourceTree = ""; }; 54 | 57FB634B206175F600279F06 /* CheckPoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CheckPoint.h; sourceTree = ""; }; 55 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; }; 56 | E4B69B5B0A3A1756003C02F2 /* wave_function_collapseDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = wave_function_collapseDebug.app; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | E4B69E1D0A3A1BDC003C02F2 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = src/main.cpp; sourceTree = SOURCE_ROOT; }; 58 | E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = ofApp.cpp; path = src/ofApp.cpp; sourceTree = SOURCE_ROOT; }; 59 | E4B69E1F0A3A1BDC003C02F2 /* ofApp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ofApp.h; path = src/ofApp.h; sourceTree = SOURCE_ROOT; }; 60 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "openFrameworks-Info.plist"; sourceTree = ""; }; 61 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; }; 62 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = ""; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | E4B69B590A3A1756003C02F2 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 6948EE371B920CB800B5AC1A /* local_addons */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | ); 81 | name = local_addons; 82 | sourceTree = ""; 83 | }; 84 | BB4B014C10F69532006C3DED /* addons */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | ); 88 | name = addons; 89 | sourceTree = ""; 90 | }; 91 | E4328144138ABC890047C5CB /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | E4B69B4A0A3A1720003C02F2 = { 100 | isa = PBXGroup; 101 | children = ( 102 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */, 103 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */, 104 | E4B69E1C0A3A1BDC003C02F2 /* src */, 105 | E4EEC9E9138DF44700A80321 /* openFrameworks */, 106 | BB4B014C10F69532006C3DED /* addons */, 107 | 6948EE371B920CB800B5AC1A /* local_addons */, 108 | E4B69B5B0A3A1756003C02F2 /* wave_function_collapseDebug.app */, 109 | ); 110 | sourceTree = ""; 111 | }; 112 | E4B69E1C0A3A1BDC003C02F2 /* src */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | E4B69E1D0A3A1BDC003C02F2 /* main.cpp */, 116 | E4B69E1F0A3A1BDC003C02F2 /* ofApp.h */, 117 | E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */, 118 | 57FB63472060868C00279F06 /* Tile.h */, 119 | 57FB6349206173B000279F06 /* PotentialTile.hpp */, 120 | 57FB6348206173B000279F06 /* PotentialTile.cpp */, 121 | 57FB634B206175F600279F06 /* CheckPoint.h */, 122 | 573E3EB22062931F0099F17E /* TileCutter.hpp */, 123 | 573E3EB12062931F0099F17E /* TileCutter.cpp */, 124 | 573E3EB4206293290099F17E /* TileInfo.h */, 125 | 573E3EB520629C050099F17E /* UniqueTileButton.h */, 126 | ); 127 | path = src; 128 | sourceTree = SOURCE_ROOT; 129 | }; 130 | E4EEC9E9138DF44700A80321 /* openFrameworks */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */, 134 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */, 135 | ); 136 | name = openFrameworks; 137 | sourceTree = ""; 138 | }; 139 | /* End PBXGroup section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | E4B69B5A0A3A1756003C02F2 /* wave_function_collapse */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "wave_function_collapse" */; 145 | buildPhases = ( 146 | E4B69B580A3A1756003C02F2 /* Sources */, 147 | E4B69B590A3A1756003C02F2 /* Frameworks */, 148 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */, 149 | E4C2427710CC5ABF004149E2 /* CopyFiles */, 150 | ); 151 | buildRules = ( 152 | ); 153 | dependencies = ( 154 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */, 155 | ); 156 | name = wave_function_collapse; 157 | productName = myOFApp; 158 | productReference = E4B69B5B0A3A1756003C02F2 /* wave_function_collapseDebug.app */; 159 | productType = "com.apple.product-type.application"; 160 | }; 161 | /* End PBXNativeTarget section */ 162 | 163 | /* Begin PBXProject section */ 164 | E4B69B4C0A3A1720003C02F2 /* Project object */ = { 165 | isa = PBXProject; 166 | attributes = { 167 | LastUpgradeCheck = 0600; 168 | }; 169 | buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "wave_function_collapse" */; 170 | compatibilityVersion = "Xcode 3.2"; 171 | developmentRegion = English; 172 | hasScannedForEncodings = 0; 173 | knownRegions = ( 174 | English, 175 | Japanese, 176 | French, 177 | German, 178 | ); 179 | mainGroup = E4B69B4A0A3A1720003C02F2; 180 | productRefGroup = E4B69B4A0A3A1720003C02F2; 181 | projectDirPath = ""; 182 | projectReferences = ( 183 | { 184 | ProductGroup = E4328144138ABC890047C5CB /* Products */; 185 | ProjectRef = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 186 | }, 187 | ); 188 | projectRoot = ""; 189 | targets = ( 190 | E4B69B5A0A3A1756003C02F2 /* wave_function_collapse */, 191 | ); 192 | }; 193 | /* End PBXProject section */ 194 | 195 | /* Begin PBXReferenceProxy section */ 196 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */ = { 197 | isa = PBXReferenceProxy; 198 | fileType = archive.ar; 199 | path = openFrameworksDebug.a; 200 | remoteRef = E4328147138ABC890047C5CB /* PBXContainerItemProxy */; 201 | sourceTree = BUILT_PRODUCTS_DIR; 202 | }; 203 | /* End PBXReferenceProxy section */ 204 | 205 | /* Begin PBXShellScriptBuildPhase section */ 206 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = { 207 | isa = PBXShellScriptBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | ); 211 | inputPaths = ( 212 | ); 213 | outputPaths = ( 214 | ); 215 | runOnlyForDeploymentPostprocessing = 0; 216 | shellPath = /bin/sh; 217 | shellScript = "mkdir -p \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\n# Copy default icon file into App/Resources\nrsync -aved \"$ICON_FILE\" \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\n# Copy libfmod and change install directory for fmod to run\nrsync -aved ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/\";\ninstall_name_tool -change @executable_path/libfmodex.dylib @executable_path/../Frameworks/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";\n# Copy GLUT framework (must remove for AppStore submissions)\nrsync -aved ../../../libs/glut/lib/osx/GLUT.framework \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/\"\n"; 218 | }; 219 | /* End PBXShellScriptBuildPhase section */ 220 | 221 | /* Begin PBXSourcesBuildPhase section */ 222 | E4B69B580A3A1756003C02F2 /* Sources */ = { 223 | isa = PBXSourcesBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | 573E3EB32062931F0099F17E /* TileCutter.cpp in Sources */, 227 | E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */, 228 | 57FB634A206173B000279F06 /* PotentialTile.cpp in Sources */, 229 | E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */, 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | }; 233 | /* End PBXSourcesBuildPhase section */ 234 | 235 | /* Begin PBXTargetDependency section */ 236 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */ = { 237 | isa = PBXTargetDependency; 238 | name = openFrameworks; 239 | targetProxy = E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */; 240 | }; 241 | /* End PBXTargetDependency section */ 242 | 243 | /* Begin XCBuildConfiguration section */ 244 | E4B69B4E0A3A1720003C02F2 /* Debug */ = { 245 | isa = XCBuildConfiguration; 246 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 247 | buildSettings = { 248 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 249 | COPY_PHASE_STRIP = NO; 250 | DEAD_CODE_STRIPPING = YES; 251 | GCC_AUTO_VECTORIZATION = YES; 252 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 253 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 254 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 255 | GCC_OPTIMIZATION_LEVEL = 0; 256 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 257 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 258 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 259 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 260 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 261 | GCC_WARN_UNUSED_VALUE = NO; 262 | GCC_WARN_UNUSED_VARIABLE = NO; 263 | MACOSX_DEPLOYMENT_TARGET = 10.8; 264 | ONLY_ACTIVE_ARCH = YES; 265 | OTHER_CPLUSPLUSFLAGS = ( 266 | "-D__MACOSX_CORE__", 267 | "-mtune=native", 268 | ); 269 | SDKROOT = macosx; 270 | }; 271 | name = Debug; 272 | }; 273 | E4B69B4F0A3A1720003C02F2 /* Release */ = { 274 | isa = XCBuildConfiguration; 275 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 276 | buildSettings = { 277 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 278 | COPY_PHASE_STRIP = YES; 279 | DEAD_CODE_STRIPPING = YES; 280 | GCC_AUTO_VECTORIZATION = YES; 281 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 282 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 283 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 284 | GCC_OPTIMIZATION_LEVEL = 3; 285 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 286 | GCC_UNROLL_LOOPS = YES; 287 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 288 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 289 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 290 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 291 | GCC_WARN_UNUSED_VALUE = NO; 292 | GCC_WARN_UNUSED_VARIABLE = NO; 293 | MACOSX_DEPLOYMENT_TARGET = 10.8; 294 | OTHER_CPLUSPLUSFLAGS = ( 295 | "-D__MACOSX_CORE__", 296 | "-mtune=native", 297 | ); 298 | SDKROOT = macosx; 299 | }; 300 | name = Release; 301 | }; 302 | E4B69B600A3A1757003C02F2 /* Debug */ = { 303 | isa = XCBuildConfiguration; 304 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 305 | buildSettings = { 306 | COMBINE_HIDPI_IMAGES = YES; 307 | COPY_PHASE_STRIP = NO; 308 | FRAMEWORK_SEARCH_PATHS = ( 309 | "$(inherited)", 310 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 311 | ); 312 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 313 | GCC_DYNAMIC_NO_PIC = NO; 314 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 315 | GCC_MODEL_TUNING = NONE; 316 | ICON = "$(ICON_NAME_DEBUG)"; 317 | ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; 318 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 319 | INSTALL_PATH = /Applications; 320 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 321 | PRODUCT_NAME = "$(TARGET_NAME)Debug"; 322 | WRAPPER_EXTENSION = app; 323 | }; 324 | name = Debug; 325 | }; 326 | E4B69B610A3A1757003C02F2 /* Release */ = { 327 | isa = XCBuildConfiguration; 328 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 329 | buildSettings = { 330 | COMBINE_HIDPI_IMAGES = YES; 331 | COPY_PHASE_STRIP = YES; 332 | FRAMEWORK_SEARCH_PATHS = ( 333 | "$(inherited)", 334 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 335 | ); 336 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 337 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 338 | GCC_MODEL_TUNING = NONE; 339 | ICON = "$(ICON_NAME_RELEASE)"; 340 | ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; 341 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 342 | INSTALL_PATH = /Applications; 343 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 344 | PRODUCT_NAME = "$(TARGET_NAME)"; 345 | WRAPPER_EXTENSION = app; 346 | baseConfigurationReference = E4EB6923138AFD0F00A09F29; 347 | }; 348 | name = Release; 349 | }; 350 | /* End XCBuildConfiguration section */ 351 | 352 | /* Begin XCConfigurationList section */ 353 | E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "wave_function_collapse" */ = { 354 | isa = XCConfigurationList; 355 | buildConfigurations = ( 356 | E4B69B4E0A3A1720003C02F2 /* Debug */, 357 | E4B69B4F0A3A1720003C02F2 /* Release */, 358 | ); 359 | defaultConfigurationIsVisible = 0; 360 | defaultConfigurationName = Release; 361 | }; 362 | E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "wave_function_collapse" */ = { 363 | isa = XCConfigurationList; 364 | buildConfigurations = ( 365 | E4B69B600A3A1757003C02F2 /* Debug */, 366 | E4B69B610A3A1757003C02F2 /* Release */, 367 | ); 368 | defaultConfigurationIsVisible = 0; 369 | defaultConfigurationName = Release; 370 | }; 371 | /* End XCConfigurationList section */ 372 | }; 373 | rootObject = E4B69B4C0A3A1720003C02F2 /* Project object */; 374 | } 375 | -------------------------------------------------------------------------------- /wave_function_collapse.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /wave_function_collapse.xcodeproj/project.xcworkspace/xcuserdata/awallace.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andymasteroffish/wave_function_collapse/559feb7aa61a8c0980c0a627238cc19c6915d544/wave_function_collapse.xcodeproj/project.xcworkspace/xcuserdata/awallace.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /wave_function_collapse.xcodeproj/xcshareddata/xcschemes/wave_function_collapse Debug.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /wave_function_collapse.xcodeproj/xcshareddata/xcschemes/wave_function_collapse Release.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | --------------------------------------------------------------------------------