This class is used for setting display attributes when drawing through OpenGL (“Pixel format” in MSW and OSX parlance, “Configs” in X11).
While framebuffer depth and samplers are still common, attributes like layers overlay or not using True
colour are rarely used nowadays.
Attributes can be chained. For example:
dispAttrs = wx.glcanvas.GLAttributes()
dispAttrs.PlatformDefaults().MinRGBA(8, 8, 8, 8).DoubleBuffer().Depth(32).EndList()
Notice that EndList
must be used as the last attribute. Not adding it will likely result in nothing displayed at all.
New in version 4.1/wxWidgets-3.1.0.
Note
Not all of platform-dependant available attributes are implemented in wxWidgets. You can set other attributes by using AddAttribute
and AddAttribBits
functions inherited from the base wx.glcanvas.GLAttribsBase class. While WGL_/GLX_/NS attributes can be added, PFD_
(for MSW) can not.
See also
wx.glcanvas.GLCanvas, wx.glcanvas.GLContext, wx.glcanvas.GLAttribsBase, wx.glcanvas.GLContextAttrs
Specifies the number of auxiliary buffers. |
|
Specifies the number of bits for colour buffer. |
|
wxWidgets defaults: |
|
Specifies number of bits for Z-buffer. |
|
Requests using double buffering. |
|
The set of attributes must end with this one; otherwise, the |
|
Used to request a frame buffer sRGB capable. |
|
Specifies the framebuffer level. |
|
Specifies the minimal number of bits for each accumulator channel. |
|
Specifies the minimal number of bits for each colour and alpha. |
|
Set some typically needed attributes. |
|
Use |
|
Use multi-sampling support (antialiasing). |
|
Specifies the number of samplers per pixel. |
|
Specifies number of bits for stencil buffer. |
|
Use stereoscopic display. |
wx.glcanvas.
GLAttributes
(GLAttribsBase)¶This class is used for setting display attributes when drawing through OpenGL (“Pixel format” in MSW and OSX parlance, “Configs” in X11).
AuxBuffers
(self, val)¶Specifies the number of auxiliary buffers.
val (int) – The number of auxiliary buffers.
BufferSize
(self, val)¶Specifies the number of bits for colour buffer.
For RGBA
it’s normally the sum of the bits per each component.
val (int) – The number of bits.
Defaults
(self)¶wxWidgets defaults: RGBA
, Z-depth 16 bits, double buffering, 1 sample buffer, 4 samplers.
See also
Depth
(self, val)¶Specifies number of bits for Z-buffer.
val (int) – Number of bits for Z-buffer (typically 0, 16 or 32).
DoubleBuffer
(self)¶Requests using double buffering.
EndList
(self)¶The set of attributes must end with this one; otherwise, the GPU
may display nothing at all.
FrameBuffersRGB
(self)¶Used to request a frame buffer sRGB capable.
It makes no effect for macOS.
Level
(self, val)¶Specifies the framebuffer level.
It makes no effect for macOS.
val (int) – 0 for main buffer, >0 for overlay, <0 for underlay.
MinAcumRGBA
(self, mRed, mGreen, mBlue, mAlpha)¶Specifies the minimal number of bits for each accumulator channel.
On MSW and OSX this function also sets the size of the accumulation buffer.
mRed (int) – The minimal number of bits for red accumulator.
mGreen (int) – The minimal number of bits for green accumulator.
mBlue (int) – The minimal number of bits for blue accumulator.
mAlpha (int) – The minimal number of bits for alpha accumulator.
MinRGBA
(self, mRed, mGreen, mBlue, mAlpha)¶Specifies the minimal number of bits for each colour and alpha.
On MSW and OSX this function also sets the size of the colour buffer.
mRed (int) – The minimal number of bits for colour red.
mGreen (int) – The minimal number of bits for colour green.
mBlue (int) – The minimal number of bits for colour blue.
mAlpha (int) – The minimal number of bits for alpha channel.
PlatformDefaults
(self)¶Set some typically needed attributes.
E.g. full-acceleration on MSW.
See also
RGBA
(self)¶Use True
colour instead of colour index rendering for each pixel.
It makes no effect for macOS.
SampleBuffers
(self, val)¶Use multi-sampling support (antialiasing).
val (int) – Number of sample buffers, usually 1.
Samplers
(self, val)¶Specifies the number of samplers per pixel.
val (int) – Number of samplers, e.g. 4 for 2x2 antialiasing.
Stencil
(self, val)¶Specifies number of bits for stencil buffer.
val (int) – Number of bits.
Stereo
(self)¶Use stereoscopic display.