Skip to content

Commit

Permalink
Merge pull request #36 from benjamin-heasly/ben-h-getting-started
Browse files Browse the repository at this point in the history
Ben h getting started
  • Loading branch information
justingardner authored Nov 10, 2021
2 parents 4ccf3cd + 9978edc commit b12174c
Show file tree
Hide file tree
Showing 83 changed files with 68 additions and 56 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
*.m~
*.asv
.DS_Store
xcuserdata/
2 changes: 1 addition & 1 deletion metal/mglMetalTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion mgllib/mgl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"};

Expand Down
Binary file modified mgllib/mglBindFrameBufferObject.mexmaci64
Binary file not shown.
2 changes: 1 addition & 1 deletion mgllib/mglBindTexture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified mgllib/mglBindTexture.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglBltTexture.mexmaci64
Binary file not shown.
2 changes: 1 addition & 1 deletion mgllib/mglCharToKeycode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified mgllib/mglCharToKeycode.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglCreateFrameBufferObject.mexmaci64
Binary file not shown.
2 changes: 1 addition & 1 deletion mgllib/mglDeepColorTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Binary file modified mgllib/mglDeepColorTest.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglDisplayCursor.mexmaci64
Binary file not shown.
2 changes: 1 addition & 1 deletion mgllib/mglDrawImage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
Binary file modified mgllib/mglDrawImage.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglFillOval.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglFillRect.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglFillRect3D.mexmaci64
Binary file not shown.
2 changes: 1 addition & 1 deletion mgllib/mglFrameGrab.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
Binary file modified mgllib/mglFrameGrab.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglGetKeys.mexmaci64
Binary file not shown.
2 changes: 1 addition & 1 deletion mgllib/mglGetMouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified mgllib/mglGetMouse.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglGetSecs.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglGetWindowPos.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglGluAnnulus.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglGluDisk.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglGluPartialDisk.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglIsCursorVisible.mexmaci64
Binary file not shown.
8 changes: 4 additions & 4 deletions mgllib/mglMakeMetal.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])
Expand All @@ -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 = [];
Expand Down
47 changes: 28 additions & 19 deletions mgllib/mglMetalExecutableName.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 8 additions & 8 deletions mgllib/mglMetalOpen.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Binary file modified mgllib/mglPoints2c.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPoints3.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPolygon.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPolygon3D.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivateClose.mexmaci64
Binary file not shown.
4 changes: 2 additions & 2 deletions mgllib/mglPrivateCreateTexture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
Binary file modified mgllib/mglPrivateCreateTexture.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivateDeleteSound.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivateDeleteTexture.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivateDescribeDisplays.mexmaci64
Binary file not shown.
2 changes: 1 addition & 1 deletion mgllib/mglPrivateGetGammaTable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Binary file modified mgllib/mglPrivateGetGammaTable.mexmaci64
Binary file not shown.
2 changes: 1 addition & 1 deletion mgllib/mglPrivateGetKeyEvent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified mgllib/mglPrivateGetKeyEvent.mexmaci64
Binary file not shown.
2 changes: 1 addition & 1 deletion mgllib/mglPrivateGetMouseEvent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified mgllib/mglPrivateGetMouseEvent.mexmaci64
Binary file not shown.
2 changes: 1 addition & 1 deletion mgllib/mglPrivateInstallSound.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Binary file modified mgllib/mglPrivateInstallSound.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivateKeycodeToChar.mexmaci64
Binary file not shown.
8 changes: 4 additions & 4 deletions mgllib/mglPrivateListener.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down
Binary file modified mgllib/mglPrivateListener.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivateMoveWindow.mexmaci64
Binary file not shown.
4 changes: 2 additions & 2 deletions mgllib/mglPrivateMovie.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Binary file modified mgllib/mglPrivateMovie.mexmaci64
Binary file not shown.
2 changes: 1 addition & 1 deletion mgllib/mglPrivateOpen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Binary file modified mgllib/mglPrivateOpen.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivatePlaySound.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivatePostEvent.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivateSetGammaTable.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivateSetSound.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivateSwitchDisplay.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivateSystemCheck.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivateText.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglPrivateVolume.mexmaci64
Binary file not shown.
2 changes: 1 addition & 1 deletion mgllib/mglResolution.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Binary file modified mgllib/mglResolution.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglSetMousePosition.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglShader.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglSocketClose.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglSocketDataWaiting.mexmaci64
Binary file not shown.
4 changes: 2 additions & 2 deletions mgllib/mglSocketOpen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down
Binary file added mgllib/mglSocketOpen.mexmaci64
Binary file not shown.
2 changes: 1 addition & 1 deletion mgllib/mglSocketRead.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified mgllib/mglSocketRead.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglSocketWrite.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglStencilCreateBegin.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglStencilCreateEnd.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglStencilSelect.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglStrokeText.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglTransform.mexmaci64
Binary file not shown.
Binary file modified mgllib/mglUnbindFrameBufferObject.mexmaci64
Binary file not shown.

0 comments on commit b12174c

Please sign in to comment.