egl

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package egl provides Go bindings for EGL.

Index

Constants

View Source
const (
	EGL_ALPHA_FORMAT                               = 12424
	EGL_ALPHA_FORMAT_NONPRE                        = 12427
	EGL_ALPHA_FORMAT_PRE                           = 12428
	EGL_ALPHA_MASK_SIZE                            = 12350
	EGL_BACK_BUFFER                                = 12420
	EGL_BAD_ACCESS                                 = 12290
	EGL_BAD_ALLOC                                  = 12291
	EGL_BAD_ATTRIBUTE                              = 12292
	EGL_BAD_CONFIG                                 = 12293
	EGL_BAD_CONTEXT                                = 12294
	EGL_BAD_CURRENT_SURFACE                        = 12295
	EGL_BAD_DISPLAY                                = 12296
	EGL_BAD_MATCH                                  = 12297
	EGL_BAD_NATIVE_PIXMAP                          = 12298
	EGL_BAD_NATIVE_WINDOW                          = 12299
	EGL_BAD_PARAMETER                              = 12300
	EGL_BAD_SURFACE                                = 12301
	EGL_BIND_TO_TEXTURE_RGB                        = 12345
	EGL_BIND_TO_TEXTURE_RGBA                       = 12346
	EGL_BUFFER_DESTROYED                           = 12437
	EGL_BUFFER_PRESERVED                           = 12436
	EGL_CLIENT_APIS                                = 12429
	EGL_CL_EVENT_HANDLE                            = 12444
	EGL_COLORSPACE                                 = 12423
	EGL_COLORSPACE_LINEAR                          = 12426
	EGL_COLOR_BUFFER_TYPE                          = 12351
	EGL_CONDITION_SATISFIED                        = 12534
	EGL_CONFIG_CAVEAT                              = 12327
	EGL_CONFORMANT                                 = 12354
	EGL_CONTEXT_CLIENT_TYPE                        = 12439
	EGL_CONTEXT_LOST                               = 12302
	EGL_CONTEXT_MINOR_VERSION                      = 12539
	EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT   = 2
	EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT            = 1
	EGL_CONTEXT_OPENGL_DEBUG                       = 12720
	EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE          = 12721
	EGL_CONTEXT_OPENGL_PROFILE_MASK                = 12541
	EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY = 12733
	EGL_CONTEXT_OPENGL_ROBUST_ACCESS               = 12722
	EGL_CORE_NATIVE_ENGINE                         = 12379
	EGL_DISPLAY_SCALING                            = 10000
	EGL_DRAW                                       = 12377
	EGL_EXTENSIONS                                 = 12373
	EGL_FOREVER                                    = 0xFFFFFFFFFFFFFFFF
	EGL_GL_COLORSPACE                              = 12445
	EGL_GL_COLORSPACE_LINEAR                       = 12426
	EGL_GL_COLORSPACE_SRGB                         = 12425
	EGL_GL_RENDERBUFFER                            = 12473
	EGL_GL_TEXTURE_2D                              = 12465
	EGL_GL_TEXTURE_3D                              = 12466
	EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X             = 12468
	EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y             = 12470
	EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z             = 12472
	EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X             = 12467
	EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y             = 12469
	EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z             = 12471
	EGL_GL_TEXTURE_LEVEL                           = 12476
	EGL_GL_TEXTURE_ZOFFSET                         = 12477
	EGL_HORIZONTAL_RESOLUTION                      = 12432
	EGL_IMAGE_PRESERVED                            = 12498
	EGL_LARGEST_PBUFFER                            = 12376
	EGL_LEVEL                                      = 12329
	EGL_LOSE_CONTEXT_ON_RESET                      = 12735
	EGL_LUMINANCE_BUFFER                           = 12431
	EGL_LUMINANCE_SIZE                             = 12349
	EGL_MATCH_NATIVE_PIXMAP                        = 12353
	EGL_MAX_PBUFFER_HEIGHT                         = 12330
	EGL_MAX_PBUFFER_PIXELS                         = 12331
	EGL_MAX_PBUFFER_WIDTH                          = 12332
	EGL_MAX_SWAP_INTERVAL                          = 12348
	EGL_MIN_SWAP_INTERVAL                          = 12347
	EGL_MIPMAP_LEVEL                               = 12419
	EGL_MIPMAP_TEXTURE                             = 12418
	EGL_MULTISAMPLE_RESOLVE                        = 12441
	EGL_MULTISAMPLE_RESOLVE_BOX                    = 12443
	EGL_MULTISAMPLE_RESOLVE_BOX_BIT                = 512
	EGL_MULTISAMPLE_RESOLVE_DEFAULT                = 12442
	EGL_NATIVE_RENDERABLE                          = 12333
	EGL_NATIVE_VISUAL_ID                           = 12334
	EGL_NATIVE_VISUAL_TYPE                         = 12335
	EGL_NON_CONFORMANT_CONFIG                      = 12369
	EGL_NOT_INITIALIZED                            = 12289
	EGL_NO_RESET_NOTIFICATION                      = 12734
	EGL_NO_TEXTURE                                 = 12380
	EGL_OPENGL_API                                 = 12450
	EGL_OPENGL_BIT                                 = 8
	EGL_OPENGL_ES_BIT                              = 1
	EGL_OPENVG_API                                 = 12449
	EGL_OPENVG_BIT                                 = 2
	EGL_OPENVG_IMAGE                               = 12438
	EGL_PIXEL_ASPECT_RATIO                         = 12434
	EGL_PIXMAP_BIT                                 = 2
	EGL_READ                                       = 12378
	EGL_RENDER_BUFFER                              = 12422
	EGL_RGB_BUFFER                                 = 12430
	EGL_SAMPLES                                    = 12337
	EGL_SAMPLE_BUFFERS                             = 12338
	EGL_SIGNALED                                   = 12530
	EGL_SINGLE_BUFFER                              = 12421
	EGL_SLOW_CONFIG                                = 12368
	EGL_SUCCESS                                    = 12288
	EGL_SWAP_BEHAVIOR                              = 12435
	EGL_SWAP_BEHAVIOR_PRESERVED_BIT                = 1024
	EGL_SYNC_CL_EVENT                              = 12542
	EGL_SYNC_CL_EVENT_COMPLETE                     = 12543
	EGL_SYNC_CONDITION                             = 12536
	EGL_SYNC_FENCE                                 = 12537
	EGL_SYNC_FLUSH_COMMANDS_BIT                    = 1
	EGL_SYNC_PRIOR_COMMANDS_COMPLETE               = 12528
	EGL_SYNC_STATUS                                = 12529
	EGL_SYNC_TYPE                                  = 12535
	EGL_TEXTURE_2D                                 = 12383
	EGL_TEXTURE_FORMAT                             = 12416
	EGL_TEXTURE_RGB                                = 12381
	EGL_TEXTURE_RGBA                               = 12382
	EGL_TEXTURE_TARGET                             = 12417
	EGL_TIMEOUT_EXPIRED                            = 12533
	EGL_TRANSPARENT_BLUE_VALUE                     = 12341
	EGL_TRANSPARENT_GREEN_VALUE                    = 12342
	EGL_TRANSPARENT_RED_VALUE                      = 12343
	EGL_TRANSPARENT_RGB                            = 12370
	EGL_TRANSPARENT_TYPE                           = 12340
	EGL_UNSIGNALED                                 = 12531
	EGL_VENDOR                                     = 12371
	EGL_VERSION                                    = 12372
	EGL_VERTICAL_RESOLUTION                        = 12433
	EGL_VG_ALPHA_FORMAT                            = 12424
	EGL_VG_ALPHA_FORMAT_NONPRE                     = 12427
	EGL_VG_ALPHA_FORMAT_PRE                        = 12428
	EGL_VG_ALPHA_FORMAT_PRE_BIT                    = 64
	EGL_VG_COLORSPACE                              = 12423
	EGL_VG_COLORSPACE_LINEAR                       = 12426
	EGL_VG_COLORSPACE_LINEAR_BIT                   = 32
)

Variables

This section is empty.

Functions

func QueryString

func QueryString(dpy EGLDisplay, name Int) string

QueryString calls the underlying C function.

Types

type ANativeWindow

type ANativeWindow struct {
	// contains filtered or unexported fields
}

ANativeWindow wraps the NDK ANativeWindow handle.

func NewANativeWindowFromPointer

func NewANativeWindowFromPointer(ptr unsafe.Pointer) *ANativeWindow

NewANativeWindowFromPointer wraps a raw ANativeWindow pointer.

func (*ANativeWindow) Acquire

func (h *ANativeWindow) Acquire()

Acquire calls the underlying NDK function.

func (*ANativeWindow) ClearFrameRate

func (h *ANativeWindow) ClearFrameRate() error

ClearFrameRate calls the underlying NDK function.

func (*ANativeWindow) Close

func (h *ANativeWindow) Close() error

Close releases the underlying NDK handle.

func (*ANativeWindow) GetBuffersDataSpace

func (h *ANativeWindow) GetBuffersDataSpace() error

GetBuffersDataSpace calls the underlying NDK function.

func (*ANativeWindow) GetBuffersDefaultDataSpace

func (h *ANativeWindow) GetBuffersDefaultDataSpace() error

GetBuffersDefaultDataSpace calls the underlying NDK function.

func (*ANativeWindow) GetFormat

func (h *ANativeWindow) GetFormat() error

GetFormat calls the underlying NDK function.

func (*ANativeWindow) GetHeight

func (h *ANativeWindow) GetHeight() error

GetHeight calls the underlying NDK function.

func (*ANativeWindow) GetWidth

func (h *ANativeWindow) GetWidth() error

GetWidth calls the underlying NDK function.

func (*ANativeWindow) Lock

func (h *ANativeWindow) Lock(outBuffer *NativeWindow_Buffer, inOutDirtyBounds *ARect) error

Lock calls the underlying NDK function.

func (*ANativeWindow) Pointer

func (h *ANativeWindow) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*ANativeWindow) SetBuffersDataSpace

func (h *ANativeWindow) SetBuffersDataSpace(dataSpace int32) error

SetBuffersDataSpace calls the underlying NDK function.

func (*ANativeWindow) SetBuffersGeometry

func (h *ANativeWindow) SetBuffersGeometry(width int32, height int32, format int32) error

SetBuffersGeometry calls the underlying NDK function.

func (*ANativeWindow) SetBuffersTransform

func (h *ANativeWindow) SetBuffersTransform(transform int32) error

SetBuffersTransform calls the underlying NDK function.

func (*ANativeWindow) SetFrameRate

func (h *ANativeWindow) SetFrameRate(frameRate float32, compatibility int8) error

SetFrameRate calls the underlying NDK function.

func (*ANativeWindow) SetFrameRateWithChangeStrategy

func (h *ANativeWindow) SetFrameRateWithChangeStrategy(frameRate float32, compatibility int8, changeFrameRateStrategy int8) error

SetFrameRateWithChangeStrategy calls the underlying NDK function.

func (*ANativeWindow) TryAllocateBuffers

func (h *ANativeWindow) TryAllocateBuffers()

TryAllocateBuffers calls the underlying NDK function.

func (*ANativeWindow) UnlockAndPost

func (h *ANativeWindow) UnlockAndPost() error

UnlockAndPost calls the underlying NDK function.

type ARect

type ARect = capi.ARect

type Boolean

type Boolean uint32
const (
	False Boolean = 0
	True  Boolean = 1
)

func BindAPI

func BindAPI(api EGLenum) Boolean

BindAPI calls the underlying C function.

func ChooseConfig

func ChooseConfig(dpy EGLDisplay, attrib_list *Int, configs *EGLConfig, config_size Int, num_config *Int) Boolean

ChooseConfig calls the underlying C function.

func DestroyContext

func DestroyContext(dpy EGLDisplay, ctx EGLContext) Boolean

DestroyContext calls the underlying C function.

func DestroySurface

func DestroySurface(dpy EGLDisplay, surface EGLSurface) Boolean

DestroySurface calls the underlying C function.

func GetConfigAttrib

func GetConfigAttrib(dpy EGLDisplay, config EGLConfig, attribute Int, value *Int) Boolean

GetConfigAttrib calls the underlying C function.

func Initialize

func Initialize(dpy EGLDisplay, major *Int, minor *Int) Boolean

Initialize calls the underlying C function.

func MakeCurrent

func MakeCurrent(dpy EGLDisplay, draw EGLSurface, read EGLSurface, ctx EGLContext) Boolean

MakeCurrent calls the underlying C function.

func QuerySurface

func QuerySurface(dpy EGLDisplay, surface EGLSurface, attribute Int, value *Int) Boolean

QuerySurface calls the underlying C function.

func ReleaseThread

func ReleaseThread() Boolean

ReleaseThread calls the underlying C function.

func SwapBuffers

func SwapBuffers(dpy EGLDisplay, surface EGLSurface) Boolean

SwapBuffers calls the underlying C function.

func SwapInterval

func SwapInterval(dpy EGLDisplay, interval Int) Boolean

SwapInterval calls the underlying C function.

func Terminate

func Terminate(dpy EGLDisplay) Boolean

Terminate calls the underlying C function.

func WaitGL

func WaitGL() Boolean

WaitGL calls the underlying C function.

func WaitNative

func WaitNative(engine Int) Boolean

WaitNative calls the underlying C function.

type EGLAttrib

type EGLAttrib = capi.EGLAttrib

type EGLClientBuffer

type EGLClientBuffer = capi.EGLClientBuffer

type EGLConfig

type EGLConfig = capi.EGLConfig

type EGLContext

type EGLContext = capi.EGLContext

func CreateContext

func CreateContext(dpy EGLDisplay, config EGLConfig, share_context EGLContext, attrib_list *Int) EGLContext

CreateContext calls the underlying C function.

func GetCurrentContext

func GetCurrentContext() EGLContext

GetCurrentContext calls the underlying C function.

type EGLDisplay

type EGLDisplay = capi.EGLDisplay

func GetCurrentDisplay

func GetCurrentDisplay() EGLDisplay

GetCurrentDisplay calls the underlying C function.

func GetDisplay

func GetDisplay(display_id EGLNativeDisplayType) EGLDisplay

GetDisplay calls the underlying C function.

type EGLImage

type EGLImage = capi.EGLImage

type EGLNativeDisplayType

type EGLNativeDisplayType = capi.EGLNativeDisplayType

type EGLNativePixmapType

type EGLNativePixmapType = capi.EGLNativePixmapType

type EGLNativeWindowType

type EGLNativeWindowType = capi.EGLNativeWindowType

type EGLSurface

type EGLSurface = capi.EGLSurface

func CreatePbufferSurface

func CreatePbufferSurface(dpy EGLDisplay, config EGLConfig, attrib_list *Int) EGLSurface

CreatePbufferSurface calls the underlying C function.

func CreateWindowSurface

func CreateWindowSurface(dpy EGLDisplay, config EGLConfig, win EGLNativeWindowType, attrib_list *Int) EGLSurface

CreateWindowSurface calls the underlying C function.

func GetCurrentSurface

func GetCurrentSurface(readdraw Int) EGLSurface

GetCurrentSurface calls the underlying C function.

type EGLSync

type EGLSync = capi.EGLSync

type EGLTime

type EGLTime = capi.EGLTime

type EGLenum

type EGLenum = capi.EGLenum

func QueryAPI

func QueryAPI() EGLenum

QueryAPI calls the underlying C function.

type EglMustCastToProperFunctionPointerType

type EglMustCastToProperFunctionPointerType = capi.EglMustCastToProperFunctionPointerType

type Error

type Error int32

Error represents an NDK error code.

func (Error) Error

func (e Error) Error() string

type Int

type Int int32
const (
	None                 Int = 12344
	RenderableType       Int = 12352
	OpenglEs2Bit         Int = 4
	OpenglEs3Bit         Int = 64
	SurfaceType          Int = 12339
	WindowBit            Int = 4
	PbufferBit           Int = 1
	RedSize              Int = 12324
	GreenSize            Int = 12323
	BlueSize             Int = 12322
	AlphaSize            Int = 12321
	DepthSize            Int = 12325
	StencilSize          Int = 12326
	ConfigID             Int = 12328
	BufferSize           Int = 12320
	Width                Int = 12375
	Height               Int = 12374
	ContextClientVersion Int = 12440
	ContextMajorVersion  Int = 12440
	OpenglEsApi          Int = 12448
)

func GetError

func GetError() Int

GetError calls the underlying C function.

type NativeWindowTransform

type NativeWindowTransform int32
const (
	ANATIVEWINDOW_TRANSFORM_IDENTITY          NativeWindowTransform = 0
	ANATIVEWINDOW_TRANSFORM_MIRROR_HORIZONTAL NativeWindowTransform = 1
	ANATIVEWINDOW_TRANSFORM_MIRROR_VERTICAL   NativeWindowTransform = 2
	ANATIVEWINDOW_TRANSFORM_ROTATE_90         NativeWindowTransform = 4
	ANATIVEWINDOW_TRANSFORM_ROTATE_180        NativeWindowTransform = 3
	ANATIVEWINDOW_TRANSFORM_ROTATE_270        NativeWindowTransform = 7
)

type NativeWindow_Buffer

type NativeWindow_Buffer struct {
	// contains filtered or unexported fields
}

NativeWindow_Buffer wraps the NDK ANativeWindow_Buffer handle.

func NewNativeWindow_BufferFromPointer

func NewNativeWindow_BufferFromPointer(ptr unsafe.Pointer) *NativeWindow_Buffer

NewNativeWindow_BufferFromPointer wraps a raw ANativeWindow_Buffer pointer.

func (*NativeWindow_Buffer) Pointer

func (h *NativeWindow_Buffer) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

type NativeWindow_ChangeFrameRateStrategy

type NativeWindow_ChangeFrameRateStrategy int32
const (
	ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS NativeWindow_ChangeFrameRateStrategy = 0
	ANATIVEWINDOW_CHANGE_FRAME_RATE_ALWAYS           NativeWindow_ChangeFrameRateStrategy = 1
)

type NativeWindow_FrameRateCompatibility

type NativeWindow_FrameRateCompatibility int32
const (
	ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT      NativeWindow_FrameRateCompatibility = 0
	ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_FIXED_SOURCE NativeWindow_FrameRateCompatibility = 1
)

type NativeWindow_LegacyFormat

type NativeWindow_LegacyFormat int32
const (
	WINDOW_FORMAT_RGBA_8888 NativeWindow_LegacyFormat = 1
	WINDOW_FORMAT_RGBX_8888 NativeWindow_LegacyFormat = 2
	WINDOW_FORMAT_RGB_565   NativeWindow_LegacyFormat = 4
)

Jump to

Keyboard shortcuts

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