Documentation
¶
Index ¶
- Constants
- func ForceX11()
- type GLFWKey
- type GLFWModifierKey
- type GLFWVulkanBackend
- func (b *GLFWVulkanBackend) AfterCreateHook() func()
- func (b *GLFWVulkanBackend) AfterRenderHook() func()
- func (b *GLFWVulkanBackend) AttachToExistingWindow(window *glfw.Window, instance vk.Instance, device vk.Device, ...)
- func (b *GLFWVulkanBackend) BeforeDestroyHook() func()
- func (b *GLFWVulkanBackend) BeforeRenderHook() func()
- func (b *GLFWVulkanBackend) Cleanup()
- func (b *GLFWVulkanBackend) CloseCallback() func(wnd unsafe.Pointer)
- func (b *GLFWVulkanBackend) ContentScale() (width, height float32)
- func (b *GLFWVulkanBackend) CreateTexture(pixels unsafe.Pointer, width, height int) imgui.TextureRef
- func (b *GLFWVulkanBackend) CreateTextureRgba(img *image.RGBA, width, height int) imgui.TextureRef
- func (b *GLFWVulkanBackend) CreateWindow(title string, width, height int)
- func (b *GLFWVulkanBackend) DeleteTexture(id imgui.TextureRef)
- func (b *GLFWVulkanBackend) DisplaySize() (width int32, height int32)
- func (b *GLFWVulkanBackend) DropCallback() backend.DropCallback
- func (b *GLFWVulkanBackend) GetWindowPos() (x, y int32)
- func (b *GLFWVulkanBackend) KeyCallback() backend.KeyCallback
- func (b *GLFWVulkanBackend) LoopFunc() func()
- func (b *GLFWVulkanBackend) NewFrame(imageIndex int)
- func (b *GLFWVulkanBackend) Refresh()
- func (b *GLFWVulkanBackend) RenderFrame(imageIndex int)
- func (b *GLFWVulkanBackend) Run(loop func())
- func (b *GLFWVulkanBackend) SetAfterCreateContextHook(hook func())
- func (b *GLFWVulkanBackend) SetAfterRenderHook(hook func())
- func (b *GLFWVulkanBackend) SetBeforeDestroyContextHook(hook func())
- func (b *GLFWVulkanBackend) SetBeforeRenderHook(hook func())
- func (b *GLFWVulkanBackend) SetBgColor(color imgui.Vec4)
- func (b *GLFWVulkanBackend) SetCloseCallback(cbfun backend.WindowCloseCallback)
- func (b *GLFWVulkanBackend) SetCursorPos(x, y float64)
- func (b *GLFWVulkanBackend) SetDropCallback(cbfun backend.DropCallback)
- func (b *GLFWVulkanBackend) SetIcons(images ...image.Image)
- func (b *GLFWVulkanBackend) SetInputMode(mode GLFWWindowFlags, value GLFWWindowFlags)
- func (b *GLFWVulkanBackend) SetKeyCallback(cbfun backend.KeyCallback)
- func (b *GLFWVulkanBackend) SetShouldClose(value bool)
- func (b *GLFWVulkanBackend) SetSizeChangeCallback(cbfun backend.SizeChangeCallback)
- func (b *GLFWVulkanBackend) SetSwapInterval(interval GLFWWindowFlags) error
- func (b *GLFWVulkanBackend) SetTargetFPS(fps uint)
- func (b *GLFWVulkanBackend) SetWindowFlags(flag GLFWWindowFlags, value int)
- func (b *GLFWVulkanBackend) SetWindowPos(x, y int)
- func (b *GLFWVulkanBackend) SetWindowSize(width, height int)
- func (b *GLFWVulkanBackend) SetWindowSizeLimits(minWidth, minHeight, maxWidth, maxHeight int)
- func (b *GLFWVulkanBackend) SetWindowTitle(title string)
- func (b *GLFWVulkanBackend) SizeCallback() backend.SizeChangeCallback
- type GLFWWindowFlags
Constants ¶
View Source
const ( GLFWWindowFlagsNone = GLFWWindowFlags(C.GLFWWindowNone) GLFWWindowFlagsResizable = GLFWWindowFlags(C.GLFWWindowResizable) GLFWWindowFlagsMaximized = GLFWWindowFlags(C.GLFWWindowMaximized) GLFWWindowFlagsDecorated = GLFWWindowFlags(C.GLFWWindowDecorated) GLFWWindowFlagsTransparent = GLFWWindowFlags(C.GLFWWindowTransparentFramebuffer) GLFWWindowFlagsVisible = GLFWWindowFlags(C.GLFWWindowVisible) GLFWWindowFlagsFloating = GLFWWindowFlags(C.GLFWWindowFloating) GLFWWindowFlagsFocused = GLFWWindowFlags(C.GLFWWindowFocused) GLFWWindowFlagsIconified = GLFWWindowFlags(C.GLFWWindowIconified) GLFWWindowFlagsAutoIconify = GLFWWindowFlags(C.GLFWWindowAutoIconify) GLFWWindowFlagsMousePassthrough = GLFWWindowFlags(C.GLFWWindowMousePassthrough) )
Window flags
View Source
const ( GLFWSwapIntervalImmediate = GLFWWindowFlags(0) GLFWSwapIntervalVsync = GLFWWindowFlags(1) )
SwapInterval values
View Source
const ( GLFWInputModeCursor = GLFWWindowFlags(C.GLFW_CURSOR) GLFWInputModeCursorNormal = GLFWWindowFlags(C.GLFW_CURSOR_NORMAL) GLFWInputModeCursorHidden = GLFWWindowFlags(C.GLFW_CURSOR_HIDDEN) GLFWInputModeCursorDisabled = GLFWWindowFlags(C.GLFW_CURSOR_DISABLED) GLFWInputModeRawMouseMotion = GLFWWindowFlags(C.GLFW_RAW_MOUSE_MOTION) )
Input modes
View Source
const ( GLFWKeySpace = GLFWKey(C.GLFWKeySpace) GLFWKeyApostrophe = GLFWKey(C.GLFWKeyApostrophe) GLFWKeyComma = GLFWKey(C.GLFWKeyComma) GLFWKeyMinus = GLFWKey(C.GLFWKeyMinus) GLFWKeyPeriod = GLFWKey(C.GLFWKeyPeriod) GLFWKeySlash = GLFWKey(C.GLFWKeySlash) GLFWKey0 = GLFWKey(C.GLFWKey0) GLFWKey1 = GLFWKey(C.GLFWKey1) GLFWKey2 = GLFWKey(C.GLFWKey2) GLFWKey3 = GLFWKey(C.GLFWKey3) GLFWKey4 = GLFWKey(C.GLFWKey4) GLFWKey5 = GLFWKey(C.GLFWKey5) GLFWKey6 = GLFWKey(C.GLFWKey6) GLFWKey7 = GLFWKey(C.GLFWKey7) GLFWKey8 = GLFWKey(C.GLFWKey8) GLFWKey9 = GLFWKey(C.GLFWKey9) GLFWKeySemicolon = GLFWKey(C.GLFWKeySemicolon) GLFWKeyEqual = GLFWKey(C.GLFWKeyEqual) GLFWKeyA = GLFWKey(C.GLFWKeyA) GLFWKeyB = GLFWKey(C.GLFWKeyB) GLFWKeyC = GLFWKey(C.GLFWKeyC) GLFWKeyD = GLFWKey(C.GLFWKeyD) GLFWKeyE = GLFWKey(C.GLFWKeyE) GLFWKeyF = GLFWKey(C.GLFWKeyF) GLFWKeyG = GLFWKey(C.GLFWKeyG) GLFWKeyH = GLFWKey(C.GLFWKeyH) GLFWKeyI = GLFWKey(C.GLFWKeyI) GLFWKeyJ = GLFWKey(C.GLFWKeyJ) GLFWKeyK = GLFWKey(C.GLFWKeyK) GLFWKeyL = GLFWKey(C.GLFWKeyL) GLFWKeyM = GLFWKey(C.GLFWKeyM) GLFWKeyN = GLFWKey(C.GLFWKeyN) GLFWKeyO = GLFWKey(C.GLFWKeyO) GLFWKeyP = GLFWKey(C.GLFWKeyP) GLFWKeyQ = GLFWKey(C.GLFWKeyQ) GLFWKeyR = GLFWKey(C.GLFWKeyR) GLFWKeyS = GLFWKey(C.GLFWKeyS) GLFWKeyT = GLFWKey(C.GLFWKeyT) GLFWKeyU = GLFWKey(C.GLFWKeyU) GLFWKeyV = GLFWKey(C.GLFWKeyV) GLFWKeyW = GLFWKey(C.GLFWKeyW) GLFWKeyX = GLFWKey(C.GLFWKeyX) GLFWKeyY = GLFWKey(C.GLFWKeyY) GLFWKeyZ = GLFWKey(C.GLFWKeyZ) GLFWKeyLeftBracket = GLFWKey(C.GLFWKeyLeftBracket) GLFWKeyBackslash = GLFWKey(C.GLFWKeyBackslash) GLFWKeyRightBracket = GLFWKey(C.GLFWKeyRightBracket) GLFWKeyGraveAccent = GLFWKey(C.GLFWKeyGraveAccent) GLFWKeyWorld1 = GLFWKey(C.GLFWKeyWorld1) GLFWKeyWorld2 = GLFWKey(C.GLFWKeyWorld2) /* Function keys */ GLFWKeyEscape = GLFWKey(C.GLFWKeyEscape) GLFWKeyEnter = GLFWKey(C.GLFWKeyEnter) GLFWKeyTab = GLFWKey(C.GLFWKeyTab) GLFWKeyBackspace = GLFWKey(C.GLFWKeyBackspace) GLFWKeyInsert = GLFWKey(C.GLFWKeyInsert) GLFWKeyDelete = GLFWKey(C.GLFWKeyDelete) GLFWKeyRight = GLFWKey(C.GLFWKeyRight) GLFWKeyLeft = GLFWKey(C.GLFWKeyLeft) GLFWKeyDown = GLFWKey(C.GLFWKeyDown) GLFWKeyUp = GLFWKey(C.GLFWKeyUp) GLFWKeyPageUp = GLFWKey(C.GLFWKeyPageUp) GLFWKeyPageDown = GLFWKey(C.GLFWKeyPageDown) GLFWKeyHome = GLFWKey(C.GLFWKeyHome) GLFWKeyEnd = GLFWKey(C.GLFWKeyEnd) GLFWKeyCapsLock = GLFWKey(C.GLFWKeyCapsLock) GLFWKeyScrollLock = GLFWKey(C.GLFWKeyScrollLock) GLFWKeyNumLock = GLFWKey(C.GLFWKeyNumLock) GLFWKeyPrintScreen = GLFWKey(C.GLFWKeyPrintScreen) GLFWKeyPause = GLFWKey(C.GLFWKeyPause) GLFWKeyF1 = GLFWKey(C.GLFWKeyF1) GLFWKeyF2 = GLFWKey(C.GLFWKeyF2) GLFWKeyF3 = GLFWKey(C.GLFWKeyF3) GLFWKeyF4 = GLFWKey(C.GLFWKeyF4) GLFWKeyF5 = GLFWKey(C.GLFWKeyF5) GLFWKeyF6 = GLFWKey(C.GLFWKeyF6) GLFWKeyF7 = GLFWKey(C.GLFWKeyF7) GLFWKeyF8 = GLFWKey(C.GLFWKeyF8) GLFWKeyF9 = GLFWKey(C.GLFWKeyF9) GLFWKeyF10 = GLFWKey(C.GLFWKeyF10) GLFWKeyF11 = GLFWKey(C.GLFWKeyF11) GLFWKeyF12 = GLFWKey(C.GLFWKeyF12) GLFWKeyF13 = GLFWKey(C.GLFWKeyF13) GLFWKeyF14 = GLFWKey(C.GLFWKeyF14) GLFWKeyF15 = GLFWKey(C.GLFWKeyF15) GLFWKeyF16 = GLFWKey(C.GLFWKeyF16) GLFWKeyF17 = GLFWKey(C.GLFWKeyF17) GLFWKeyF18 = GLFWKey(C.GLFWKeyF18) GLFWKeyF19 = GLFWKey(C.GLFWKeyF19) GLFWKeyF20 = GLFWKey(C.GLFWKeyF20) GLFWKeyF21 = GLFWKey(C.GLFWKeyF21) GLFWKeyF22 = GLFWKey(C.GLFWKeyF22) GLFWKeyF23 = GLFWKey(C.GLFWKeyF23) GLFWKeyF24 = GLFWKey(C.GLFWKeyF24) GLFWKeyF25 = GLFWKey(C.GLFWKeyF25) GLFWKeyKp0 = GLFWKey(C.GLFWKeyKp0) GLFWKeyKp1 = GLFWKey(C.GLFWKeyKp1) GLFWKeyKp2 = GLFWKey(C.GLFWKeyKp2) GLFWKeyKp3 = GLFWKey(C.GLFWKeyKp3) GLFWKeyKp4 = GLFWKey(C.GLFWKeyKp4) GLFWKeyKp5 = GLFWKey(C.GLFWKeyKp5) GLFWKeyKp6 = GLFWKey(C.GLFWKeyKp6) GLFWKeyKp7 = GLFWKey(C.GLFWKeyKp7) GLFWKeyKp8 = GLFWKey(C.GLFWKeyKp8) GLFWKeyKp9 = GLFWKey(C.GLFWKeyKp9) GLFWKeyKpDecimal = GLFWKey(C.GLFWKeyKpDecimal) GLFWKeyKpDivide = GLFWKey(C.GLFWKeyKpDivide) GLFWKeyKpMultiply = GLFWKey(C.GLFWKeyKpMultiply) GLFWKeyKpSubtract = GLFWKey(C.GLFWKeyKpSubtract) GLFWKeyKpAdd = GLFWKey(C.GLFWKeyKpAdd) GLFWKeyKpEnter = GLFWKey(C.GLFWKeyKpEnter) GLFWKeyKpEqual = GLFWKey(C.GLFWKeyKpEqual) GLFWKeyLeftShift = GLFWKey(C.GLFWKeyLeftShift) GLFWKeyLeftControl = GLFWKey(C.GLFWKeyLeftControl) GLFWKeyLeftAlt = GLFWKey(C.GLFWKeyLeftAlt) GLFWKeyLeftSuper = GLFWKey(C.GLFWKeyLeftSuper) GLFWKeyRightShift = GLFWKey(C.GLFWKeyRightShift) GLFWKeyRightControl = GLFWKey(C.GLFWKeyRightControl) GLFWKeyRightAlt = GLFWKey(C.GLFWKeyRightAlt) GLFWKeyRightSuper = GLFWKey(C.GLFWKeyRightSuper) GLFWKeyMenu = GLFWKey(C.GLFWKeyMenu) )
View Source
const ( GLFWModShift = GLFWModifierKey(C.GLFWModShift) GLFWModControl = GLFWModifierKey(C.GLFWModControl) GLFWModAlt = GLFWModifierKey(C.GLFWModAlt) GLFWModSuper = GLFWModifierKey(C.GLFWModSuper) GLFWModCapsLock = GLFWModifierKey(C.GLFWModCapsLock) GLFWModNumLock = GLFWModifierKey(C.GLFWModNumLock) )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GLFWModifierKey ¶
type GLFWModifierKey int
type GLFWVulkanBackend ¶
type GLFWVulkanBackend struct {
AttachedWindow *glfw.Window
// contains filtered or unexported fields
}
func NewGLFWBackend ¶
func NewGLFWBackend() *GLFWVulkanBackend
func (*GLFWVulkanBackend) AfterCreateHook ¶
func (b *GLFWVulkanBackend) AfterCreateHook() func()
func (*GLFWVulkanBackend) AfterRenderHook ¶
func (b *GLFWVulkanBackend) AfterRenderHook() func()
func (*GLFWVulkanBackend) AttachToExistingWindow ¶
func (b *GLFWVulkanBackend) AttachToExistingWindow(window *glfw.Window, instance vk.Instance, device vk.Device, physical_device vk.PhysicalDevice, graphics_queue vk.Queue, pipeline_cache vk.PipelineCache, graphics_queue_family uint32, swapchainImageResources []*as.SwapchainImageResources, swapchainDimensions *as.SwapchainDimensions)
func (*GLFWVulkanBackend) BeforeDestroyHook ¶
func (b *GLFWVulkanBackend) BeforeDestroyHook() func()
func (*GLFWVulkanBackend) BeforeRenderHook ¶
func (b *GLFWVulkanBackend) BeforeRenderHook() func()
func (*GLFWVulkanBackend) Cleanup ¶
func (b *GLFWVulkanBackend) Cleanup()
func (*GLFWVulkanBackend) CloseCallback ¶
func (b *GLFWVulkanBackend) CloseCallback() func(wnd unsafe.Pointer)
func (*GLFWVulkanBackend) ContentScale ¶
func (b *GLFWVulkanBackend) ContentScale() (width, height float32)
func (*GLFWVulkanBackend) CreateTexture ¶
func (b *GLFWVulkanBackend) CreateTexture(pixels unsafe.Pointer, width, height int) imgui.TextureRef
func (*GLFWVulkanBackend) CreateTextureRgba ¶
func (b *GLFWVulkanBackend) CreateTextureRgba(img *image.RGBA, width, height int) imgui.TextureRef
func (*GLFWVulkanBackend) CreateWindow ¶
func (b *GLFWVulkanBackend) CreateWindow(title string, width, height int)
func (*GLFWVulkanBackend) DeleteTexture ¶
func (b *GLFWVulkanBackend) DeleteTexture(id imgui.TextureRef)
func (*GLFWVulkanBackend) DisplaySize ¶
func (b *GLFWVulkanBackend) DisplaySize() (width int32, height int32)
func (*GLFWVulkanBackend) DropCallback ¶
func (b *GLFWVulkanBackend) DropCallback() backend.DropCallback
func (*GLFWVulkanBackend) GetWindowPos ¶
func (b *GLFWVulkanBackend) GetWindowPos() (x, y int32)
func (*GLFWVulkanBackend) KeyCallback ¶
func (b *GLFWVulkanBackend) KeyCallback() backend.KeyCallback
func (*GLFWVulkanBackend) LoopFunc ¶
func (b *GLFWVulkanBackend) LoopFunc() func()
func (*GLFWVulkanBackend) NewFrame ¶
func (b *GLFWVulkanBackend) NewFrame(imageIndex int)
func (*GLFWVulkanBackend) Refresh ¶
func (b *GLFWVulkanBackend) Refresh()
func (*GLFWVulkanBackend) RenderFrame ¶
func (b *GLFWVulkanBackend) RenderFrame(imageIndex int)
func (*GLFWVulkanBackend) Run ¶
func (b *GLFWVulkanBackend) Run(loop func())
func (*GLFWVulkanBackend) SetAfterCreateContextHook ¶
func (b *GLFWVulkanBackend) SetAfterCreateContextHook(hook func())
func (*GLFWVulkanBackend) SetAfterRenderHook ¶
func (b *GLFWVulkanBackend) SetAfterRenderHook(hook func())
func (*GLFWVulkanBackend) SetBeforeDestroyContextHook ¶
func (b *GLFWVulkanBackend) SetBeforeDestroyContextHook(hook func())
func (*GLFWVulkanBackend) SetBeforeRenderHook ¶
func (b *GLFWVulkanBackend) SetBeforeRenderHook(hook func())
func (*GLFWVulkanBackend) SetBgColor ¶
func (b *GLFWVulkanBackend) SetBgColor(color imgui.Vec4)
func (*GLFWVulkanBackend) SetCloseCallback ¶
func (b *GLFWVulkanBackend) SetCloseCallback(cbfun backend.WindowCloseCallback)
func (*GLFWVulkanBackend) SetCursorPos ¶
func (b *GLFWVulkanBackend) SetCursorPos(x, y float64)
func (*GLFWVulkanBackend) SetDropCallback ¶
func (b *GLFWVulkanBackend) SetDropCallback(cbfun backend.DropCallback)
SetDropCallback sets the drop callback which is called when an object is dropped over the window.
func (*GLFWVulkanBackend) SetIcons ¶
func (b *GLFWVulkanBackend) SetIcons(images ...image.Image)
SetIcons sets icons for the window. THIS CODE COMES FROM https://github.com/elokore/glfw (BSD-3 clause) - Copyright (c) 2012 The glfw3-go Authors. All rights reserved.
func (*GLFWVulkanBackend) SetInputMode ¶
func (b *GLFWVulkanBackend) SetInputMode(mode GLFWWindowFlags, value GLFWWindowFlags)
func (*GLFWVulkanBackend) SetKeyCallback ¶
func (b *GLFWVulkanBackend) SetKeyCallback(cbfun backend.KeyCallback)
func (*GLFWVulkanBackend) SetShouldClose ¶
func (b *GLFWVulkanBackend) SetShouldClose(value bool)
func (*GLFWVulkanBackend) SetSizeChangeCallback ¶
func (b *GLFWVulkanBackend) SetSizeChangeCallback(cbfun backend.SizeChangeCallback)
func (*GLFWVulkanBackend) SetSwapInterval ¶
func (b *GLFWVulkanBackend) SetSwapInterval(interval GLFWWindowFlags) error
func (*GLFWVulkanBackend) SetTargetFPS ¶
func (b *GLFWVulkanBackend) SetTargetFPS(fps uint)
func (*GLFWVulkanBackend) SetWindowFlags ¶
func (b *GLFWVulkanBackend) SetWindowFlags(flag GLFWWindowFlags, value int)
SetWindowHint applies to next CreateWindow call so use it before CreateWindow call ;-)
func (*GLFWVulkanBackend) SetWindowPos ¶
func (b *GLFWVulkanBackend) SetWindowPos(x, y int)
func (*GLFWVulkanBackend) SetWindowSize ¶
func (b *GLFWVulkanBackend) SetWindowSize(width, height int)
func (*GLFWVulkanBackend) SetWindowSizeLimits ¶
func (b *GLFWVulkanBackend) SetWindowSizeLimits(minWidth, minHeight, maxWidth, maxHeight int)
The minimum and maximum size of the content area of a windowed mode window. To specify only a minimum size or only a maximum one, set the other pair to -1 e.g. SetWindowSizeLimits(640, 480, -1, -1)
func (*GLFWVulkanBackend) SetWindowTitle ¶
func (b *GLFWVulkanBackend) SetWindowTitle(title string)
func (*GLFWVulkanBackend) SizeCallback ¶
func (b *GLFWVulkanBackend) SizeCallback() backend.SizeChangeCallback
type GLFWWindowFlags ¶
type GLFWWindowFlags int
Click to show internal directories.
Click to hide internal directories.