wxWidgets: wxGLAttributes Class Reference

| Version: 3.1.5

Loading...
Searching...
No Matches
Public Member Functions | List of all members
wxGLAttributes Class Reference
Class List by Category » OpenGL

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.1/wxWidgets3.1-3.1.5-3.x86_64/src/wxWidgets-3.1.5/interface/wx/glcanvas.h>`

Inheritance diagram for wxGLAttributes:
[legend]

## Detailed Description

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:

wxGLAttributes dispAttrs;
dispAttrs.PlatformDefaults().MinRGBA(8, 8, 8, 8).DoubleBuffer().Depth(32).EndList();
wxGLAttributes
This class is used for setting display attributes when drawing through OpenGL ("Pixel format" in MSW ...
Definition glcanvas.h:143
wxGLAttributes::MinRGBA
wxGLAttributes & MinRGBA(int mRed, int mGreen, int mBlue, int mAlpha)
Specifies the minimal number of bits for each colour and alpha.
wxGLAttributes::PlatformDefaults
wxGLAttributes & PlatformDefaults()
Set some typically needed attributes.
wxGLAttributes::DoubleBuffer
wxGLAttributes & DoubleBuffer()
Requests using double buffering.
wxGLAttributes::Depth
wxGLAttributes & Depth(int val)
Specifies number of bits for Z-buffer.
wxGLAttributes::EndList
void EndList()
The set of attributes must end with this one; otherwise, the GPU may display nothing at all.

Notice that EndList() must be used as the last attribute. Not adding it will likely result in nothing displayed at all.

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 wxGLAttribsBase class. While WGL_/GLX_/NS attributes can be added, PFD_ (for MSW) can not.

Since
  3.1.0

##

Library: wxGL

<>< =''>:</>&;&;< =''>\ </></>

See also
  wxGLCanvas, wxGLContext, wxGLAttribsBase, wxGLContextAttrs

## Public Member Functions
wxGLAttributes & | RGBA ()
| Use true colour instead of colour index rendering for each pixel.
wxGLAttributes & | BufferSize (int val)
| Specifies the number of bits for colour buffer.
wxGLAttributes & | Level (int val)
| Specifies the framebuffer level.
wxGLAttributes & | DoubleBuffer ()
| Requests using double buffering.
wxGLAttributes & | Stereo ()
| Use stereoscopic display.
wxGLAttributes & | AuxBuffers (int val)
| Specifies the number of auxiliary buffers.
wxGLAttributes & | MinRGBA (int mRed, int mGreen, int mBlue, int mAlpha)
| Specifies the minimal number of bits for each colour and alpha.
wxGLAttributes & | Depth (int val)
| Specifies number of bits for Z-buffer.
wxGLAttributes & | Stencil (int val)
| Specifies number of bits for stencil buffer.
wxGLAttributes & | MinAcumRGBA (int mRed, int mGreen, int mBlue, int mAlpha)
| Specifies the minimal number of bits for each accumulator channel.
wxGLAttributes & | SampleBuffers (int val)
| Use multi-sampling support (antialiasing).
wxGLAttributes & | Samplers (int val)
| Specifies the number of samplers per pixel.
wxGLAttributes & | FrameBuffersRGB ()
| Used to request a frame buffer sRGB capable.
wxGLAttributes & | PlatformDefaults ()
| Set some typically needed attributes.
wxGLAttributes & | Defaults ()
| wxWidgets defaults: RGBA, Z-depth 16 bits, double buffering, 1 sample buffer, 4 samplers.
void | EndList ()
| The set of attributes must end with this one; otherwise, the GPU may display nothing at all.
Public Member Functions inherited from wxGLAttribsBase
| wxGLAttribsBase ()
| Constructor.
void | AddAttribute (int attribute)
| Adds an integer value to the list of attributes.
void | AddAttribBits (int searchVal, int combineVal)
| Combine (bitwise OR) a given value with the existing one, if any.
void | SetNeedsARB (bool needsARB=true)
| Sets the necessity of using special ARB-functions (e.g.
void | Reset ()
| Delete contents and sets ARB-flag to false.
const int * | GetGLAttrs () const
| Returns a pointer to the internal list of attributes.
int | GetSize ()
| Returns the size of the internal list of attributes.
bool | NeedsARB () const
| Returns the current value of the ARB-flag.

## Member Function Documentation

## ◆ AuxBuffers()

wxGLAttributes & wxGLAttributes::AuxBuffers | ( | int | val | ) |

Specifies the number of auxiliary buffers.

Parameters

  val | The number of auxiliary buffers.

## ◆ BufferSize()

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.

Parameters

  val | The number of bits.

## ◆ Defaults()

wxGLAttributes & wxGLAttributes::Defaults | ( |  | ) |

wxWidgets defaults: RGBA, Z-depth 16 bits, double buffering, 1 sample buffer, 4 samplers.

See also
  PlatformDefaults()

## ◆ Depth()

wxGLAttributes & wxGLAttributes::Depth | ( | int | val | ) |

Specifies number of bits for Z-buffer.

Parameters

  val | Number of bits for Z-buffer (typically 0, 16 or 32).

## ◆ DoubleBuffer()

wxGLAttributes & wxGLAttributes::DoubleBuffer | ( |  | ) |

Requests using double buffering.

## ◆ EndList()

void wxGLAttributes::EndList | ( |  | ) |

The set of attributes must end with this one; otherwise, the GPU may display nothing at all.

## ◆ FrameBuffersRGB()

wxGLAttributes & wxGLAttributes::FrameBuffersRGB | ( |  | ) |

Used to request a frame buffer sRGB capable.

It makes no effect for macOS.

## ◆ Level()

wxGLAttributes & wxGLAttributes::Level | ( | int | val | ) |

Specifies the framebuffer level.

It makes no effect for macOS.

Parameters

  val | 0 for main buffer, >0 for overlay, <0 for underlay.

## ◆ MinAcumRGBA()

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.

Parameters

  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.

## ◆ MinRGBA()

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.

Parameters

  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.

## ◆ PlatformDefaults()

wxGLAttributes & wxGLAttributes::PlatformDefaults | ( |  | ) |

Set some typically needed attributes.

E.g. full-acceleration on MSW.

See also
  Defaults()

## ◆ RGBA()

wxGLAttributes & wxGLAttributes::RGBA | ( |  | ) |

Use true colour instead of colour index rendering for each pixel.

It makes no effect for macOS.

## ◆ SampleBuffers()

wxGLAttributes & wxGLAttributes::SampleBuffers | ( | int | val | ) |

Use multi-sampling support (antialiasing).

Parameters

  val | Number of sample buffers, usually 1.

## ◆ Samplers()

wxGLAttributes & wxGLAttributes::Samplers | ( | int | val | ) |

Specifies the number of samplers per pixel.

Parameters

  val | Number of samplers, e.g. 4 for 2x2 antialiasing.

## ◆ Stencil()

wxGLAttributes & wxGLAttributes::Stencil | ( | int | val | ) |

Specifies number of bits for stencil buffer.

Parameters

  val | Number of bits.

## ◆ Stereo()

wxGLAttributes & wxGLAttributes::Stereo | ( |  | ) |

Use stereoscopic display.