This shows you the differences between two versions of the page.
mgl:functionreferencescreen [2009/12/23 02:40] |
mgl:functionreferencescreen [2010/07/13 23:18] |
||
---|---|---|---|
Line 33: | Line 33: | ||
**purpose:** close OpenGL screen\\ **usage:** mglClose | **purpose:** close OpenGL screen\\ **usage:** mglClose | ||
====== Other screen functions ====== | ====== Other screen functions ====== | ||
- | ===== mglResolution ===== | + | ===== mglResolution: Get and set display resolution ===== |
+ | **availability**: [[mgl:beta|mgl 2.0]]\\ | ||
**usage**: mglResolution(<whichScreen>, <screenWidth>, <screenHeight>, <frameRate>, <bitDepth>)\\ | **usage**: mglResolution(<whichScreen>, <screenWidth>, <screenHeight>, <frameRate>, <bitDepth>)\\ | ||
**purpose**: Gets or sets the resolution of a display | **purpose**: Gets or sets the resolution of a display | ||
Line 100: | Line 101: | ||
**usage:** [displayInfo computerInfo] = mglDescribeDisplays()\\ **purpose:** Gets information about your displays (as an array of structs with values for each monitor). As well as a single struct with info about your computer. | **usage:** [displayInfo computerInfo] = mglDescribeDisplays()\\ **purpose:** Gets information about your displays (as an array of structs with values for each monitor). As well as a single struct with info about your computer. | ||
- | |||
===== mglFrameGrab: Frame grab to a matlab matrix ===== | ===== mglFrameGrab: Frame grab to a matlab matrix ===== | ||
Line 111: | Line 111: | ||
mglScreenCoordinates; | mglScreenCoordinates; | ||
mglClearScreen([0 0 0]); | mglClearScreen([0 0 0]); | ||
- | global MGL; | + | mglPoints2(mglGetParam('screenWidth')*rand(5000,1),mglGetParam('screenHeight')*rand(5000,1)); |
- | mglPoints2(MGL.screenWidth*rand(5000,1),MGL.screenHeight*rand(5000,1)); | + | mglPolygon([0 0 mglGetParam('screenWidth') mglGetParam('screenWidth')],[mglGetParam('screenHeight')/3 mglGetParam('screenHeight')*2/3 mglGetParam('screenHeight')*2/3 mglGetParam('screenHeight')/3],0); |
- | mglPolygon([0 0 MGL.screenWidth MGL.screenWidth],[MGL.screenHeight/3 MGL.screenHeight*2/3 MGL.screenHeight*2/3 MGL.screenHeight/3],0); | + | mglTextSet('Helvetica',32,[1 1 1]); |
- | mglTextSet('Helvetica',32,[1 1 1]); | + | mglTextDraw('Frame Grab',[mglGetParam('screenWidth')/2 mglGetParam('screenHeight')/2]); |
- | mglTextDraw('Frame Grab',[MGL.screenWidth/2 MGL.screenHeight/2]); | + | |
frame = mglFrameGrab; | frame = mglFrameGrab; | ||
- | mglFlush | ||
imagesc(mean(frame,3)');colormap('gray') | imagesc(mean(frame,3)');colormap('gray') | ||
+ | mglFlush | ||
+ |