platforms

package
v0.0.0-...-c17e622 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrUnsupportedClientAPI is used in case the API is not available by the platform.
	ErrUnsupportedClientAPI = StringError("unsupported ClientAPI")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GLFW

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

GLFW implements a platform based on github.com/go-gl/glfw (v3.2).

func NewGLFW

func NewGLFW(io *imgui.ImGuiIO, clientAPI GLFWClientAPI) (*GLFW, error)

NewGLFW attempts to initialize a GLFW context.

func (*GLFW) ClipboardText

func (platform *GLFW) ClipboardText() (string, error)

ClipboardText returns the current clipboard text, if available.

func (*GLFW) DisplaySize

func (platform *GLFW) DisplaySize() [2]float32

DisplaySize returns the dimension of the display.

func (*GLFW) Dispose

func (platform *GLFW) Dispose()

Dispose cleans up the resources.

func (*GLFW) FramebufferSize

func (platform *GLFW) FramebufferSize() [2]float32

FramebufferSize returns the dimension of the framebuffer.

func (*GLFW) NewFrame

func (platform *GLFW) NewFrame()

NewFrame marks the begin of a render pass. It forwards all current state to imgui IO.

func (*GLFW) PostRender

func (platform *GLFW) PostRender()

PostRender performs a buffer swap.

func (*GLFW) ProcessEvents

func (platform *GLFW) ProcessEvents()

ProcessEvents handles all pending window events.

func (*GLFW) SetClipboardText

func (platform *GLFW) SetClipboardText(text string)

SetClipboardText sets the text as the current clipboard text.

func (*GLFW) ShouldStop

func (platform *GLFW) ShouldStop() bool

ShouldStop returns true if the window is to be closed.

func (*GLFW) SwapInterval

func (platform *GLFW) SwapInterval(interval int)

SwapInterval sets the GLFW swap interval.

type GLFWClientAPI

type GLFWClientAPI string

GLFWClientAPI identifies the render system that shall be initialized.

const (
	GLFWClientAPIOpenGL2 GLFWClientAPI = "OpenGL2"
	GLFWClientAPIOpenGL3 GLFWClientAPI = "OpenGL3"
)

This is a list of GLFWClientAPI constants.

type StringError

type StringError string

StringError describes a basic error with static information.

func (StringError) Error

func (err StringError) Error() string

Error returns the string itself.

Jump to

Keyboard shortcuts

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