MATLAB Function Reference |
Syntax
openglselection_mode
opengl info s = opengl('data') opengl software opengl hardware opengl verbose opengl quiet openglDriverBugWorkaround
opengl('DriverBugWorkaround
',WorkaroundState)
Description
The OpenGL autoselection mode applies when the RendererMode
of the figure is auto
. Possible values for selection_mode
are
autoselect
- allows OpenGL to be automatically selected if OpenGL is available and if there is graphics hardware on the host machine.
neverselect
- disables autoselection of OpenGL.
advise
- prints a message to the command window if OpenGL rendering is advised, but RenderMode
is set to manual
.
opengl
, by itself, returns the current autoselection state.
Note that the autoselection state only specifies whether OpenGL should or should not be considered for rendering; it does not explicitly set the rendering to OpenGL. You can do this by setting the Renderer
property of the figure to OpenGL
. For example,
prints information with the version and vendor of the OpenGL on your system. Also indicates wether your system is currently using hardware of software OpenGL and the state of various driver bug workarounds. Note that calling opengl
info
opengl info
loads the OpenGL Library.
For example, the following output is generated on a Windows XP computer that uses ATI Technologies graphics hardware:
>> opengl info Version = 1.3.4010 WinXP Release Vendor = ATI Technologies Inc. Renderer = RADEON 9600SE x86/SSE2 MaxTextureSize = 2048 Visual = 05 (RGB 16 bits(05 06 05 00) zdepth 16, Hardware Accelerated, Opengl, Double Buffered, Window) Software = false # of Extensions = 85 Driver Bug Workarounds: OpenGLBitmapZbufferBug = 0 OpenGLWobbleTesselatorBug = 0 OpenGLLineSmoothingBug = 0 OpenGLDockingBug = 0 OpenGLClippedImageBug = 0
Note that different computer systems may not list all OpenGL bugs.
s = opengl('data')
returns a structure containing the same data that is displayed when you call opengl info
, with the exception of the driver bug workaround state.
opengl software
forces MATLAB to use software OpenGL rendering instead of hardware OpenGL.
opengl hardware
reverses the opengl software
command and enables MATLAB to use hardware OpenGL rendering if it is available. If your computer does not have OpenGL hardware acceleration, MATLAB automatically switches to software OpenGL rendering.
Note that on UNIX systems, the software
or hardware
options with the opengl
command works only if MATLAB has not yet used the OpenGL renderer or you have not issued the opengl info
command (which attempts to load the OpenGL Library).
opengl verbose
displays verbose messages about OpenGL initialization (if OpenGL is not already loaded) and other runtime messages.
opengl quiet
disables verbose message setting.
opengl
queries the state of the specified driver bug workaround. Use the command DriverBugWorkaround
opengl info
to see a list of all driver bug workarounds. See Driver Bug Workarounds for more information.
opengl('
sets the state of the specified driver bug workaround. You can set WorkaroundState to one of three values:DriverBugWorkaround
',WorkaroundState)
0
- Disable the specified DriverBugWorkaround
(if enabled) and do not allow MATLAB to autoselect this workaround.
1
- Enable the specified DriverBugWorkaround
.
-1
- Set the specified DriverBugWorkaround
to autoselection mode, which allows MATLAB to enable this workaround if the requisite conditions exist.
MATLAB enables various OpenGL driver bug workarounds when it detects certain known problems with installed hardware. However, because there are many versions of graphics drivers, you might encounter situations when MATLAB does not enable a workaround that would solve a problem you are having with OpenGL rendering.
This section describes the symptoms that each workaround is designed to correct so you can decide if you want to try using one to fix an OpenGL rendering problem.
Use the opengl info
command to see what driver bug workarounds are available on your computer.
Note These workarounds have not been tested under all driver combinations and therefore might produce undesirable results under certain conditions. |
Symptom: text with background color (including data tips) and text displayed on image, patch, or surface objects is not visible when using OpenGL renderer.
Possible side effect: text is always on top of other objects.
Symptom: Rendering complex patch object causes segmentation violation and returns a tesselator error message in the stack trace.
Symptom: Lines with a LineWidth
greater than 3 look bad.
Symptom: MATLAB crashes when you dock a figure that has its Renderer
property set to opengl
.
colorbar
displays) do not display when the Renderer
property set to opengl
.
See Also
Figure Renderer
property for information on autoselection.
openfig | openvar |
© 1994-2005 The MathWorks, Inc.