#include <wx/glcanvas.h>
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:
Notice that EndList() must be used as the last attribute. Not adding it will likely result in nothing displayed at all.
Public Member Functions | |
wxGLAttributes & | RGBA () |
Use true colour instead of colour index rendering for each pixel. More... | |
wxGLAttributes & | BufferSize (int val) |
Specifies the number of bits for colour buffer. More... | |
wxGLAttributes & | Level (int val) |
Specifies the framebuffer level. More... | |
wxGLAttributes & | DoubleBuffer () |
Requests using double buffering. More... | |
wxGLAttributes & | Stereo () |
Use stereoscopic display. More... | |
wxGLAttributes & | AuxBuffers (int val) |
Specifies the number of auxiliary buffers. More... | |
wxGLAttributes & | MinRGBA (int mRed, int mGreen, int mBlue, int mAlpha) |
Specifies the minimal number of bits for each colour and alpha. More... | |
wxGLAttributes & | Depth (int val) |
Specifies number of bits for Z-buffer. More... | |
wxGLAttributes & | Stencil (int val) |
Specifies number of bits for stencil buffer. More... | |
wxGLAttributes & | MinAcumRGBA (int mRed, int mGreen, int mBlue, int mAlpha) |
Specifies the minimal number of bits for each accumulator channel. More... | |
wxGLAttributes & | SampleBuffers (int val) |
Use multi-sampling support (antialiasing). More... | |
wxGLAttributes & | Samplers (int val) |
Specifies the number of samplers per pixel. More... | |
wxGLAttributes & | FrameBuffersRGB () |
Used to request a frame buffer sRGB capable. More... | |
wxGLAttributes & | PlatformDefaults () |
Set some typically needed attributes. More... | |
wxGLAttributes & | Defaults () |
wxWidgets defaults: RGBA, Z-depth 16 bits, double buffering, 1 sample buffer, 4 samplers. More... | |
void | EndList () |
The set of attributes must end with this one; otherwise, the GPU may display nothing at all. More... | |
Public Member Functions inherited from wxGLAttribsBase | |
wxGLAttribsBase () | |
Constructor. More... | |
void | AddAttribute (int attribute) |
Adds an integer value to the list of attributes. More... | |
void | AddAttribBits (int searchVal, int combineVal) |
Combine (bitwise OR) a given value with the existing one, if any. More... | |
void | SetNeedsARB (bool needsARB=true) |
Sets the necessity of using special ARB-functions (e.g. More... | |
void | Reset () |
Delete contents and sets ARB-flag to false. More... | |
const int * | GetGLAttrs () const |
Returns a pointer to the internal list of attributes. More... | |
int | GetSize () |
Returns the size of the internal list of attributes. More... | |
bool | NeedsARB () const |
Returns the current value of the ARB-flag. More... | |
wxGLAttributes& wxGLAttributes::AuxBuffers | ( | int | val | ) |
Specifies the number of auxiliary buffers.
val | The number of auxiliary buffers. |
wxGLAttributes& wxGLAttributes::BufferSize | ( | int | val | ) |
Specifies the number of bits for colour buffer.
For RGBA it's normally the sum of the bits per each component.
val | The number of bits. |
wxGLAttributes& wxGLAttributes::Defaults | ( | ) |
wxWidgets defaults: RGBA, Z-depth 16 bits, double buffering, 1 sample buffer, 4 samplers.
wxGLAttributes& wxGLAttributes::Depth | ( | int | val | ) |
Specifies number of bits for Z-buffer.
val | Number of bits for Z-buffer (typically 0, 16 or 32). |
wxGLAttributes& wxGLAttributes::DoubleBuffer | ( | ) |
Requests using double buffering.
void wxGLAttributes::EndList | ( | ) |
The set of attributes must end with this one; otherwise, the GPU may display nothing at all.
wxGLAttributes& wxGLAttributes::FrameBuffersRGB | ( | ) |
Used to request a frame buffer sRGB capable.
It makes no effect for macOS.
wxGLAttributes& wxGLAttributes::Level | ( | int | val | ) |
Specifies the framebuffer level.
It makes no effect for macOS.
val | 0 for main buffer, >0 for overlay, <0 for underlay. |
wxGLAttributes& wxGLAttributes::MinAcumRGBA | ( | int | mRed, |
int | mGreen, | ||
int | mBlue, | ||
int | 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 | The minimal number of bits for red accumulator. |
mGreen | The minimal number of bits for green accumulator. |
mBlue | The minimal number of bits for blue accumulator. |
mAlpha | The minimal number of bits for alpha accumulator. |
wxGLAttributes& wxGLAttributes::MinRGBA | ( | int | mRed, |
int | mGreen, | ||
int | mBlue, | ||
int | 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 | The minimal number of bits for colour red. |
mGreen | The minimal number of bits for colour green. |
mBlue | The minimal number of bits for colour blue. |
mAlpha | The minimal number of bits for alpha channel. |
wxGLAttributes& wxGLAttributes::PlatformDefaults | ( | ) |
wxGLAttributes& wxGLAttributes::RGBA | ( | ) |
Use true colour instead of colour index rendering for each pixel.
It makes no effect for macOS.
wxGLAttributes& wxGLAttributes::SampleBuffers | ( | int | val | ) |
Use multi-sampling support (antialiasing).
val | Number of sample buffers, usually 1. |
wxGLAttributes& wxGLAttributes::Samplers | ( | int | val | ) |
Specifies the number of samplers per pixel.
val | Number of samplers, e.g. 4 for 2x2 antialiasing. |
wxGLAttributes& wxGLAttributes::Stencil | ( | int | val | ) |
Specifies number of bits for stencil buffer.
val | Number of bits. |
wxGLAttributes& wxGLAttributes::Stereo | ( | ) |
Use stereoscopic display.