2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qsurfaceformat.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QSurfaceFormat__FormatOption int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QSurfaceFormat__FormatOption__StereoBuffers QSurfaceFormat__FormatOption = 1
|
|
|
|
QSurfaceFormat__FormatOption__DebugContext QSurfaceFormat__FormatOption = 2
|
|
|
|
QSurfaceFormat__FormatOption__DeprecatedFunctions QSurfaceFormat__FormatOption = 4
|
|
|
|
QSurfaceFormat__FormatOption__ResetNotification QSurfaceFormat__FormatOption = 8
|
|
|
|
)
|
|
|
|
|
|
|
|
type QSurfaceFormat__SwapBehavior int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QSurfaceFormat__SwapBehavior__DefaultSwapBehavior QSurfaceFormat__SwapBehavior = 0
|
|
|
|
QSurfaceFormat__SwapBehavior__SingleBuffer QSurfaceFormat__SwapBehavior = 1
|
|
|
|
QSurfaceFormat__SwapBehavior__DoubleBuffer QSurfaceFormat__SwapBehavior = 2
|
|
|
|
QSurfaceFormat__SwapBehavior__TripleBuffer QSurfaceFormat__SwapBehavior = 3
|
|
|
|
)
|
|
|
|
|
|
|
|
type QSurfaceFormat__RenderableType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QSurfaceFormat__RenderableType__DefaultRenderableType QSurfaceFormat__RenderableType = 0
|
|
|
|
QSurfaceFormat__RenderableType__OpenGL QSurfaceFormat__RenderableType = 1
|
|
|
|
QSurfaceFormat__RenderableType__OpenGLES QSurfaceFormat__RenderableType = 2
|
|
|
|
QSurfaceFormat__RenderableType__OpenVG QSurfaceFormat__RenderableType = 4
|
|
|
|
)
|
|
|
|
|
|
|
|
type QSurfaceFormat__OpenGLContextProfile int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QSurfaceFormat__OpenGLContextProfile__NoProfile QSurfaceFormat__OpenGLContextProfile = 0
|
|
|
|
QSurfaceFormat__OpenGLContextProfile__CoreProfile QSurfaceFormat__OpenGLContextProfile = 1
|
|
|
|
QSurfaceFormat__OpenGLContextProfile__CompatibilityProfile QSurfaceFormat__OpenGLContextProfile = 2
|
|
|
|
)
|
|
|
|
|
|
|
|
type QSurfaceFormat__ColorSpace int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QSurfaceFormat__ColorSpace__DefaultColorSpace QSurfaceFormat__ColorSpace = 0
|
|
|
|
QSurfaceFormat__ColorSpace__sRGBColorSpace QSurfaceFormat__ColorSpace = 1
|
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QSurfaceFormat struct {
|
|
|
|
h *C.QSurfaceFormat
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) cPointer() *C.QSurfaceFormat {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQSurfaceFormat(h *C.QSurfaceFormat) *QSurfaceFormat {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QSurfaceFormat{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQSurfaceFormat_U(h unsafe.Pointer) *QSurfaceFormat {
|
|
|
|
return newQSurfaceFormat((*C.QSurfaceFormat)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSurfaceFormat constructs a new QSurfaceFormat object.
|
|
|
|
func NewQSurfaceFormat() *QSurfaceFormat {
|
|
|
|
ret := C.QSurfaceFormat_new()
|
|
|
|
return newQSurfaceFormat(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSurfaceFormat2 constructs a new QSurfaceFormat object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQSurfaceFormat2(options int) *QSurfaceFormat {
|
|
|
|
ret := C.QSurfaceFormat_new2((C.int)(options))
|
|
|
|
return newQSurfaceFormat(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSurfaceFormat3 constructs a new QSurfaceFormat object.
|
|
|
|
func NewQSurfaceFormat3(other *QSurfaceFormat) *QSurfaceFormat {
|
|
|
|
ret := C.QSurfaceFormat_new3(other.cPointer())
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQSurfaceFormat(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) OperatorAssign(other *QSurfaceFormat) {
|
|
|
|
C.QSurfaceFormat_OperatorAssign(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) SetDepthBufferSize(size int) {
|
|
|
|
C.QSurfaceFormat_SetDepthBufferSize(this.h, (C.int)(size))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) DepthBufferSize() int {
|
|
|
|
ret := C.QSurfaceFormat_DepthBufferSize(this.h)
|
|
|
|
return (int)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) SetStencilBufferSize(size int) {
|
|
|
|
C.QSurfaceFormat_SetStencilBufferSize(this.h, (C.int)(size))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) StencilBufferSize() int {
|
|
|
|
ret := C.QSurfaceFormat_StencilBufferSize(this.h)
|
|
|
|
return (int)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) SetRedBufferSize(size int) {
|
|
|
|
C.QSurfaceFormat_SetRedBufferSize(this.h, (C.int)(size))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) RedBufferSize() int {
|
|
|
|
ret := C.QSurfaceFormat_RedBufferSize(this.h)
|
|
|
|
return (int)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) SetGreenBufferSize(size int) {
|
|
|
|
C.QSurfaceFormat_SetGreenBufferSize(this.h, (C.int)(size))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) GreenBufferSize() int {
|
|
|
|
ret := C.QSurfaceFormat_GreenBufferSize(this.h)
|
|
|
|
return (int)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) SetBlueBufferSize(size int) {
|
|
|
|
C.QSurfaceFormat_SetBlueBufferSize(this.h, (C.int)(size))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) BlueBufferSize() int {
|
|
|
|
ret := C.QSurfaceFormat_BlueBufferSize(this.h)
|
|
|
|
return (int)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) SetAlphaBufferSize(size int) {
|
|
|
|
C.QSurfaceFormat_SetAlphaBufferSize(this.h, (C.int)(size))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) AlphaBufferSize() int {
|
|
|
|
ret := C.QSurfaceFormat_AlphaBufferSize(this.h)
|
|
|
|
return (int)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) SetSamples(numSamples int) {
|
|
|
|
C.QSurfaceFormat_SetSamples(this.h, (C.int)(numSamples))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) Samples() int {
|
|
|
|
ret := C.QSurfaceFormat_Samples(this.h)
|
|
|
|
return (int)(ret)
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSurfaceFormat) SetSwapBehavior(behavior QSurfaceFormat__SwapBehavior) {
|
2024-08-29 07:01:51 +00:00
|
|
|
C.QSurfaceFormat_SetSwapBehavior(this.h, (C.uintptr_t)(behavior))
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSurfaceFormat) SwapBehavior() QSurfaceFormat__SwapBehavior {
|
2024-08-29 07:01:51 +00:00
|
|
|
ret := C.QSurfaceFormat_SwapBehavior(this.h)
|
2024-09-04 06:54:22 +00:00
|
|
|
return (QSurfaceFormat__SwapBehavior)(ret)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QSurfaceFormat) HasAlpha() bool {
|
|
|
|
ret := C.QSurfaceFormat_HasAlpha(this.h)
|
|
|
|
return (bool)(ret)
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSurfaceFormat) SetProfile(profile QSurfaceFormat__OpenGLContextProfile) {
|
2024-08-29 07:01:51 +00:00
|
|
|
C.QSurfaceFormat_SetProfile(this.h, (C.uintptr_t)(profile))
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSurfaceFormat) Profile() QSurfaceFormat__OpenGLContextProfile {
|
2024-08-29 07:01:51 +00:00
|
|
|
ret := C.QSurfaceFormat_Profile(this.h)
|
2024-09-04 06:54:22 +00:00
|
|
|
return (QSurfaceFormat__OpenGLContextProfile)(ret)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSurfaceFormat) SetRenderableType(typeVal QSurfaceFormat__RenderableType) {
|
2024-08-29 07:01:51 +00:00
|
|
|
C.QSurfaceFormat_SetRenderableType(this.h, (C.uintptr_t)(typeVal))
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSurfaceFormat) RenderableType() QSurfaceFormat__RenderableType {
|
2024-08-29 07:01:51 +00:00
|
|
|
ret := C.QSurfaceFormat_RenderableType(this.h)
|
2024-09-04 06:54:22 +00:00
|
|
|
return (QSurfaceFormat__RenderableType)(ret)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QSurfaceFormat) SetMajorVersion(majorVersion int) {
|
|
|
|
C.QSurfaceFormat_SetMajorVersion(this.h, (C.int)(majorVersion))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) MajorVersion() int {
|
|
|
|
ret := C.QSurfaceFormat_MajorVersion(this.h)
|
|
|
|
return (int)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) SetMinorVersion(minorVersion int) {
|
|
|
|
C.QSurfaceFormat_SetMinorVersion(this.h, (C.int)(minorVersion))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) MinorVersion() int {
|
|
|
|
ret := C.QSurfaceFormat_MinorVersion(this.h)
|
|
|
|
return (int)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) SetVersion(major int, minor int) {
|
|
|
|
C.QSurfaceFormat_SetVersion(this.h, (C.int)(major), (C.int)(minor))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) Stereo() bool {
|
|
|
|
ret := C.QSurfaceFormat_Stereo(this.h)
|
|
|
|
return (bool)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) SetStereo(enable bool) {
|
|
|
|
C.QSurfaceFormat_SetStereo(this.h, (C.bool)(enable))
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QSurfaceFormat) SetOption(opt int) {
|
|
|
|
C.QSurfaceFormat_SetOption(this.h, (C.int)(opt))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) TestOption(opt int) bool {
|
|
|
|
ret := C.QSurfaceFormat_TestOption(this.h, (C.int)(opt))
|
|
|
|
return (bool)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) SetOptions(options int) {
|
|
|
|
C.QSurfaceFormat_SetOptions(this.h, (C.int)(options))
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSurfaceFormat) SetOptionWithOption(option QSurfaceFormat__FormatOption) {
|
2024-08-29 07:01:51 +00:00
|
|
|
C.QSurfaceFormat_SetOptionWithOption(this.h, (C.uintptr_t)(option))
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSurfaceFormat) TestOptionWithOption(option QSurfaceFormat__FormatOption) bool {
|
2024-08-29 07:01:51 +00:00
|
|
|
ret := C.QSurfaceFormat_TestOptionWithOption(this.h, (C.uintptr_t)(option))
|
|
|
|
return (bool)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) Options() int {
|
|
|
|
ret := C.QSurfaceFormat_Options(this.h)
|
|
|
|
return (int)(ret)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QSurfaceFormat) SwapInterval() int {
|
|
|
|
ret := C.QSurfaceFormat_SwapInterval(this.h)
|
|
|
|
return (int)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSurfaceFormat) SetSwapInterval(interval int) {
|
|
|
|
C.QSurfaceFormat_SetSwapInterval(this.h, (C.int)(interval))
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSurfaceFormat) ColorSpace() QSurfaceFormat__ColorSpace {
|
2024-08-29 07:01:51 +00:00
|
|
|
ret := C.QSurfaceFormat_ColorSpace(this.h)
|
2024-09-04 06:54:22 +00:00
|
|
|
return (QSurfaceFormat__ColorSpace)(ret)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSurfaceFormat) SetColorSpace(colorSpace QSurfaceFormat__ColorSpace) {
|
2024-08-29 07:01:51 +00:00
|
|
|
C.QSurfaceFormat_SetColorSpace(this.h, (C.uintptr_t)(colorSpace))
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QSurfaceFormat_SetDefaultFormat(format *QSurfaceFormat) {
|
|
|
|
C.QSurfaceFormat_SetDefaultFormat(format.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func QSurfaceFormat_DefaultFormat() *QSurfaceFormat {
|
|
|
|
ret := C.QSurfaceFormat_DefaultFormat()
|
|
|
|
// Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
ret1 := newQSurfaceFormat(ret)
|
|
|
|
runtime.SetFinalizer(ret1, func(ret2 *QSurfaceFormat) {
|
|
|
|
ret2.Delete()
|
|
|
|
runtime.KeepAlive(ret2.h)
|
|
|
|
})
|
|
|
|
return ret1
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSurfaceFormat) SetOption2(option QSurfaceFormat__FormatOption, on bool) {
|
2024-08-29 07:01:51 +00:00
|
|
|
C.QSurfaceFormat_SetOption2(this.h, (C.uintptr_t)(option), (C.bool)(on))
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QSurfaceFormat) Delete() {
|
|
|
|
C.QSurfaceFormat_Delete(this.h)
|
|
|
|
}
|