v0.0.0-...-3cc54d5 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 7 Imported by: 4



Package egl provides Go bindings for EGL API.



View Source
const (
	// Version10 as defined in EGL/egl.h:53
	Version10 = 1
	// Version11 as defined in EGL/egl.h:54
	Version11 = 1
	// Version12 as defined in EGL/egl.h:55
	Version12 = 1
	// Version13 as defined in EGL/egl.h:56
	Version13 = 1
	// Version14 as defined in EGL/egl.h:57
	Version14 = 1
	// False as defined in EGL/egl.h:64
	False = 0
	// True as defined in EGL/egl.h:65
	True = 1
	// DontCare as defined in EGL/egl.h:74
	DontCare = ((Int)(-1))
	// Success as defined in EGL/egl.h:77
	Success = 0x3000
	// NotInitialized as defined in EGL/egl.h:78
	NotInitialized = 0x3001
	// BadAccess as defined in EGL/egl.h:79
	BadAccess = 0x3002
	// BadAlloc as defined in EGL/egl.h:80
	BadAlloc = 0x3003
	// BadAttribute as defined in EGL/egl.h:81
	BadAttribute = 0x3004
	// BadConfig as defined in EGL/egl.h:82
	BadConfig = 0x3005
	// BadContext as defined in EGL/egl.h:83
	BadContext = 0x3006
	// BadCurrentSurface as defined in EGL/egl.h:84
	BadCurrentSurface = 0x3007
	// BadDisplay as defined in EGL/egl.h:85
	BadDisplay = 0x3008
	// BadMatch as defined in EGL/egl.h:86
	BadMatch = 0x3009
	// BadNativePixmap as defined in EGL/egl.h:87
	BadNativePixmap = 0x300A
	// BadNativeWindow as defined in EGL/egl.h:88
	BadNativeWindow = 0x300B
	// BadParameter as defined in EGL/egl.h:89
	BadParameter = 0x300C
	// BadSurface as defined in EGL/egl.h:90
	BadSurface = 0x300D
	// ContextLost as defined in EGL/egl.h:91
	ContextLost = 0x300E
	// BufferSize as defined in EGL/egl.h:96
	BufferSize = 0x3020
	// AlphaSize as defined in EGL/egl.h:97
	AlphaSize = 0x3021
	// BlueSize as defined in EGL/egl.h:98
	BlueSize = 0x3022
	// GreenSize as defined in EGL/egl.h:99
	GreenSize = 0x3023
	// RedSize as defined in EGL/egl.h:100
	RedSize = 0x3024
	// DepthSize as defined in EGL/egl.h:101
	DepthSize = 0x3025
	// StencilSize as defined in EGL/egl.h:102
	StencilSize = 0x3026
	// ConfigCaveat as defined in EGL/egl.h:103
	ConfigCaveat = 0x3027
	// ConfigId as defined in EGL/egl.h:104
	ConfigId = 0x3028
	// Level as defined in EGL/egl.h:105
	Level = 0x3029
	// MaxPbufferHeight as defined in EGL/egl.h:106
	MaxPbufferHeight = 0x302A
	// MaxPbufferPixels as defined in EGL/egl.h:107
	MaxPbufferPixels = 0x302B
	// MaxPbufferWidth as defined in EGL/egl.h:108
	MaxPbufferWidth = 0x302C
	// NativeRenderable as defined in EGL/egl.h:109
	NativeRenderable = 0x302D
	// NativeVisualId as defined in EGL/egl.h:110
	NativeVisualId = 0x302E
	// NativeVisualType as defined in EGL/egl.h:111
	NativeVisualType = 0x302F
	// Samples as defined in EGL/egl.h:112
	Samples = 0x3031
	// SampleBuffers as defined in EGL/egl.h:113
	SampleBuffers = 0x3032
	// SurfaceType as defined in EGL/egl.h:114
	SurfaceType = 0x3033
	// TransparentType as defined in EGL/egl.h:115
	TransparentType = 0x3034
	// TransparentBlueValue as defined in EGL/egl.h:116
	TransparentBlueValue = 0x3035
	// TransparentGreenValue as defined in EGL/egl.h:117
	TransparentGreenValue = 0x3036
	// TransparentRedValue as defined in EGL/egl.h:118
	TransparentRedValue = 0x3037
	// None as defined in EGL/egl.h:119
	None = 0x3038
	// BindToTextureRgb as defined in EGL/egl.h:120
	BindToTextureRgb = 0x3039
	// BindToTextureRgba as defined in EGL/egl.h:121
	BindToTextureRgba = 0x303A
	// MinSwapInterval as defined in EGL/egl.h:122
	MinSwapInterval = 0x303B
	// MaxSwapInterval as defined in EGL/egl.h:123
	MaxSwapInterval = 0x303C
	// LuminanceSize as defined in EGL/egl.h:124
	LuminanceSize = 0x303D
	// AlphaMaskSize as defined in EGL/egl.h:125
	AlphaMaskSize = 0x303E
	// ColorBufferType as defined in EGL/egl.h:126
	ColorBufferType = 0x303F
	// RenderableType as defined in EGL/egl.h:127
	RenderableType = 0x3040
	// MatchNativePixmap as defined in EGL/egl.h:128
	MatchNativePixmap = 0x3041
	// Conformant as defined in EGL/egl.h:129
	Conformant = 0x3042
	// SlowConfig as defined in EGL/egl.h:134
	SlowConfig = 0x3050
	// NonConformantConfig as defined in EGL/egl.h:135
	NonConformantConfig = 0x3051
	// TransparentRgb as defined in EGL/egl.h:136
	TransparentRgb = 0x3052
	// RgbBuffer as defined in EGL/egl.h:137
	RgbBuffer = 0x308E
	// LuminanceBuffer as defined in EGL/egl.h:138
	LuminanceBuffer = 0x308F
	// NoTexture as defined in EGL/egl.h:141
	NoTexture = 0x305C
	// TextureRgb as defined in EGL/egl.h:142
	TextureRgb = 0x305D
	// TextureRgba as defined in EGL/egl.h:143
	TextureRgba = 0x305E
	// Texture2d as defined in EGL/egl.h:144
	Texture2d = 0x305F
	// PbufferBit as defined in EGL/egl.h:147
	PbufferBit = 0x0001
	// PixmapBit as defined in EGL/egl.h:148
	PixmapBit = 0x0002
	// WindowBit as defined in EGL/egl.h:149
	WindowBit = 0x0004
	// VgColorspaceLinearBit as defined in EGL/egl.h:150
	VgColorspaceLinearBit = 0x0020
	// VgAlphaFormatPreBit as defined in EGL/egl.h:151
	VgAlphaFormatPreBit = 0x0040
	// MultisampleResolveBoxBit as defined in EGL/egl.h:152
	MultisampleResolveBoxBit = 0x0200
	// SwapBehaviorPreservedBit as defined in EGL/egl.h:153
	SwapBehaviorPreservedBit = 0x0400
	// OpenglEsBit as defined in EGL/egl.h:155
	OpenglEsBit = 0x0001
	// OpenvgBit as defined in EGL/egl.h:156
	OpenvgBit = 0x0002
	// OpenglEs2Bit as defined in EGL/egl.h:157
	OpenglEs2Bit = 0x0004
	// OpenglBit as defined in EGL/egl.h:158
	OpenglBit = 0x0008
	// Vendor as defined in EGL/egl.h:161
	Vendor = 0x3053
	// Version as defined in EGL/egl.h:162
	Version = 0x3054
	// Extensions as defined in EGL/egl.h:163
	Extensions = 0x3055
	// ClientApis as defined in EGL/egl.h:164
	ClientApis = 0x308D
	// Height as defined in EGL/egl.h:167
	Height = 0x3056
	// Width as defined in EGL/egl.h:168
	Width = 0x3057
	// LargestPbuffer as defined in EGL/egl.h:169
	LargestPbuffer = 0x3058
	// TextureFormat as defined in EGL/egl.h:170
	TextureFormat = 0x3080
	// TextureTarget as defined in EGL/egl.h:171
	TextureTarget = 0x3081
	// MipmapTexture as defined in EGL/egl.h:172
	MipmapTexture = 0x3082
	// MipmapLevel as defined in EGL/egl.h:173
	MipmapLevel = 0x3083
	// RenderBuffer as defined in EGL/egl.h:174
	RenderBuffer = 0x3086
	// VgColorspace as defined in EGL/egl.h:175
	VgColorspace = 0x3087
	// VgAlphaFormat as defined in EGL/egl.h:176
	VgAlphaFormat = 0x3088
	// HorizontalResolution as defined in EGL/egl.h:177
	HorizontalResolution = 0x3090
	// VerticalResolution as defined in EGL/egl.h:178
	VerticalResolution = 0x3091
	// PixelAspectRatio as defined in EGL/egl.h:179
	PixelAspectRatio = 0x3092
	// SwapBehavior as defined in EGL/egl.h:180
	SwapBehavior = 0x3093
	// MultisampleResolve as defined in EGL/egl.h:181
	MultisampleResolve = 0x3099
	// BackBuffer as defined in EGL/egl.h:184
	BackBuffer = 0x3084
	// SingleBuffer as defined in EGL/egl.h:185
	SingleBuffer = 0x3085
	// VgColorspaceSrgb as defined in EGL/egl.h:188
	VgColorspaceSrgb = 0x3089
	// VgColorspaceLinear as defined in EGL/egl.h:189
	VgColorspaceLinear = 0x308A
	// VgAlphaFormatNonpre as defined in EGL/egl.h:192
	VgAlphaFormatNonpre = 0x308B
	// VgAlphaFormatPre as defined in EGL/egl.h:193
	VgAlphaFormatPre = 0x308C
	// DisplayScaling as defined in EGL/egl.h:198
	DisplayScaling = 10000
	// Unknown as defined in EGL/egl.h:201
	Unknown = ((Int)(-1))
	// BufferPreserved as defined in EGL/egl.h:204
	BufferPreserved = 0x3094
	// BufferDestroyed as defined in EGL/egl.h:205
	BufferDestroyed = 0x3095
	// OpenvgImage as defined in EGL/egl.h:208
	OpenvgImage = 0x3096
	// ContextClientType as defined in EGL/egl.h:211
	ContextClientType = 0x3097
	// ContextClientVersion as defined in EGL/egl.h:214
	ContextClientVersion = 0x3098
	// MultisampleResolveDefault as defined in EGL/egl.h:217
	MultisampleResolveDefault = 0x309A
	// MultisampleResolveBox as defined in EGL/egl.h:218
	MultisampleResolveBox = 0x309B
	// OpenglEsApi as defined in EGL/egl.h:221
	OpenglEsApi = 0x30A0
	// OpenvgApi as defined in EGL/egl.h:222
	OpenvgApi = 0x30A1
	// OpenglApi as defined in EGL/egl.h:223
	OpenglApi = 0x30A2
	// Draw as defined in EGL/egl.h:226
	Draw = 0x3059
	// Read as defined in EGL/egl.h:227
	Read = 0x305A
	// CoreNativeEngine as defined in EGL/egl.h:230
	CoreNativeEngine = 0x305B
	// Colorspace as defined in EGL/egl.h:233
	Colorspace = VgColorspace
	// AlphaFormat as defined in EGL/egl.h:234
	AlphaFormat = VgAlphaFormat
	// ColorspaceSrgb as defined in EGL/egl.h:235
	ColorspaceSrgb = VgColorspaceSrgb
	// ColorspaceLinear as defined in EGL/egl.h:236
	ColorspaceLinear = VgColorspaceLinear
	// AlphaFormatNonpre as defined in EGL/egl.h:237
	AlphaFormatNonpre = VgAlphaFormatNonpre
	// AlphaFormatPre as defined in EGL/egl.h:238
	AlphaFormatPre = VgAlphaFormatPre


View Source
var (
	// DefaultDisplay as defined in EGL/egl.h:68
	DefaultDisplay = ((NativeDisplayType)(nil))
	// NoContext as defined in EGL/egl.h:69
	NoContext = ((Context)(nil))
	// NoDisplay as defined in EGL/egl.h:70
	NoDisplay = ((Display)(nil))
	// NoSurface as defined in EGL/egl.h:71
	NoSurface = ((Surface)(nil))
View Source
var (
	ErrUnknown           = errors.New("unknown error")
	ErrNotInitialized    = errors.New("not initialized")
	ErrBadAccess         = errors.New("bad access")
	ErrBadAlloc          = errors.New("bad alloc")
	ErrBadAttribute      = errors.New("bad attribute")
	ErrBadConfig         = errors.New("bad config")
	ErrBadContext        = errors.New("bad context")
	ErrBadCurrentSurface = errors.New("bad current surface")
	ErrBadDisplay        = errors.New("bad display")
	ErrBadMatch          = errors.New("bad match")
	ErrBadNativePixmap   = errors.New("bad native pixmap")
	ErrBadNativeWindow   = errors.New("bad native window")
	ErrBadParameter      = errors.New("bad parameter")
	ErrBadSurface        = errors.New("bad surface")
	ErrContextLost       = errors.New("context lost")


func Error

func Error() error

func GetError

func GetError() int32

GetError function as declared in

func QueryString

func QueryString(dpy Display, name int32) string

QueryString function as declared in


type Boolean

type Boolean uint32

Boolean type as declared in EGL/egl.h:44

func BindAPI

func BindAPI(api Enum) Boolean

BindAPI function as declared in

func BindTexImage

func BindTexImage(dpy Display, surface Surface, buffer int32) Boolean

BindTexImage function as declared in

func ChooseConfig

func ChooseConfig(dpy Display, attribList []int32, configs []Config, configSize int32, numConfig *int32) Boolean

ChooseConfig function as declared in

func CopyBuffers

func CopyBuffers(dpy Display, surface Surface, target NativePixmapType) Boolean

CopyBuffers function as declared in

func DestroyContext

func DestroyContext(dpy Display, ctx Context) Boolean

DestroyContext function as declared in

func DestroySurface

func DestroySurface(dpy Display, surface Surface) Boolean

DestroySurface function as declared in

func GetConfigAttrib

func GetConfigAttrib(dpy Display, config Config, attribute int32, value *int32) Boolean

GetConfigAttrib function as declared in

func GetConfigs

func GetConfigs(dpy Display, configs []Config, configSize int32, numConfig *int32) Boolean

GetConfigs function as declared in

func Initialize

func Initialize(dpy Display, major *int32, minor *int32) Boolean

Initialize function as declared in

func MakeCurrent

func MakeCurrent(dpy Display, draw Surface, read Surface, ctx Context) Boolean

MakeCurrent function as declared in

func QueryContext

func QueryContext(dpy Display, ctx Context, attribute int32, value *int32) Boolean

QueryContext function as declared in

func QuerySurface

func QuerySurface(dpy Display, surface Surface, attribute int32, value *int32) Boolean

QuerySurface function as declared in

func ReleaseTexImage

func ReleaseTexImage(dpy Display, surface Surface, buffer int32) Boolean

ReleaseTexImage function as declared in

func ReleaseThread

func ReleaseThread() Boolean

ReleaseThread function as declared in

func SurfaceAttrib

func SurfaceAttrib(dpy Display, surface Surface, attribute int32, value int32) Boolean

SurfaceAttrib function as declared in

func SwapBuffers

func SwapBuffers(dpy Display, surface Surface) Boolean

SwapBuffers function as declared in

func SwapInterval

func SwapInterval(dpy Display, interval int32) Boolean

SwapInterval function as declared in

func WaitClient

func WaitClient() Boolean

WaitClient function as declared in

func WaitNative

func WaitNative(engine int32) Boolean

WaitNative function as declared in

type ClientBuffer

type ClientBuffer unsafe.Pointer

ClientBuffer type as declared in EGL/egl.h:50

type Config

type Config unsafe.Pointer

Config type as declared in EGL/egl.h:46

type Context

type Context unsafe.Pointer

Context type as declared in EGL/egl.h:47

func CreateContext

func CreateContext(dpy Display, config Config, shareContext Context, attribList []int32) Context

CreateContext function as declared in

func GetCurrentContext

func GetCurrentContext() Context

GetCurrentContext function as declared in

type Display

type Display unsafe.Pointer

Display type as declared in EGL/egl.h:48

func GetCurrentDisplay

func GetCurrentDisplay() Display

GetCurrentDisplay function as declared in

type DisplayHandle

type DisplayHandle struct {
	Width  int
	Height int
	// contains filtered or unexported fields

func NewDisplayHandle

func NewDisplayHandle(window *android.NativeWindow, expectedConfig map[int32]int32) (*DisplayHandle, error)

NewDisplayHandle initializes EGL display/surface/context and returns a handle object or error. Use expectedConfig to specify the desired EGL config constraints like:

	egl.SurfaceType: egl.WindowBit,
	egl.RedSize:   8,
	egl.GreenSize: 8,
	egl.BlueSize:  8,
	egl.AlphaSize: 8,
	egl.DepthSize: 24,

func (*DisplayHandle) Destroy

func (d *DisplayHandle) Destroy()

func (*DisplayHandle) EGLContext

func (d *DisplayHandle) EGLContext() Context

func (*DisplayHandle) EGLDisplay

func (d *DisplayHandle) EGLDisplay() Display

func (*DisplayHandle) EGLSurface

func (d *DisplayHandle) EGLSurface() Surface

func (*DisplayHandle) SwapBuffers

func (d *DisplayHandle) SwapBuffers()

func (*DisplayHandle) UpdateDimensions

func (d *DisplayHandle) UpdateDimensions()

type Enum

type Enum uint32

Enum type as declared in EGL/egl.h:45

func QueryAPI

func QueryAPI() Enum

QueryAPI function as declared in

type Int

type Int int32

Int type as declared in EGL/eglplatform.h:122

type NativeDisplayType

type NativeDisplayType unsafe.Pointer

NativeDisplayType type as declared in EGL/eglplatform.h:93

type NativePixmapType

type NativePixmapType C.EGLNativePixmapType

NativePixmapType as declared in EGL/eglplatform.h:92

type NativeWindowType

type NativeWindowType C.EGLNativeWindowType

NativeWindowType as declared in EGL/eglplatform.h:91

type RawString

type RawString string

RawString reperesents a string backed by data on the C side.

func (RawString) Copy

func (raw RawString) Copy() string

Copy returns a Go-managed copy of raw string.

type Surface

type Surface unsafe.Pointer

Surface type as declared in EGL/egl.h:49

func CreatePbufferFromClientBuffer

func CreatePbufferFromClientBuffer(dpy Display, buftype Enum, buffer ClientBuffer, config Config, attribList []int32) Surface

CreatePbufferFromClientBuffer function as declared in

func CreatePbufferSurface

func CreatePbufferSurface(dpy Display, config Config, attribList []int32) Surface

CreatePbufferSurface function as declared in

func CreatePixmapSurface

func CreatePixmapSurface(dpy Display, config Config, pixmap NativePixmapType, attribList []int32) Surface

CreatePixmapSurface function as declared in

func CreateWindowSurface

func CreateWindowSurface(dpy Display, config Config, win NativeWindowType, attribList []int32) Surface

CreateWindowSurface function as declared in

func GetCurrentSurface

func GetCurrentSurface(readdraw int32) Surface

GetCurrentSurface function as declared in

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL