Line 15... |
Line 15... |
15 |
char cmd[64];
|
15 |
char cmd[64];
|
16 |
if (nrhs < 1 || mxGetString(prhs[0], cmd, sizeof(cmd)))
|
16 |
if (nrhs < 1 || mxGetString(prhs[0], cmd, sizeof(cmd)))
|
17 |
mexErrMsgTxt("First input should be a command string less than 64 characters long.");
|
17 |
mexErrMsgTxt("First input should be a command string less than 64 characters long.");
|
18 |
|
18 |
|
19 |
// Static methods
|
19 |
// Static methods
|
20 |
// DisplayInfo
|
20 |
// GetScreenInfo
|
21 |
if (!strcmp("GetScreenInfo", cmd)) {
|
21 |
if (!strcmp("GetScreenInfo", cmd)) {
|
22 |
// Call the method
|
22 |
// Call the method
|
23 |
std::vector<ScreenInfo> screenInfo;
|
23 |
std::vector<ScreenInfo> screenInfo;
|
24 |
screenInfo = OpenGLContext::GetScreenInfo();
|
24 |
screenInfo = OpenGLContext::GetScreenInfo();
|
- |
|
25 |
mexPrintf("%i", screenInfo.size());
|
25 |
const char* fieldNames[] = {"screenNum","resX","resY"};
|
26 |
const char* fieldNames[] = {"screenNum","resX","resY"};
|
26 |
plhs[0] = mxCreateStructMatrix(1, screenInfo.size(), 3, fieldNames);
|
27 |
plhs[0] = mxCreateStructMatrix(1, screenInfo.size(), 3, fieldNames);
|
27 |
for (unsigned int i=0; i<screenInfo.size(); i++) {
|
28 |
for (unsigned int i=0; i<screenInfo.size(); i++) {
|
28 |
mxSetFieldByNumber(plhs[0], i, 0, mxCreateDoubleScalar(i));
|
29 |
mxSetFieldByNumber(plhs[0], i, 0, mxCreateDoubleScalar(i));
|
29 |
mxSetFieldByNumber(plhs[0], i, 1, mxCreateDoubleScalar(screenInfo[i].resX));
|
30 |
mxSetFieldByNumber(plhs[0], i, 1, mxCreateDoubleScalar(screenInfo[i].resX));
|