opengl
(To be removed) Control OpenGL rendering
opengl
has no effect and returns no output. This function will be
removed in a future release. For more information, see Version History.
Syntax
Description
opengl
prints information about the
graphics renderer currently in use by MATLAB®, such as the version, vendor, and graphics features that it supports. Using
this command loads OpenGL®.info
returns the same data
provided with d
= opengl('data')opengl info
, but stores it in a structure.
opengl
uses a software version of
OpenGL to render subsequent graphics for the current MATLAB session. This command works only on Windows® systems.software
opengl
uses a hardware-accelerated
version of OpenGL to render subsequent graphics. If your graphics hardware does not support
hardware-accelerated OpenGL, then MATLAB uses a software version instead.hardware
opengl
uses a
hardware-accelerated version of OpenGL, but disables some advanced graphics features that are unstable with certain
graphics drivers. If your graphics hardware does not support hardware-accelerated
OpenGL, then MATLAB uses a software version instead.hardwarebasic
opengl('save',
sets your preferences so
that future sessions of MATLAB on this computer use the preferred version of OpenGL. Specify pref
)pref
as 'software'
,
'hardware'
, 'hardwarebasic'
, or
'none'
. This command does not affect the current session.
Examples
Input Arguments
More About
Tips
Before R2025a, Painters is an alternate rendering method for screen display and printing. For more information, see the figure’s
Renderer
property.Before R2025a, by default, MATLAB uses hardware-accelerated OpenGL if your graphics hardware supports it. However, in some cases, MATLAB automatically switches to software OpenGL, for example, if it detects:
You are using a graphics driver with known issues or graphics virtualization.
A previous MATLAB session crashed due to a graphics issue. If the previous session was using software OpenGL and crashed, then subsequent sessions use a more stable version of software OpenGL that has fewer capabilities.
You do not have graphics hardware or your graphics hardware does not support hardware OpenGL.