graphics

package
v3.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGLError

func GetGLError() uint32

func GetGLRendererInfo

func GetGLRendererInfo() string

func GetGLSLInfo

func GetGLSLInfo() string

func GetGLVendorInfo

func GetGLVendorInfo() string

func GetGLVersionInfo

func GetGLVersionInfo() string

func GetGlFbo

func GetGlFbo() uint32

func GetGlProcAddress

func GetGlProcAddress(proc string) unsafe.Pointer

func ReadFramebuffer

func ReadFramebuffer(bytes, w, h uint) []byte

func SetBuffer

func SetBuffer(size int)

func SetPixelFormat

func SetPixelFormat(format PixelFormat) error

Types

type Config

type Config struct {
	Ctx            Context
	W              int
	H              int
	GLAutoContext  bool
	GLVersionMajor uint
	GLVersionMinor uint
	GLHasDepth     bool
	GLHasStencil   bool
}

type Context

type Context int
const (
	CtxNone Context = iota
	CtxOpenGl
	CtxOpenGlEs2
	CtxOpenGlCore
	CtxOpenGlEs3
	CtxOpenGlEsVersion
	CtxVulkan

	CtxUnknown = math.MaxInt32 - 1
	CtxDummy   = math.MaxInt32
)

type PixelFormat

type PixelFormat int
const (
	UnsignedShort5551 PixelFormat = iota
	UnsignedShort565
	UnsignedInt8888Rev
)

type SDL

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

func NewSDLContext

func NewSDLContext(cfg Config, log *logger.Logger) (*SDL, error)

NewSDLContext initializes SDL/OpenGL context. Uses main thread lock (see thread/mainthread).

func (*SDL) BindContext

func (s *SDL) BindContext() error

BindContext explicitly binds context to current thread.

func (*SDL) Deinit

func (s *SDL) Deinit() error

Deinit destroys SDL/OpenGL context. Uses main thread lock (see thread/mainthread).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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