graphics

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindContext

func BindContext()

BindContext explicitly binds context to current thread.

func Deinit

func Deinit()

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

func GetGlFbo

func GetGlFbo() uint32

func GetGlProcAddress

func GetGlProcAddress(proc string) unsafe.Pointer

func Init

func Init(cfg Config)

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

func PrintDriverInfo

func PrintDriverInfo()

PrintDriverInfo prints OpenGL information.

func ReadFramebuffer

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

func SetPixelFormat

func SetPixelFormat(format PixelFormat)

Types

type Config

type Config struct {
	Ctx Context
	W   int
	H   int
	Gl  GlConfig
}

type Context

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

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

type GlConfig

type GlConfig struct {
	AutoContext  bool
	VersionMajor uint
	VersionMinor uint
	HasDepth     bool
	HasStencil   bool
}

type PixelFormat

type PixelFormat int

OpenGL pixel format

const (
	UnsignedShort5551 PixelFormat = iota
	UnsignedShort565
	UnsignedInt8888Rev
)

Jump to

Keyboard shortcuts

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