egl

package
v0.0.0-...-8824276 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2018 License: MIT Imports: 3 Imported by: 28

Documentation

Index

Constants

View Source
const (
	VERSION_1_0 = 1
	VERSION_1_1 = 1
	VERSION_1_2 = 1
	VERSION_1_3 = 1
	VERSION_1_4 = 1
)

EGL Versioning

View Source
const (
	DONT_CARE = -1
	UNKNOWN   = -1

	/*
		Constant scale factor by which fractional
		display resolutions & aspect ratio are scaled
		when queried as integer values.
	*/
	DISPLAY_SCALING = 10000
)

Out-of-band attribute value

View Source
const (
	SUCCESS = 0x3000 + iota
	NOT_INITIALIZED
	BAD_ACCESS
	BAD_ALLOC
	BAD_ATTRIBUTE
	BAD_CONFIG
	BAD_CONTEXT
	BAD_CURRENT_SURFACE
	BAD_DISPLAY
	BAD_MATCH
	BAD_NATIVE_PIXMAP
	BAD_NATIVE_WINDOW
	BAD_PARAMETER
	BAD_SURFACE
	CONTEXT_LOST //EGL 1.1 - IMG_power_management

)

Errors / GetError return values

View Source
const (
	BUFFER_SIZE = 0x3020 + iota
	ALPHA_SIZE
	BLUE_SIZE
	GREEN_SIZE
	RED_SIZE
	DEPTH_SIZE
	STENCIL_SIZE
	CONFIG_CAVEAT
	CONFIG_ID
	LEVEL
	MAX_PBUFFER_HEIGHT
	MAX_PBUFFER_PIXELS
	MAX_PBUFFER_WIDTH
	NATIVE_RENDERABLE
	NATIVE_VISUAL_ID
	NATIVE_VISUAL_TYPE

	SAMPLES
	SAMPLE_BUFFERS
	SURFACE_TYPE
	TRANSPARENT_TYPE
	TRANSPARENT_BLUE_VALUE
	TRANSPARENT_GREEN_VALUE
	TRANSPARENT_RED_VALUE
	// Attrib list terminator
	NONE
	BIND_TO_TEXTURE_RGB
	BIND_TO_TEXTURE_RGBA
	MIN_SWAP_INTERVAL
	MAX_SWAP_INTERVAL
	LUMINANCE_SIZE
	ALPHA_MASK_SIZE
	COLOR_BUFFER_TYPE
	RENDERABLE_TYPE
	// Pseudo-attribute (not queryable)
	MATCH_NATIVE_PIXMAP
	CONFORMANT
)

Config attributes

View Source
const (
	PBUFFER_BIT = 0x0001 << iota
	PIXMAP_BIT
	WINDOW_BIT

	VG_COLORSPACE_LINEAR_BIT
	VG_ALPHA_FORMAT_PRE_BIT

	MULTISAMPLE_RESOLVE_BOX_BIT
	SWAP_BEHAVIOR_PRESERVED_BIT
)

SURFACE_TYPE mask bits

View Source
const (
	OPENGL_ES_BIT  = 0x0001 << iota
	OPENVG_BIT     // 0x02
	OPENGL_ES2_BIT // 0x04
	OPENGL_BIT     // 0x08

	OPENGL_ES3_BIT // 0x40
)

RENDERABLE_TYPE mask bits

View Source
const (
	// CONFIG_CAVEAT values
	SLOW_CONFIG = 0x3050 + iota
	NON_CONFORMANT_CONFIG

	// TRANSPARENT_TYPE value
	TRANSPARENT_RGB
	/* QueryString targets */
	VENDOR
	VERSION
	EXTENSIONS

	/* QuerySurface & SurfaceAttrib & CreatePbufferSurface targets */
	HEIGHT
	WIDTH
	LARGEST_PBUFFER

	/* GetCurrentSurface targets */
	DRAW
	READ

	/* WaitNative engines */
	CORE_NATIVE_ENGINE

	/* Config attribute values for EGL_TEXTURE_FORMAT*/
	NO_TEXTURE
	TEXTURE_RGB
	TEXTURE_RGBA
	TEXTURE_2D
)
View Source
const (

	// more QuerySurface & SurfaceAttrib & CreatePbufferSurface targets
	TEXTURE_FORMAT = 0x3080 + iota
	TEXTURE_TARGET
	MIPMAP_TEXTURE
	MIPMAP_LEVEL

	/* BindTexImage & ReleaseTexImage buffer targets */
	BACK_BUFFER
	SINGLE_BUFFER
	RENDER_BUFFER

	/* OpenVG color spaces and alpha formats */
	VG_COLORSPACE
	VG_ALPHA_FORMAT
	VG_COLORSPACE_sRGB
	VG_COLORSPACE_LINEAR
	VG_ALPHA_FORMAT_NONPRE
	VG_ALPHA_FORMAT_PRE

	/* QueryString target */
	CLIENT_APIS

	/* Config attribute values */
	RGB_BUFFER
	LUMINANCE_BUFFER

	HORIZONTAL_RESOLUTION
	VERTICAL_RESOLUTION
	PIXEL_ASPECT_RATIO
	SWAP_BEHAVIOR

	/* Back buffer swap behaviors */
	BUFFER_PRESERVED
	BUFFER_DESTROYED

	/* CreatePbufferFromClientBuffer buffer types */
	OPENVG_IMAGE

	/* QueryContext targets */
	CONTEXT_CLIENT_TYPE

	/* CreateContext attributes */
	CONTEXT_CLIENT_VERSION

	MULTISAMPLE_RESOLVE

	/* Multisample resolution behaviors */
	MULTISAMPLE_RESOLVE_DEFAULT
	MULTISAMPLE_RESOLVE_BOX

	/* BindAPI & QueryAPI targets */
	OPENGL_ES_API
	OPENVG_API
	OPENGL_API
)
View Source
const (
	COLORSPACE          = VG_COLORSPACE
	ALPHA_FORMAT        = VG_ALPHA_FORMAT
	COLORSPACE_sRGB     = VG_COLORSPACE_sRGB
	COLORSPACE_LINEAR   = VG_COLORSPACE_LINEAR
	ALPHA_FORMAT_NONPRE = VG_ALPHA_FORMAT_NONPRE
	ALPHA_FORMAT_PRE    = VG_ALPHA_FORMAT_PRE
)

EGL 1.2 tokens renamed for consistency in EGL 1.3

View Source
const (
	CONTEXT_MAJOR_VERSION = 0x3098
	CONTEXT_MINOR_VERSION = 0x30fb
)

Variables

View Source
var (
	DEFAULT_DISPLAY NativeDisplay
	NO_CONTEXT      Context
	NO_DISPLAY      Display
	NO_SURFACE      Surface
)
View Source
var Version struct{ Maj, Min EGLint }

Functions

func BindAPI

func BindAPI(api uint) bool

func BindTexImage

func BindTexImage(d Display, s Surface, buf int) bool

func ChooseConfig

func ChooseConfig(d Display, atrribs []EGLint, confs []Config) int

func CopyBuffers

func CopyBuffers(d Display, s Surface, target NativePixmap) bool

func DestroyContext

func DestroyContext(d Display, c Context) bool

func DestroySurface

func DestroySurface(d Display, s Surface) bool

func GetConfigAttrib

func GetConfigAttrib(d Display, conf Config, attr int) (int, bool)

func GetConfigs

func GetConfigs(d Display, confs []Config) int

func Initialize

func Initialize(d Display) bool

func MakeCurrent

func MakeCurrent(d Display, draw Surface, read Surface, c Context) bool

func QueryAPI

func QueryAPI() uint

func QueryContext

func QueryContext(d Display, c Context, attr int, val []EGLint) bool

func QueryString

func QueryString(d Display, name int) string

func ReleaseTexImage

func ReleaseTexImage(d Display, s Surface, buf int) bool

func ReleaseThread

func ReleaseThread() bool

func SurfaceAttrib

func SurfaceAttrib(d Display, s Surface, attr int, val int) bool

func SwapBuffers

func SwapBuffers(d Display, s Surface) bool

func SwapInterval

func SwapInterval(d Display, inv int) bool

func Terminate

func Terminate(d Display) bool

func WaitClient

func WaitClient() bool

func WaitGL

func WaitGL() bool

func WaitNative

func WaitNative(engine int) bool

Types

type ClientBuffer

type ClientBuffer unsafe.Pointer

type Config

type Config unsafe.Pointer

type Context

type Context unsafe.Pointer

func CreateContext

func CreateContext(d Display, conf Config, shared Context, attribs []EGLint) Context

type Display

type Display unsafe.Pointer

func GetCurrentDisplay

func GetCurrentDisplay() Display

func GetDisplay

func GetDisplay(d NativeDisplay) Display

type EGLContext

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

func CreateEGLContext

func CreateEGLContext(native NativeObj) *EGLContext

func CreateEGLContextEx

func CreateEGLContextEx(native NativeObj, depthSize, esVersion int) *EGLContext

func NewContext

func NewContext(window NativeWindow, ndisplay NativeDisplay) *EGLContext

depthSize : 16, 24 * esVersion : 2 (es2), 3 (es3)

func NewContextEx

func NewContextEx(window NativeWindow, ndisplay NativeDisplay, depthSize, esVersion, minor int) *EGLContext

func (*EGLContext) GetFormat

func (ctx *EGLContext) GetFormat() int

func (*EGLContext) InitEGLContext

func (ctx *EGLContext) InitEGLContext() bool

func (*EGLContext) InitEGLSurface

func (ctx *EGLContext) InitEGLSurface() bool

func (*EGLContext) InitEGLSurfaceX

func (ctx *EGLContext) InitEGLSurfaceX() bool

func (*EGLContext) InitEGLSurface_XX

func (ctx *EGLContext) InitEGLSurface_XX() bool

auto match

func (*EGLContext) IsReady

func (ctx *EGLContext) IsReady() bool

func (*EGLContext) ReinitEGLContext

func (ctx *EGLContext) ReinitEGLContext() bool

func (*EGLContext) Resume

func (ctx *EGLContext) Resume() bool

func (*EGLContext) Suspend

func (ctx *EGLContext) Suspend()

func (*EGLContext) SwapBuffers

func (ctx *EGLContext) SwapBuffers() bool

func (*EGLContext) Terminate

func (ctx *EGLContext) Terminate()

type EGLint

type EGLint C.EGLint

func QuerySurface

func QuerySurface(d Display, s Surface, attr int) (EGLint, bool)

type Error

type Error int

func GetError

func GetError() Error

func (Error) Error

func (e Error) Error() string

type NativeDisplay

type NativeDisplay unsafe.Pointer

type NativeObj

type NativeObj interface {
	NativeDisplay() unsafe.Pointer
	NativeWindow() unsafe.Pointer
	SetBuffersGeometry(int) int
	WindowSize() (w, h int)
}

type NativePixmap

type NativePixmap unsafe.Pointer

type NativeWindow

type NativeWindow unsafe.Pointer

type Surface

type Surface unsafe.Pointer

func CreatePbufferFromClientBuffer

func CreatePbufferFromClientBuffer(
	d Display, buftyp uint, conf Config, buf ClientBuffer, attribs []EGLint) Surface

func CreatePbufferSurface

func CreatePbufferSurface(d Display, conf Config, attribs []EGLint) Surface

func CreatePixmapSurface

func CreatePixmapSurface(d Display, conf Config, pixmap NativePixmap, attribs []EGLint) Surface

func CreateWindowSurface

func CreateWindowSurface(d Display, conf Config, win NativeWindow, attribs []EGLint) Surface

func GetCurrentSurface

func GetCurrentSurface(readdraw int) Surface

type Window

type Window unsafe.Pointer

Jump to

Keyboard shortcuts

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