diff --git a/.gitignore b/.gitignore index 6d725d9b..7f520053 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ *.m~ +*.asv +.DS_Store +xcuserdata/ diff --git a/metal/mglMetalTest.m b/metal/mglMetalTest.m index 58ee8dfd..afca3344 100644 --- a/metal/mglMetalTest.m +++ b/metal/mglMetalTest.m @@ -20,7 +20,7 @@ mglSetParam('verbose',1); if runWithXcode - disp(sprintf('Startup mglMetal with XCode now...')) + fprintf('Startup mglMetal with XCode now...\n') mglMetalOpen(nan); else mglMetalOpen; diff --git a/mgllib/mgl.h b/mgllib/mgl.h index 7c99f9e7..6b01829e 100644 --- a/mgllib/mgl.h +++ b/mgllib/mgl.h @@ -242,7 +242,7 @@ void usageError(char *functionName) ///////////////////////// void mglCreateGlobal(void) { - const int ndims[] = {1}; + const mwSize ndims[] = {1}; int nfields = 1; const char *field_names[] = {"version"}; diff --git a/mgllib/mglBindFrameBufferObject.mexmaci64 b/mgllib/mglBindFrameBufferObject.mexmaci64 index 2041dadb..fb5e6342 100755 Binary files a/mgllib/mglBindFrameBufferObject.mexmaci64 and b/mgllib/mglBindFrameBufferObject.mexmaci64 differ diff --git a/mgllib/mglBindTexture.c b/mgllib/mglBindTexture.c index 392cb60a..93b6e578 100644 --- a/mgllib/mglBindTexture.c +++ b/mgllib/mglBindTexture.c @@ -65,7 +65,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) return; } // variables for dimensions of second input - const int *dims = mxGetDimensions(prhs[1]); // rows cols + const mwSize *dims = mxGetDimensions(prhs[1]); // rows cols const mwSize ndims = mxGetNumberOfDimensions(prhs[1]); // allocate space for texture info diff --git a/mgllib/mglBindTexture.mexmaci64 b/mgllib/mglBindTexture.mexmaci64 index d723a355..21c5c650 100755 Binary files a/mgllib/mglBindTexture.mexmaci64 and b/mgllib/mglBindTexture.mexmaci64 differ diff --git a/mgllib/mglBltTexture.mexmaci64 b/mgllib/mglBltTexture.mexmaci64 index 8aa1ed73..9d29213a 100755 Binary files a/mgllib/mglBltTexture.mexmaci64 and b/mgllib/mglBltTexture.mexmaci64 differ diff --git a/mgllib/mglCharToKeycode.c b/mgllib/mglCharToKeycode.c index cd1166b8..a4f2b013 100644 --- a/mgllib/mglCharToKeycode.c +++ b/mgllib/mglCharToKeycode.c @@ -87,7 +87,7 @@ mxArray *charToKeycode(const mxArray *cellArrayOfChars, int returnAllMatches) // we need a cell array, otherwise we use a single array mxArray *keycodeArray; if (returnAllMatches) { - const int dims[2] = {1,nkeys}; + const mwSize dims[2] = {1,nkeys}; keycodeArray = mxCreateCellArray(2,dims); } else diff --git a/mgllib/mglCharToKeycode.mexmaci64 b/mgllib/mglCharToKeycode.mexmaci64 index 971cf002..eeb5088d 100755 Binary files a/mgllib/mglCharToKeycode.mexmaci64 and b/mgllib/mglCharToKeycode.mexmaci64 differ diff --git a/mgllib/mglCreateFrameBufferObject.mexmaci64 b/mgllib/mglCreateFrameBufferObject.mexmaci64 index 7319b2b2..b60d3eda 100755 Binary files a/mgllib/mglCreateFrameBufferObject.mexmaci64 and b/mgllib/mglCreateFrameBufferObject.mexmaci64 differ diff --git a/mgllib/mglDeepColorTest.c b/mgllib/mglDeepColorTest.c index 5fc8c07d..f8cd90c4 100644 --- a/mgllib/mglDeepColorTest.c +++ b/mgllib/mglDeepColorTest.c @@ -57,7 +57,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) } // variables for dimensions - const int *dims = mxGetDimensions(prhs[0]); // rows cols + const mwSize *dims = mxGetDimensions(prhs[0]); // rows cols const mwSize ndims = mxGetNumberOfDimensions(prhs[0]); const size_t n = mxGetNumberOfElements(prhs[0]); int imageWidth, imageHeight; diff --git a/mgllib/mglDeepColorTest.mexmaci64 b/mgllib/mglDeepColorTest.mexmaci64 index bb44064e..f89fa48d 100755 Binary files a/mgllib/mglDeepColorTest.mexmaci64 and b/mgllib/mglDeepColorTest.mexmaci64 differ diff --git a/mgllib/mglDisplayCursor.mexmaci64 b/mgllib/mglDisplayCursor.mexmaci64 index 053f72d1..78c3b3bf 100755 Binary files a/mgllib/mglDisplayCursor.mexmaci64 and b/mgllib/mglDisplayCursor.mexmaci64 differ diff --git a/mgllib/mglDrawImage.c b/mgllib/mglDrawImage.c index 44f71a1d..efb26855 100644 --- a/mgllib/mglDrawImage.c +++ b/mgllib/mglDrawImage.c @@ -26,7 +26,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) int ri, gi, bi, ix, iy, inputM, inputN, pixelIndex = 0; size_t numPoints; double *inputMatrix, *centerPos; - const int *dims; + const mwSize *dims; GLfloat *pixelData, rv, gv, bv, rasterX, rasterY; GLdouble currentRasterPosition[4]; diff --git a/mgllib/mglDrawImage.mexmaci64 b/mgllib/mglDrawImage.mexmaci64 index 555140d9..1e03dde4 100755 Binary files a/mgllib/mglDrawImage.mexmaci64 and b/mgllib/mglDrawImage.mexmaci64 differ diff --git a/mgllib/mglFillOval.mexmaci64 b/mgllib/mglFillOval.mexmaci64 index af7dcc01..ba0a541a 100755 Binary files a/mgllib/mglFillOval.mexmaci64 and b/mgllib/mglFillOval.mexmaci64 differ diff --git a/mgllib/mglFillRect.mexmaci64 b/mgllib/mglFillRect.mexmaci64 index 63ebca5d..7cfa33d9 100755 Binary files a/mgllib/mglFillRect.mexmaci64 and b/mgllib/mglFillRect.mexmaci64 differ diff --git a/mgllib/mglFillRect3D.mexmaci64 b/mgllib/mglFillRect3D.mexmaci64 index 425fe3c6..34fb823c 100755 Binary files a/mgllib/mglFillRect3D.mexmaci64 and b/mgllib/mglFillRect3D.mexmaci64 differ diff --git a/mgllib/mglFrameGrab.c b/mgllib/mglFrameGrab.c index 1ee01b14..6133fa08 100644 --- a/mgllib/mglFrameGrab.c +++ b/mgllib/mglFrameGrab.c @@ -74,7 +74,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) } // create the matlab array for returning data - int dims[3]; + mwSize dims[3]; dims[0] = (mwSize)width;dims[1] = (mwSize)height;dims[2] = 3; plhs[0] = mxCreateNumericArray(3,dims,mxSINGLE_CLASS,mxREAL); GLfloat *outPtr = (GLfloat*)mxGetPr(plhs[0]); diff --git a/mgllib/mglFrameGrab.mexmaci64 b/mgllib/mglFrameGrab.mexmaci64 index 4ee77b91..e12b8a33 100755 Binary files a/mgllib/mglFrameGrab.mexmaci64 and b/mgllib/mglFrameGrab.mexmaci64 differ diff --git a/mgllib/mglGetKeys.mexmaci64 b/mgllib/mglGetKeys.mexmaci64 index 1dca7328..e86cdfc6 100755 Binary files a/mgllib/mglGetKeys.mexmaci64 and b/mgllib/mglGetKeys.mexmaci64 differ diff --git a/mgllib/mglGetMouse.c b/mgllib/mglGetMouse.c index c1ecd656..a39372c1 100644 --- a/mgllib/mglGetMouse.c +++ b/mgllib/mglGetMouse.c @@ -50,7 +50,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) // create the output structure const char *fieldNames[] = {"buttons","x","y" }; - const int outDims[2] = {1, 1}; + const mwSize outDims[2] = {1, 1}; plhs[0] = mxCreateStructArray(1,outDims,3,fieldNames); // and the field for X diff --git a/mgllib/mglGetMouse.mexmaci64 b/mgllib/mglGetMouse.mexmaci64 index a90bde9e..606a5b6f 100755 Binary files a/mgllib/mglGetMouse.mexmaci64 and b/mgllib/mglGetMouse.mexmaci64 differ diff --git a/mgllib/mglGetSecs.mexmaci64 b/mgllib/mglGetSecs.mexmaci64 index 238a8eb1..1867dbdb 100755 Binary files a/mgllib/mglGetSecs.mexmaci64 and b/mgllib/mglGetSecs.mexmaci64 differ diff --git a/mgllib/mglGetWindowPos.mexmaci64 b/mgllib/mglGetWindowPos.mexmaci64 index f27fbc5d..3b281c20 100755 Binary files a/mgllib/mglGetWindowPos.mexmaci64 and b/mgllib/mglGetWindowPos.mexmaci64 differ diff --git a/mgllib/mglGluAnnulus.mexmaci64 b/mgllib/mglGluAnnulus.mexmaci64 index 8fc2aac7..af775678 100755 Binary files a/mgllib/mglGluAnnulus.mexmaci64 and b/mgllib/mglGluAnnulus.mexmaci64 differ diff --git a/mgllib/mglGluDisk.mexmaci64 b/mgllib/mglGluDisk.mexmaci64 index 34fb5e04..ad0d48c5 100755 Binary files a/mgllib/mglGluDisk.mexmaci64 and b/mgllib/mglGluDisk.mexmaci64 differ diff --git a/mgllib/mglGluPartialDisk.mexmaci64 b/mgllib/mglGluPartialDisk.mexmaci64 index 3d95547d..91d9c2ec 100755 Binary files a/mgllib/mglGluPartialDisk.mexmaci64 and b/mgllib/mglGluPartialDisk.mexmaci64 differ diff --git a/mgllib/mglIsCursorVisible.mexmaci64 b/mgllib/mglIsCursorVisible.mexmaci64 index 16a1fcf9..8facdd89 100755 Binary files a/mgllib/mglIsCursorVisible.mexmaci64 and b/mgllib/mglIsCursorVisible.mexmaci64 differ diff --git a/mgllib/mglMakeMetal.m b/mgllib/mglMakeMetal.m index b61337e0..c2261209 100644 --- a/mgllib/mglMakeMetal.m +++ b/mgllib/mglMakeMetal.m @@ -52,6 +52,8 @@ function mglMakeMetal(varargin) %%%%%%%%%%%%%%% function info = processArgs(args) +info.verbose = false; + % Gets the mgl header file mgl.h to compare the timestamps % note that this will cd into the mgllib directory if it % doesn't find the mgl.h file in the current directory @@ -205,7 +207,7 @@ function mglMakeMetal(varargin) % function will return 1 for yes and 0 for no. If toall is set to 1, then % 'Yes to all' will be an option, which if selected will return inf % -function r = askuser(question,toall,useDialog) +function r = askuser(question,toall,useDialog,verbose) % check arguments if ~any(nargin == [1 2 3]) @@ -215,14 +217,12 @@ function mglMakeMetal(varargin) if ieNotDefined('toall'),toall = 0;,end if ieNotDefined('useDialog'),useDialog=0;end +if ieNotDefined('verbose'),verbose=false;end % if explicitly set to useDialog then use dialog, otherwise % check verbose setting if useDialog verbose = 1; -else - verbose = mrGetPref('verbose'); - if strcmp(verbose,'Yes'),verbose = 1;else,verbose = 0;end end r = []; diff --git a/mgllib/mglMetalExecutableName.m b/mgllib/mglMetalExecutableName.m index 9d0551a5..171a3477 100644 --- a/mgllib/mglMetalExecutableName.m +++ b/mgllib/mglMetalExecutableName.m @@ -8,30 +8,39 @@ % purpose: Returns the name of the mglMetal application % usage: mglAppName = mglMetalExecutableName; % -function [metalAppName metalDir] = mglMetalExecutableName +function [metalAppName, metalDir] = mglMetalExecutableName -mglAppName = ''; +metalAppName = ''; metalDir = ''; -% find where the runtime is (why is this so hard with xcode?) -mglSearchDir = '~/Library/Developer/XCode/DerivedData/mglMetal*'; -mglDir = dir(mglSearchDir); -if isempty(mglSearchDir) - disp(sprintf('(mglOpen) Could not find mglMetal executable in %s. Perhaps you need to compile in XCode',mglSearchDir)) - return +% Search xCode for the mglMetal build output. (why is this so hard with xcode?) +xCodeOutputPath = '~/Library/Developer/XCode/DerivedData/'; +xCodeOutputDir = dir(xCodeOutputPath); +if isempty(xCodeOutputDir) + fprintf('(mglOpen) Could not find mglMetal executable in %s. Perhaps you need to compile in XCode\n',xCodeOutputPath) + return end -mglDir = fullfile(mglDir(1).folder,mglDir(1).name); -mglDir = fullfile(mglDir,'Build','Products','Release'); -metalAppName = fullfile(mglDir,'mglMetal.app'); -if ~isdir(metalAppName) - disp(sprintf('(mglOpen) Could not find mglMetal executable in %s. Perhaps you need to compile in XCode',metalAppName)) - return + +% Choose the most recent "mglMetal-" build dir. +isMglMetal = cellfun(@(s)startsWith(s, "mglMetal-"), {xCodeOutputDir.name}); +mglMetalDirs = xCodeOutputDir(isMglMetal); +[~, sortedIndexes] = sort([mglMetalDirs.datenum]); +mglMetalDir = mglMetalDirs(sortedIndexes(end)); + +% Get the full absolute path to the most recent mglMetal app. +mglMetalPath = fullfile(mglMetalDir.folder, mglMetalDir.name, 'Build','Products','Release'); +metalAppName = fullfile(mglMetalPath, 'mglMetal.app'); +if ~isfolder(metalAppName) + fprintf('(mglOpen) Could not find mglMetal app folder %s. Perhaps you need to compile in XCode\n',mglMetalPath) + return end -%get directory where mglMetal app runs from +% Get working directory where mglMetal app runs from. +% This seems to be a macOs/xCode convention, so good to use this during +% development. +% Once stable, we may be able to choose any dir to run from? metalDir = '~/Library/Containers/gru.mglMetal/Data'; -if ~isdir(metalDir) - disp(sprintf('(mglMetalTest) Please compile the mglMetal app which should create the dir: %s',metalDir)); - while ~isdir(metalDir) - end +if ~isfolder(metalDir) + fprintf('(mglMetalTest) Please compile the mglMetal app which should create the dir: %s\n',metalDir); + return end diff --git a/mgllib/mglMetalOpen.m b/mgllib/mglMetalOpen.m index fb981ecc..5851e147 100644 --- a/mgllib/mglMetalOpen.m +++ b/mgllib/mglMetalOpen.m @@ -14,13 +14,13 @@ function mglMetalOpen(whichScreen,screenWidth,screenHeight) if nargin == 0 - whichScreen = 1; + whichScreen = 1; end % get mglMetal application name -[metalAppName metalDir] = mglMetalExecutableName; +[metalAppName, metalDir] = mglMetalExecutableName; if isempty(metalAppName) - return + return end % create the mgl global variable @@ -57,13 +57,13 @@ function mglMetalOpen(whichScreen,screenWidth,screenHeight) % check if mglMetal is running if mglMetalIsRunning - disp(sprintf('(mglMetalOpen) mglMetal executable is already running')); - % then kill it - mglMetalShutdown; + fprintf('(mglMetalOpen) mglMetal executable is already running\n'); + % then kill it + mglMetalShutdown; end %start up mglMetal if ~isnan(whichScreen) - disp(sprintf('(mglMetalOpen) Starting up mglMetal executable: %s',metalAppName)); - system(sprintf('open %s',metalAppName)); + fprintf('(mglMetalOpen) Starting up mglMetal executable: %s\n',metalAppName); + system(sprintf('open %s',metalAppName)); end diff --git a/mgllib/mglPoints2c.mexmaci64 b/mgllib/mglPoints2c.mexmaci64 index 0a01960a..2cd19d6b 100755 Binary files a/mgllib/mglPoints2c.mexmaci64 and b/mgllib/mglPoints2c.mexmaci64 differ diff --git a/mgllib/mglPoints3.mexmaci64 b/mgllib/mglPoints3.mexmaci64 index a3c65482..7eeddd01 100755 Binary files a/mgllib/mglPoints3.mexmaci64 and b/mgllib/mglPoints3.mexmaci64 differ diff --git a/mgllib/mglPolygon.mexmaci64 b/mgllib/mglPolygon.mexmaci64 index a3c66690..b6fd811a 100755 Binary files a/mgllib/mglPolygon.mexmaci64 and b/mgllib/mglPolygon.mexmaci64 differ diff --git a/mgllib/mglPolygon3D.mexmaci64 b/mgllib/mglPolygon3D.mexmaci64 index cb1fa3d5..866dea29 100755 Binary files a/mgllib/mglPolygon3D.mexmaci64 and b/mgllib/mglPolygon3D.mexmaci64 differ diff --git a/mgllib/mglPrivateClose.mexmaci64 b/mgllib/mglPrivateClose.mexmaci64 index 2fd89259..204a4db9 100755 Binary files a/mgllib/mglPrivateClose.mexmaci64 and b/mgllib/mglPrivateClose.mexmaci64 differ diff --git a/mgllib/mglPrivateCreateTexture.c b/mgllib/mglPrivateCreateTexture.c index 95b6c34f..dc679a68 100644 --- a/mgllib/mglPrivateCreateTexture.c +++ b/mgllib/mglPrivateCreateTexture.c @@ -156,7 +156,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) } // variables for dimensions - const int *dims = mxGetDimensions(prhs[0]); // rows cols + const mwSize *dims = mxGetDimensions(prhs[0]); // rows cols const mwSize ndims = mxGetNumberOfDimensions(prhs[0]); const size_t n = mxGetNumberOfElements(prhs[0]); int imageWidth, imageHeight; @@ -434,7 +434,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) // create the output structure const char *fieldNames[] = {"textureNumber","imageWidth","imageHeight","textureAxes","textureType","liveBuffer" }; - int outDims[2] = {1, 1}; + mwSize outDims[2] = {1, 1}; plhs[0] = mxCreateStructArray(1,outDims,6,fieldNames); // now set the textureNumber field diff --git a/mgllib/mglPrivateCreateTexture.mexmaci64 b/mgllib/mglPrivateCreateTexture.mexmaci64 index fc19f6fa..03f7a40c 100755 Binary files a/mgllib/mglPrivateCreateTexture.mexmaci64 and b/mgllib/mglPrivateCreateTexture.mexmaci64 differ diff --git a/mgllib/mglPrivateDeleteSound.mexmaci64 b/mgllib/mglPrivateDeleteSound.mexmaci64 index d91a1ee4..54f40b40 100755 Binary files a/mgllib/mglPrivateDeleteSound.mexmaci64 and b/mgllib/mglPrivateDeleteSound.mexmaci64 differ diff --git a/mgllib/mglPrivateDeleteTexture.mexmaci64 b/mgllib/mglPrivateDeleteTexture.mexmaci64 index 79fa0d6a..843a03cd 100755 Binary files a/mgllib/mglPrivateDeleteTexture.mexmaci64 and b/mgllib/mglPrivateDeleteTexture.mexmaci64 differ diff --git a/mgllib/mglPrivateDescribeDisplays.mexmaci64 b/mgllib/mglPrivateDescribeDisplays.mexmaci64 index 87224e6f..d1f80625 100755 Binary files a/mgllib/mglPrivateDescribeDisplays.mexmaci64 and b/mgllib/mglPrivateDescribeDisplays.mexmaci64 differ diff --git a/mgllib/mglPrivateGetGammaTable.c b/mgllib/mglPrivateGetGammaTable.c index dffa0409..aaa6f550 100644 --- a/mgllib/mglPrivateGetGammaTable.c +++ b/mgllib/mglPrivateGetGammaTable.c @@ -61,7 +61,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) formulaResults = getGammaFormula(&redMin,&redMax,&redGamma,&greenMin,&greenMax,&greenGamma,&blueMin,&blueMax,&blueGamma); if (result) { - int ndims[] = {1};int nFormulaFields = 9;int nTableFields = 3; + mwSize ndims[] = {1};int nFormulaFields = 9;int nTableFields = 3; const char *formulaFieldNames[] = {"redMin","redMax","redGamma","greenMin","greenMax","greenGamma","blueMin","blueMax","blueGamma","redTable","greenTable","blueTable"}; const char *tableFieldNames[] = {"redTable","greenTable","blueTable"}; if (formulaResults) diff --git a/mgllib/mglPrivateGetGammaTable.mexmaci64 b/mgllib/mglPrivateGetGammaTable.mexmaci64 index e5e19171..3bb5152a 100755 Binary files a/mgllib/mglPrivateGetGammaTable.mexmaci64 and b/mgllib/mglPrivateGetGammaTable.mexmaci64 differ diff --git a/mgllib/mglPrivateGetKeyEvent.c b/mgllib/mglPrivateGetKeyEvent.c index ccd2eca9..50bc442a 100644 --- a/mgllib/mglPrivateGetKeyEvent.c +++ b/mgllib/mglPrivateGetKeyEvent.c @@ -156,7 +156,7 @@ mxArray *makeOutputStructure(double **outptrCharCode, double **outptrKeyCode, do // create the output structure mxArray *plhs; const char *fieldNames[] = {"charCode","keyCode","keyboard","when" }; - int outDims[2] = {1, 1}; + mwSize outDims[2] = {1, 1}; plhs = mxCreateStructArray(1,outDims,4,fieldNames); // Create the output fields diff --git a/mgllib/mglPrivateGetKeyEvent.mexmaci64 b/mgllib/mglPrivateGetKeyEvent.mexmaci64 index ab8be91f..2fda4bda 100755 Binary files a/mgllib/mglPrivateGetKeyEvent.mexmaci64 and b/mgllib/mglPrivateGetKeyEvent.mexmaci64 differ diff --git a/mgllib/mglPrivateGetMouseEvent.c b/mgllib/mglPrivateGetMouseEvent.c index a793269d..17df40de 100644 --- a/mgllib/mglPrivateGetMouseEvent.c +++ b/mgllib/mglPrivateGetMouseEvent.c @@ -152,7 +152,7 @@ mxArray *makeOutputStructure(double **outptrX, double **outptrY, double **outptr // create the output structure mxArray *plhs; const char *fieldNames[] = {"x","y","button","when" }; - int outDims[2] = {1, 1}; + mwSize outDims[2] = {1, 1}; plhs = mxCreateStructArray(1,outDims,4,fieldNames); // set the fields diff --git a/mgllib/mglPrivateGetMouseEvent.mexmaci64 b/mgllib/mglPrivateGetMouseEvent.mexmaci64 index eb2b2d03..6baf41a8 100755 Binary files a/mgllib/mglPrivateGetMouseEvent.mexmaci64 and b/mgllib/mglPrivateGetMouseEvent.mexmaci64 differ diff --git a/mgllib/mglPrivateInstallSound.c b/mgllib/mglPrivateInstallSound.c index 60b6d7be..9c49ec1f 100644 --- a/mgllib/mglPrivateInstallSound.c +++ b/mgllib/mglPrivateInstallSound.c @@ -252,7 +252,7 @@ unsigned long installSoundFromData(int *d, unsigned int nChannels, unsigned int NSSound* sound = [[NSSound alloc] initWithData:data]; if (verbose) - mexPrintf("(mglPrivateInstallSound:installSoundFromData) Sound pointer: %i\n",(unsigned int)sound); + mexPrintf("(mglPrivateInstallSound:installSoundFromData) Sound pointer: %lu\n",(unsigned long)sound); // data is no longer needed. [data release]; diff --git a/mgllib/mglPrivateInstallSound.mexmaci64 b/mgllib/mglPrivateInstallSound.mexmaci64 index 9859e840..7c97336a 100755 Binary files a/mgllib/mglPrivateInstallSound.mexmaci64 and b/mgllib/mglPrivateInstallSound.mexmaci64 differ diff --git a/mgllib/mglPrivateKeycodeToChar.mexmaci64 b/mgllib/mglPrivateKeycodeToChar.mexmaci64 index 912e819d..56259e73 100755 Binary files a/mgllib/mglPrivateKeycodeToChar.mexmaci64 and b/mgllib/mglPrivateKeycodeToChar.mexmaci64 differ diff --git a/mgllib/mglPrivateListener.c b/mgllib/mglPrivateListener.c index bbf97191..dfe47338 100644 --- a/mgllib/mglPrivateListener.c +++ b/mgllib/mglPrivateListener.c @@ -177,7 +177,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) pthread_mutex_unlock(&mut); // return event as a matlab structure const char *fieldNames[] = {"when","keyCode","shift","control","alt","command","capslock","keyboard"}; - int outDims[2] = {1, 1}; + mwSize outDims[2] = {1, 1}; plhs[0] = mxCreateStructArray(1,outDims,8,fieldNames); mxSetField(plhs[0],0,"when",mxCreateDoubleMatrix(1,1,mxREAL)); @@ -220,7 +220,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) int i = 0; // return event as a matlab structure const char *fieldNames[] = {"when","keyCode"}; - int outDims[2] = {1, 1}; + mwSize outDims[2] = {1, 1}; plhs[0] = mxCreateStructArray(1,outDims,2,fieldNames); mxSetField(plhs[0],0,"when",mxCreateDoubleMatrix(1,count,mxREAL)); @@ -275,7 +275,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) pthread_mutex_unlock(&mut); // return event as a matlab structure const char *fieldNames[] = {"when","buttons","x","y","clickState"}; - int outDims[2] = {1, 1}; + mwSize outDims[2] = {1, 1}; plhs[0] = mxCreateStructArray(1,outDims,5,fieldNames); mxSetField(plhs[0],0,"when",mxCreateDoubleMatrix(1,1,mxREAL)); @@ -313,7 +313,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) int i = 0; // return event as a matlab structure const char *fieldNames[] = {"when","buttons","x","y","clickState"}; - int outDims[2] = {1, 1}; + mwSize outDims[2] = {1, 1}; plhs[0] = mxCreateStructArray(1,outDims,5,fieldNames); mxSetField(plhs[0],0,"when",mxCreateDoubleMatrix(1,count,mxREAL)); diff --git a/mgllib/mglPrivateListener.mexmaci64 b/mgllib/mglPrivateListener.mexmaci64 index 162d6dc2..548976c5 100755 Binary files a/mgllib/mglPrivateListener.mexmaci64 and b/mgllib/mglPrivateListener.mexmaci64 differ diff --git a/mgllib/mglPrivateMoveWindow.mexmaci64 b/mgllib/mglPrivateMoveWindow.mexmaci64 index e6068940..a0699beb 100755 Binary files a/mgllib/mglPrivateMoveWindow.mexmaci64 and b/mgllib/mglPrivateMoveWindow.mexmaci64 differ diff --git a/mgllib/mglPrivateMovie.c b/mgllib/mglPrivateMovie.c index 2cfc0bf4..5a751b70 100644 --- a/mgllib/mglPrivateMovie.c +++ b/mgllib/mglPrivateMovie.c @@ -81,7 +81,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) if (moviePointer != 0) { // create the output structure const char *fieldNames[] = {"filename","moviePointer"}; - int outDims[2] = {1, 1}; + mwSize outDims[2] = {1, 1}; plhs[0] = mxCreateStructArray(1,outDims,2,fieldNames); // add the field for filename, but leave it empty since mglMovie will fill it in @@ -475,7 +475,7 @@ mxArray *doMovieCommand(int command, unsigned long moviePointer, const mxArray * int totalReadCount = 0,bufSize = widthAndHeight[0]*widthAndHeight[1]*3; // note that width/height are intentionally swaped here so that // image displays correctly when you do imagesc - int dims[3] = {widthAndHeight[1], widthAndHeight[0], 3}; + mwSize dims[3] = {widthAndHeight[1], widthAndHeight[0], 3}; retval = mxCreateNumericArray(3, dims, mxUINT8_CLASS, mxREAL); uint8 *outputPtr = (uint8 *)mxGetPr(retval), *outputPtrReader = outputPtr; // need to read in blocks diff --git a/mgllib/mglPrivateMovie.mexmaci64 b/mgllib/mglPrivateMovie.mexmaci64 index ed21d74e..ee2c8b07 100755 Binary files a/mgllib/mglPrivateMovie.mexmaci64 and b/mgllib/mglPrivateMovie.mexmaci64 differ diff --git a/mgllib/mglPrivateOpen.c b/mgllib/mglPrivateOpen.c index f5687546..b0bce598 100644 --- a/mgllib/mglPrivateOpen.c +++ b/mgllib/mglPrivateOpen.c @@ -676,7 +676,7 @@ unsigned long cglOpen(double *displayNumber, int *screenWidth, int *screenHeight attribs[i++] = kCGLPFADoubleBuffer; attribs[i++] = kCGLPFAStencilSize; attribs[i++] = (CGLPixelFormatAttribute)8; attribs[i++] = kCGLPFADisplayMask; attribs[i++] = (CGLPixelFormatAttribute)displayMask; - attribs[i++] = (CGLPixelFormatAttribute)NULL; + attribs[i++] = 0; CGLPixelFormatObj pixelFormatObj; GLint numPixelFormats; diff --git a/mgllib/mglPrivateOpen.mexmaci64 b/mgllib/mglPrivateOpen.mexmaci64 index 58b1a176..7042fa05 100755 Binary files a/mgllib/mglPrivateOpen.mexmaci64 and b/mgllib/mglPrivateOpen.mexmaci64 differ diff --git a/mgllib/mglPrivatePlaySound.mexmaci64 b/mgllib/mglPrivatePlaySound.mexmaci64 index f9e7d5d2..3fba4be7 100755 Binary files a/mgllib/mglPrivatePlaySound.mexmaci64 and b/mgllib/mglPrivatePlaySound.mexmaci64 differ diff --git a/mgllib/mglPrivatePostEvent.mexmaci64 b/mgllib/mglPrivatePostEvent.mexmaci64 index b4089d0a..59b961ae 100755 Binary files a/mgllib/mglPrivatePostEvent.mexmaci64 and b/mgllib/mglPrivatePostEvent.mexmaci64 differ diff --git a/mgllib/mglPrivateSetGammaTable.mexmaci64 b/mgllib/mglPrivateSetGammaTable.mexmaci64 index 8f22087d..83d8ec5a 100755 Binary files a/mgllib/mglPrivateSetGammaTable.mexmaci64 and b/mgllib/mglPrivateSetGammaTable.mexmaci64 differ diff --git a/mgllib/mglPrivateSetSound.mexmaci64 b/mgllib/mglPrivateSetSound.mexmaci64 index 537bb9dc..0daa20bd 100755 Binary files a/mgllib/mglPrivateSetSound.mexmaci64 and b/mgllib/mglPrivateSetSound.mexmaci64 differ diff --git a/mgllib/mglPrivateSwitchDisplay.mexmaci64 b/mgllib/mglPrivateSwitchDisplay.mexmaci64 index 5f8a017b..d0dddeab 100755 Binary files a/mgllib/mglPrivateSwitchDisplay.mexmaci64 and b/mgllib/mglPrivateSwitchDisplay.mexmaci64 differ diff --git a/mgllib/mglPrivateSystemCheck.mexmaci64 b/mgllib/mglPrivateSystemCheck.mexmaci64 index d09e1130..cdc9a0c4 100755 Binary files a/mgllib/mglPrivateSystemCheck.mexmaci64 and b/mgllib/mglPrivateSystemCheck.mexmaci64 differ diff --git a/mgllib/mglPrivateText.mexmaci64 b/mgllib/mglPrivateText.mexmaci64 index 4d8c04a4..61fb336e 100755 Binary files a/mgllib/mglPrivateText.mexmaci64 and b/mgllib/mglPrivateText.mexmaci64 differ diff --git a/mgllib/mglPrivateVolume.mexmaci64 b/mgllib/mglPrivateVolume.mexmaci64 index e48c0a49..01634720 100755 Binary files a/mgllib/mglPrivateVolume.mexmaci64 and b/mgllib/mglPrivateVolume.mexmaci64 differ diff --git a/mgllib/mglResolution.c b/mgllib/mglResolution.c index c709d572..97da7c37 100644 --- a/mgllib/mglResolution.c +++ b/mgllib/mglResolution.c @@ -40,7 +40,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) int frameRate,screenWidth,screenHeight,bitDepth,displayNumber,numDisplays,defaultDisplayNum,changeResolution = 0; int requestedScreenWidth, requestedScreenHeight, requestedFrameRate, requestedBitDepth; const char *fieldNames[] = {"displayNumber","numDisplays","screenWidth","screenHeight","frameRate","bitDepth"}; - const int outDims[2] = {1, 1}; + const mwSize outDims[2] = {1, 1}; // get how many displays there are at which one is the default. getNumDisplaysAndDefault(&numDisplays,&defaultDisplayNum); diff --git a/mgllib/mglResolution.mexmaci64 b/mgllib/mglResolution.mexmaci64 index 5de44d58..71c13db0 100755 Binary files a/mgllib/mglResolution.mexmaci64 and b/mgllib/mglResolution.mexmaci64 differ diff --git a/mgllib/mglSetMousePosition.mexmaci64 b/mgllib/mglSetMousePosition.mexmaci64 index 3e165508..fee92764 100755 Binary files a/mgllib/mglSetMousePosition.mexmaci64 and b/mgllib/mglSetMousePosition.mexmaci64 differ diff --git a/mgllib/mglShader.mexmaci64 b/mgllib/mglShader.mexmaci64 index 2ece48d9..f0787dad 100755 Binary files a/mgllib/mglShader.mexmaci64 and b/mgllib/mglShader.mexmaci64 differ diff --git a/mgllib/mglSocketClose.mexmaci64 b/mgllib/mglSocketClose.mexmaci64 index b7782ca6..88cdbe6b 100755 Binary files a/mgllib/mglSocketClose.mexmaci64 and b/mgllib/mglSocketClose.mexmaci64 differ diff --git a/mgllib/mglSocketDataWaiting.mexmaci64 b/mgllib/mglSocketDataWaiting.mexmaci64 index da858df0..629bca5f 100755 Binary files a/mgllib/mglSocketDataWaiting.mexmaci64 and b/mgllib/mglSocketDataWaiting.mexmaci64 differ diff --git a/mgllib/mglSocketOpen.c b/mgllib/mglSocketOpen.c index 709c0784..1e56b575 100644 --- a/mgllib/mglSocketOpen.c +++ b/mgllib/mglSocketOpen.c @@ -73,7 +73,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) } // make socket non-blocking - if (fcntl(socketDescriptor, F_SETFL, O_BLOCK) < 0) { + if (fcntl(socketDescriptor, F_SETFL, O_NONBLOCK) < 0) { mexPrintf("(mglSocketOpen) Could not set socket to non-blocking. This will not record io events until a connection is made.\n"); // return plhs[0] = mxCreateDoubleMatrix(0,0,mxREAL); @@ -116,7 +116,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) // return structure const char *fieldNames[] = {"socketName","socketDescriptor","connectionDescriptor"}; - const int outDims[2] = {1, 1}; + const mwSize outDims[2] = {1, 1}; plhs[0] = mxCreateStructArray(1,outDims,3,fieldNames); mxSetField(plhs[0],0,"socketName",mxCreateString(socketName)); mxSetField(plhs[0],0,"socketDescriptor",mxCreateDoubleMatrix(1,1,mxREAL)); diff --git a/mgllib/mglSocketOpen.mexmaci64 b/mgllib/mglSocketOpen.mexmaci64 new file mode 100755 index 00000000..dd48e861 Binary files /dev/null and b/mgllib/mglSocketOpen.mexmaci64 differ diff --git a/mgllib/mglSocketRead.c b/mgllib/mglSocketRead.c index ea91be50..7594fcf2 100644 --- a/mgllib/mglSocketRead.c +++ b/mgllib/mglSocketRead.c @@ -96,7 +96,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) size_t buflen = dataSize * len; // allocate space for buffer - const int dims[2] = {1,len}; + const mwSize dims[2] = {1,len}; plhs[0] = mxCreateNumericArray(1,dims,mxDOUBLE_CLASS,mxREAL); // read data diff --git a/mgllib/mglSocketRead.mexmaci64 b/mgllib/mglSocketRead.mexmaci64 index db3077b4..0547632e 100755 Binary files a/mgllib/mglSocketRead.mexmaci64 and b/mgllib/mglSocketRead.mexmaci64 differ diff --git a/mgllib/mglSocketWrite.mexmaci64 b/mgllib/mglSocketWrite.mexmaci64 index 6b729aa2..4833c914 100755 Binary files a/mgllib/mglSocketWrite.mexmaci64 and b/mgllib/mglSocketWrite.mexmaci64 differ diff --git a/mgllib/mglStencilCreateBegin.mexmaci64 b/mgllib/mglStencilCreateBegin.mexmaci64 index ed4e7207..772a3c4c 100755 Binary files a/mgllib/mglStencilCreateBegin.mexmaci64 and b/mgllib/mglStencilCreateBegin.mexmaci64 differ diff --git a/mgllib/mglStencilCreateEnd.mexmaci64 b/mgllib/mglStencilCreateEnd.mexmaci64 index 8e85df7d..f3e47fda 100755 Binary files a/mgllib/mglStencilCreateEnd.mexmaci64 and b/mgllib/mglStencilCreateEnd.mexmaci64 differ diff --git a/mgllib/mglStencilSelect.mexmaci64 b/mgllib/mglStencilSelect.mexmaci64 index cb0e0034..88970a62 100755 Binary files a/mgllib/mglStencilSelect.mexmaci64 and b/mgllib/mglStencilSelect.mexmaci64 differ diff --git a/mgllib/mglStrokeText.mexmaci64 b/mgllib/mglStrokeText.mexmaci64 index 8059144e..ddfb1992 100755 Binary files a/mgllib/mglStrokeText.mexmaci64 and b/mgllib/mglStrokeText.mexmaci64 differ diff --git a/mgllib/mglTransform.mexmaci64 b/mgllib/mglTransform.mexmaci64 index 104afd05..ffda68e8 100755 Binary files a/mgllib/mglTransform.mexmaci64 and b/mgllib/mglTransform.mexmaci64 differ diff --git a/mgllib/mglUnbindFrameBufferObject.mexmaci64 b/mgllib/mglUnbindFrameBufferObject.mexmaci64 index a28854e1..6db5b5da 100755 Binary files a/mgllib/mglUnbindFrameBufferObject.mexmaci64 and b/mgllib/mglUnbindFrameBufferObject.mexmaci64 differ