[−][src]Struct qt_gui::QSurfaceFormat
The QSurfaceFormat class represents the format of a QSurface.
C++ class: QSurfaceFormat
.
The QSurfaceFormat class represents the format of a QSurface.
The format includes the size of the color buffers, red, green, and blue; the size of the alpha buffer; the size of the depth and stencil buffers; and number of samples per pixel for multisampling. In addition, the format contains surface configuration parameters such as OpenGL profile and version for rendering, whether or not to enable stereo buffers, and swap behaviour.
Methods
impl QSurfaceFormat
[src]
pub unsafe fn alpha_buffer_size(&self) -> c_int
[src]
Get the size in bits of the alpha channel of the color buffer.
Calls C++ function: int QSurfaceFormat::alphaBufferSize() const
.
Get the size in bits of the alpha channel of the color buffer.
See also setAlphaBufferSize().
pub unsafe fn blue_buffer_size(&self) -> c_int
[src]
Get the size in bits of the blue channel of the color buffer.
Calls C++ function: int QSurfaceFormat::blueBufferSize() const
.
Get the size in bits of the blue channel of the color buffer.
See also setBlueBufferSize().
pub unsafe fn color_space(&self) -> ColorSpace
[src]
Returns the color space.
Calls C++ function: QSurfaceFormat::ColorSpace QSurfaceFormat::colorSpace() const
.
This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0")
.
pub unsafe fn copy_from(
&mut self,
other: impl CastInto<Ref<QSurfaceFormat>>
) -> MutRef<QSurfaceFormat>
[src]
&mut self,
other: impl CastInto<Ref<QSurfaceFormat>>
) -> MutRef<QSurfaceFormat>
Assigns other to this object.
Calls C++ function: QSurfaceFormat& QSurfaceFormat::operator=(const QSurfaceFormat& other)
.
Assigns other to this object.
pub unsafe fn default_format() -> CppBox<QSurfaceFormat>
[src]
Returns the global default surface format.
Calls C++ function: static QSurfaceFormat QSurfaceFormat::defaultFormat()
.
Returns the global default surface format.
When setDefaultFormat() is not called, this is a default-constructed QSurfaceFormat.
This function was introduced in Qt 5.4.
See also setDefaultFormat().
pub unsafe fn depth_buffer_size(&self) -> c_int
[src]
Returns the depth buffer size.
Calls C++ function: int QSurfaceFormat::depthBufferSize() const
.
Returns the depth buffer size.
See also setDepthBufferSize().
pub unsafe fn green_buffer_size(&self) -> c_int
[src]
Get the size in bits of the green channel of the color buffer.
Calls C++ function: int QSurfaceFormat::greenBufferSize() const
.
Get the size in bits of the green channel of the color buffer.
See also setGreenBufferSize().
pub unsafe fn has_alpha(&self) -> bool
[src]
Returns true
if the alpha buffer size is greater than zero.
Calls C++ function: bool QSurfaceFormat::hasAlpha() const
.
Returns true
if the alpha buffer size is greater than zero.
This means that the surface might be used with per pixel translucency effects.
pub unsafe fn major_version(&self) -> c_int
[src]
Returns the major OpenGL version.
Calls C++ function: int QSurfaceFormat::majorVersion() const
.
pub unsafe fn minor_version(&self) -> c_int
[src]
Returns the minor OpenGL version.
Calls C++ function: int QSurfaceFormat::minorVersion() const
.
Returns the minor OpenGL version.
See also setMinorVersion().
pub unsafe fn new_0a() -> CppBox<QSurfaceFormat>
[src]
Constructs a default initialized QSurfaceFormat.
Calls C++ function: [constructor] void QSurfaceFormat::QSurfaceFormat()
.
Constructs a default initialized QSurfaceFormat.
Note: By default OpenGL 2.0 is requested since this provides the highest grade of portability between platforms and OpenGL implementations.
pub unsafe fn new_1a(options: QFlags<FormatOption>) -> CppBox<QSurfaceFormat>
[src]
Constructs a QSurfaceFormat with the given format options.
Calls C++ function: [constructor] void QSurfaceFormat::QSurfaceFormat(QFlags<QSurfaceFormat::FormatOption> options)
.
Constructs a QSurfaceFormat with the given format options.
pub unsafe fn new_copy(
other: impl CastInto<Ref<QSurfaceFormat>>
) -> CppBox<QSurfaceFormat>
[src]
other: impl CastInto<Ref<QSurfaceFormat>>
) -> CppBox<QSurfaceFormat>
Constructs a copy of other.
Calls C++ function: [constructor] void QSurfaceFormat::QSurfaceFormat(const QSurfaceFormat& other)
.
Constructs a copy of other.
pub unsafe fn options(&self) -> QFlags<FormatOption>
[src]
Returns the currently set format options.
Calls C++ function: QFlags<QSurfaceFormat::FormatOption> QSurfaceFormat::options() const
.
Returns the currently set format options.
This function was introduced in Qt 5.3.
See also setOption(), setOptions(), and testOption().
pub unsafe fn profile(&self) -> OpenGLContextProfile
[src]
Get the configured OpenGL context profile.
Calls C++ function: QSurfaceFormat::OpenGLContextProfile QSurfaceFormat::profile() const
.
Get the configured OpenGL context profile.
This setting is ignored if the requested OpenGL version is less than 3.2.
See also setProfile().
pub unsafe fn red_buffer_size(&self) -> c_int
[src]
Get the size in bits of the red channel of the color buffer.
Calls C++ function: int QSurfaceFormat::redBufferSize() const
.
Get the size in bits of the red channel of the color buffer.
See also setRedBufferSize().
pub unsafe fn renderable_type(&self) -> RenderableType
[src]
Gets the renderable type.
Calls C++ function: QSurfaceFormat::RenderableType QSurfaceFormat::renderableType() const
.
Gets the renderable type.
Chooses between desktop OpenGL, OpenGL ES, and OpenVG.
See also setRenderableType().
pub unsafe fn samples(&self) -> c_int
[src]
Returns the number of samples per pixel when multisampling is enabled. By default, multisampling is disabled.
Calls C++ function: int QSurfaceFormat::samples() const
.
Returns the number of samples per pixel when multisampling is enabled. By default, multisampling is disabled.
See also setSamples().
pub unsafe fn set_alpha_buffer_size(&mut self, size: c_int)
[src]
Set the desired size in bits of the alpha channel of the color buffer.
Calls C++ function: void QSurfaceFormat::setAlphaBufferSize(int size)
.
Set the desired size in bits of the alpha channel of the color buffer.
See also alphaBufferSize().
pub unsafe fn set_blue_buffer_size(&mut self, size: c_int)
[src]
Set the desired size in bits of the blue channel of the color buffer.
Calls C++ function: void QSurfaceFormat::setBlueBufferSize(int size)
.
Set the desired size in bits of the blue channel of the color buffer.
Note: On Mac OSX, be sure to set the buffer size of all color channels, otherwise this setting will have no effect. If one of the buffer sizes is not set, the current bit-depth of the screen is used.
See also blueBufferSize().
pub unsafe fn set_color_space(&mut self, color_space: ColorSpace)
[src]
Sets the preferred colorSpace.
Calls C++ function: void QSurfaceFormat::setColorSpace(QSurfaceFormat::ColorSpace colorSpace)
.
Sets the preferred colorSpace.
For example, this allows requesting windows with default framebuffers that are sRGB-capable on platforms that support it.
Note: When the requested color space is not supported by the platform, the request is ignored. Query the QSurfaceFormat after window creation to verify if the color space request could be honored or not.
Note: This setting controls if the default framebuffer of the window is capable of updates and blending in a given color space. It does not change applications' output by itself. The applications' rendering code will still have to opt in via the appropriate OpenGL calls to enable updates and blending to be performed in the given color space instead of using the standard linear operations.
This function was introduced in Qt 5.10.
See also colorSpace().
This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0")
.
pub unsafe fn set_default_format(format: impl CastInto<Ref<QSurfaceFormat>>)
[src]
Sets the global default surface format.
Calls C++ function: static void QSurfaceFormat::setDefaultFormat(const QSurfaceFormat& format)
.
Sets the global default surface format.
This format is used by default in QOpenGLContext, QWindow, QOpenGLWidget and similar classes.
It can always be overridden on a per-instance basis by using the class in question's own setFormat() function. However, it is often more convenient to set the format for all windows once at the start of the application. It also guarantees proper behavior in cases where shared contexts are required, because settings the format via this function guarantees that all contexts and surfaces, even the ones created internally by Qt, will use the same format.
Note: When setting Qt::AA_ShareOpenGLContexts, it is strongly recommended to place the call to this function before the construction of the QGuiApplication or QApplication. Otherwise format will not be applied to the global share context and therefore issues may arise with context sharing afterwards.
This function was introduced in Qt 5.4.
See also defaultFormat().
pub unsafe fn set_depth_buffer_size(&mut self, size: c_int)
[src]
Set the minimum depth buffer size to size.
Calls C++ function: void QSurfaceFormat::setDepthBufferSize(int size)
.
Set the minimum depth buffer size to size.
See also depthBufferSize().
pub unsafe fn set_green_buffer_size(&mut self, size: c_int)
[src]
Set the desired size in bits of the green channel of the color buffer.
Calls C++ function: void QSurfaceFormat::setGreenBufferSize(int size)
.
Set the desired size in bits of the green channel of the color buffer.
Note: On Mac OSX, be sure to set the buffer size of all color channels, otherwise this setting will have no effect. If one of the buffer sizes is not set, the current bit-depth of the screen is used.
See also greenBufferSize().
pub unsafe fn set_major_version(&mut self, major_version: c_int)
[src]
Sets the desired major OpenGL version.
Calls C++ function: void QSurfaceFormat::setMajorVersion(int majorVersion)
.
Sets the desired major OpenGL version.
See also majorVersion().
pub unsafe fn set_minor_version(&mut self, minor_version: c_int)
[src]
Sets the desired minor OpenGL version.
Calls C++ function: void QSurfaceFormat::setMinorVersion(int minorVersion)
.
pub unsafe fn set_option_q_flags_format_option(
&mut self,
opt: QFlags<FormatOption>
)
[src]
&mut self,
opt: QFlags<FormatOption>
)
Sets the format option option if on is true; otherwise, clears the option.
Calls C++ function: void QSurfaceFormat::setOption(QFlags<QSurfaceFormat::FormatOption> opt)
.
Warning: no exact match found in C++ documentation. Below is the C++ documentation for void QSurfaceFormat::setOption(FormatOption option, bool on = true)
:
Sets the format option option if on is true; otherwise, clears the option.
This function was introduced in Qt 5.3.
See also setOptions(), options(), and testOption().
pub unsafe fn set_option_format_option_bool(
&mut self,
option: FormatOption,
on: bool
)
[src]
&mut self,
option: FormatOption,
on: bool
)
Sets the format option option if on is true; otherwise, clears the option.
Calls C++ function: void QSurfaceFormat::setOption(QSurfaceFormat::FormatOption option, bool on = …)
.
Sets the format option option if on is true; otherwise, clears the option.
This function was introduced in Qt 5.3.
See also setOptions(), options(), and testOption().
pub unsafe fn set_option_format_option(&mut self, option: FormatOption)
[src]
Sets the format option option if on is true; otherwise, clears the option.
Calls C++ function: void QSurfaceFormat::setOption(QSurfaceFormat::FormatOption option)
.
Sets the format option option if on is true; otherwise, clears the option.
This function was introduced in Qt 5.3.
See also setOptions(), options(), and testOption().
pub unsafe fn set_options(&mut self, options: QFlags<FormatOption>)
[src]
Sets the format options to options.
Calls C++ function: void QSurfaceFormat::setOptions(QFlags<QSurfaceFormat::FormatOption> options)
.
Sets the format options to options.
This function was introduced in Qt 5.3.
See also options() and testOption().
pub unsafe fn set_profile(&mut self, profile: OpenGLContextProfile)
[src]
Sets the desired OpenGL context profile.
Calls C++ function: void QSurfaceFormat::setProfile(QSurfaceFormat::OpenGLContextProfile profile)
.
pub unsafe fn set_red_buffer_size(&mut self, size: c_int)
[src]
Set the desired size in bits of the red channel of the color buffer.
Calls C++ function: void QSurfaceFormat::setRedBufferSize(int size)
.
Set the desired size in bits of the red channel of the color buffer.
Note: On Mac OSX, be sure to set the buffer size of all color channels, otherwise this setting will have no effect. If one of the buffer sizes is not set, the current bit-depth of the screen is used.
See also redBufferSize().
pub unsafe fn set_renderable_type(&mut self, type_: RenderableType)
[src]
Sets the desired renderable type.
Calls C++ function: void QSurfaceFormat::setRenderableType(QSurfaceFormat::RenderableType type)
.
Sets the desired renderable type.
Chooses between desktop OpenGL, OpenGL ES, and OpenVG.
See also renderableType().
pub unsafe fn set_samples(&mut self, num_samples: c_int)
[src]
Set the preferred number of samples per pixel when multisampling is enabled to numSamples. By default, multisampling is disabled.
Calls C++ function: void QSurfaceFormat::setSamples(int numSamples)
.
Set the preferred number of samples per pixel when multisampling is enabled to numSamples. By default, multisampling is disabled.
See also samples().
pub unsafe fn set_stencil_buffer_size(&mut self, size: c_int)
[src]
Set the preferred stencil buffer size to size bits.
Calls C++ function: void QSurfaceFormat::setStencilBufferSize(int size)
.
Set the preferred stencil buffer size to size bits.
See also stencilBufferSize().
pub unsafe fn set_stereo(&mut self, enable: bool)
[src]
If enable is true enables stereo buffering; otherwise disables stereo buffering.
Calls C++ function: void QSurfaceFormat::setStereo(bool enable)
.
If enable is true enables stereo buffering; otherwise disables stereo buffering.
Stereo buffering is disabled by default.
Stereo buffering provides extra color buffers to generate left-eye and right-eye images.
See also stereo().
pub unsafe fn set_swap_behavior(&mut self, behavior: SwapBehavior)
[src]
Set the swap behavior of the surface.
Calls C++ function: void QSurfaceFormat::setSwapBehavior(QSurfaceFormat::SwapBehavior behavior)
.
Set the swap behavior of the surface.
The swap behavior specifies whether single, double, or triple buffering is desired. The default, DefaultSwapBehavior, gives the default swap behavior of the platform.
See also swapBehavior().
pub unsafe fn set_swap_interval(&mut self, interval: c_int)
[src]
Sets the preferred swap interval. The swap interval specifies the minimum number of video frames that are displayed before a buffer swap occurs. This can be used to sync the GL drawing into a window to the vertical refresh of the screen.
Calls C++ function: void QSurfaceFormat::setSwapInterval(int interval)
.
Sets the preferred swap interval. The swap interval specifies the minimum number of video frames that are displayed before a buffer swap occurs. This can be used to sync the GL drawing into a window to the vertical refresh of the screen.
Setting an interval value of 0 will turn the vertical refresh syncing off, any value higher than 0 will turn the vertical syncing on. Setting interval to a higher value, for example 10, results in having 10 vertical retraces between every buffer swap.
The default interval is 1.
Changing the swap interval may not be supported by the underlying platform. In this case, the request will be silently ignored.
This function was introduced in Qt 5.3.
See also swapInterval().
pub unsafe fn set_version(&mut self, major: c_int, minor: c_int)
[src]
Sets the desired major and minor OpenGL versions.
Calls C++ function: void QSurfaceFormat::setVersion(int major, int minor)
.
pub unsafe fn static_meta_object() -> Ref<QMetaObject>
[src]
Returns a reference to the staticMetaObject
field.
pub unsafe fn stencil_buffer_size(&self) -> c_int
[src]
Returns the stencil buffer size in bits.
Calls C++ function: int QSurfaceFormat::stencilBufferSize() const
.
Returns the stencil buffer size in bits.
See also setStencilBufferSize().
pub unsafe fn stereo(&self) -> bool
[src]
Returns true
if stereo buffering is enabled; otherwise returns false. Stereo buffering is disabled by default.
Calls C++ function: bool QSurfaceFormat::stereo() const
.
Returns true
if stereo buffering is enabled; otherwise returns false. Stereo buffering is disabled by default.
See also setStereo().
pub unsafe fn swap_behavior(&self) -> SwapBehavior
[src]
Returns the configured swap behaviour.
Calls C++ function: QSurfaceFormat::SwapBehavior QSurfaceFormat::swapBehavior() const
.
Returns the configured swap behaviour.
See also setSwapBehavior().
pub unsafe fn swap_interval(&self) -> c_int
[src]
Returns the swap interval.
Calls C++ function: int QSurfaceFormat::swapInterval() const
.
pub unsafe fn test_option_q_flags_format_option(
&self,
opt: QFlags<FormatOption>
) -> bool
[src]
&self,
opt: QFlags<FormatOption>
) -> bool
Returns true if the format option option is set; otherwise returns false.
Calls C++ function: bool QSurfaceFormat::testOption(QFlags<QSurfaceFormat::FormatOption> opt) const
.
Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool QSurfaceFormat::testOption(FormatOption option) const
:
Returns true if the format option option is set; otherwise returns false.
This function was introduced in Qt 5.3.
See also options().
pub unsafe fn test_option_format_option(&self, option: FormatOption) -> bool
[src]
Returns true if the format option option is set; otherwise returns false.
Calls C++ function: bool QSurfaceFormat::testOption(QSurfaceFormat::FormatOption option) const
.
Returns true if the format option option is set; otherwise returns false.
This function was introduced in Qt 5.3.
See also options().
pub unsafe fn version(&self) -> CppBox<QPairOfIntInt>
[src]
Trait Implementations
impl CppDeletable for QSurfaceFormat
[src]
unsafe fn delete(&mut self)
[src]
Destroys the QSurfaceFormat.
Calls C++ function: [destructor] void QSurfaceFormat::~QSurfaceFormat()
.
Destroys the QSurfaceFormat.
impl PartialEq<Ref<QSurfaceFormat>> for QSurfaceFormat
[src]
fn eq(&self, arg2: &Ref<QSurfaceFormat>) -> bool
[src]
Returns true
if page layout lhs is equal to page layout rhs, i.e. if all the attributes are exactly equal.
Calls C++ function: bool operator==(const QSurfaceFormat& arg1, const QSurfaceFormat& arg2)
.
Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator==(const QPageLayout &lhs, const QPageLayout &rhs)
:
Returns true
if page layout lhs is equal to page layout rhs, i.e. if all the attributes are exactly equal.
Note that this is a strict equality, especially for page size where the QPageSize ID, name and size must exactly match, and the margins where the units must match.
See also QPageLayout::isEquivalentTo().
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for QSurfaceFormat
impl Send for QSurfaceFormat
impl Sync for QSurfaceFormat
impl Unpin for QSurfaceFormat
impl UnwindSafe for QSurfaceFormat
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<T>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,