Documentation ¶
Index ¶
- Variables
- func BIT(i int) int
- type AppRenderEvent
- type AppTickEvent
- type AppUpdateEvent
- type Dispatcher
- type Event
- type EventCategory
- type EventType
- type IEvent
- type KeyPressedEvent
- type KeyReleasedEvent
- type MouseButtonPressedEvent
- type MouseButtonReleasedEvent
- type MouseMovedEvent
- type MouseScrolledEvent
- type WindowCloseEvent
- type WindowResizeEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NoEventCategory EventCategory = 0 EventCategoryApplication = BIT(1) EventCategoryInput = BIT(2) EventCategoryKeyboard = BIT(3) EventCategoryMouse = BIT(4) EventCategoryMouseButton = BIT(5) )
Enum to represent each of the possible Event Categories
Functions ¶
Types ¶
type AppRenderEvent ¶
type AppRenderEvent struct {
*Event
}
----APP RENDER EVENT----
func NewAppRenderEvent ¶
func NewAppRenderEvent() *AppRenderEvent
func (AppRenderEvent) GetEventForDispatch ¶
func (are AppRenderEvent) GetEventForDispatch() *Event
func (AppRenderEvent) String ¶
func (are AppRenderEvent) String() string
type AppTickEvent ¶
type AppTickEvent struct {
*Event
}
----APP TICK EVENT----
func NewAppTickEvent ¶
func NewAppTickEvent() *AppTickEvent
func (AppTickEvent) GetEventForDispatch ¶
func (ate AppTickEvent) GetEventForDispatch() *Event
func (AppTickEvent) String ¶
func (ate AppTickEvent) String() string
type AppUpdateEvent ¶
type AppUpdateEvent struct {
*Event
}
----APP UPDATE EVENT----
func NewAppUpdateEvent ¶
func NewAppUpdateEvent() *AppUpdateEvent
func (AppUpdateEvent) GetEventForDispatch ¶
func (aue AppUpdateEvent) GetEventForDispatch() *Event
func (AppUpdateEvent) String ¶
func (aue AppUpdateEvent) String() string
type Dispatcher ¶
type Dispatcher struct {
Event IEvent
}
type Event ¶
Events might be blocking depending on how I can implement this in Go. Just something to keep in mind. Good thing Go is great at concurrency, so this should be easy to fix down the line.
func (Event) IsInCategory ¶
func (e Event) IsInCategory(category EventCategory) bool
Checks if Bitmask contains the flag for the specific EventCategory
type EventCategory ¶
type EventCategory int
type EventType ¶
type EventType int
const ( NoEventType EventType = iota EventTypeWindowResize EventTypeWindowClose EventTypeWindowFocus EventTypeWindowLostFocus EventTypeWindowMoved EventTypeAppTick EventTypeAppUpdate EventTypeAppRender EventTypeKeyPressed EventTypeKeyReleased EventTypeMouseButtonPressed EventTypeMouseButtonReleased EventTypeMouseMoved EventTypeMouseScrolled )
Enum to represent each of the possible Event Types
type KeyPressedEvent ¶
type KeyPressedEvent struct { *Event KeyCode glfw.Key RepeatCount int // Represents the key pressed repeat state, and how many times that key-press has been repeated }
----KEY PRESSED EVENT----
func NewKeyPressedEvent ¶
func NewKeyPressedEvent(keycode glfw.Key, repeatCount int) *KeyPressedEvent
func (KeyPressedEvent) GetEventForDispatch ¶
func (kpe KeyPressedEvent) GetEventForDispatch() *Event
func (KeyPressedEvent) String ¶
func (kpe KeyPressedEvent) String() string
type KeyReleasedEvent ¶
----KEY RELEASED EVENT----
func NewKeyReleasedEvent ¶
func NewKeyReleasedEvent(keycode glfw.Key) *KeyReleasedEvent
func (KeyReleasedEvent) GetEventForDispatch ¶
func (kre KeyReleasedEvent) GetEventForDispatch() *Event
func (KeyReleasedEvent) String ¶
func (kre KeyReleasedEvent) String() string
type MouseButtonPressedEvent ¶
type MouseButtonPressedEvent struct { *Event Button glfw.MouseButton }
----MOUSE BUTTON PRESSED EVENT----
func NewMouseButtonPressedEvent ¶
func NewMouseButtonPressedEvent(button glfw.MouseButton) *MouseButtonPressedEvent
func (MouseButtonPressedEvent) GetEventForDispatch ¶
func (mbpe MouseButtonPressedEvent) GetEventForDispatch() *Event
func (MouseButtonPressedEvent) String ¶
func (mbpe MouseButtonPressedEvent) String() string
type MouseButtonReleasedEvent ¶
type MouseButtonReleasedEvent struct { *Event Button glfw.MouseButton }
----MOUSE BUTTON RELEASED EVENT----
func NewMouseButtonReleasedEvent ¶
func NewMouseButtonReleasedEvent(button glfw.MouseButton) *MouseButtonReleasedEvent
func (MouseButtonReleasedEvent) GetEventForDispatch ¶
func (mbre MouseButtonReleasedEvent) GetEventForDispatch() *Event
func (MouseButtonReleasedEvent) String ¶
func (mbre MouseButtonReleasedEvent) String() string
type MouseMovedEvent ¶
----MOUSE MOVED EVENT----
func NewMouseMovedEvent ¶
func NewMouseMovedEvent(x, y float64) *MouseMovedEvent
func (MouseMovedEvent) GetEventForDispatch ¶
func (mme MouseMovedEvent) GetEventForDispatch() *Event
func (MouseMovedEvent) String ¶
func (mme MouseMovedEvent) String() string
type MouseScrolledEvent ¶
type MouseScrolledEvent struct { *Event XOffset float64 // X Position of the cursor at scroll event YOffset float64 // Y Position of the cursor at scroll event }
----MOUSE SCROLLED EVENT----
func NewMouseScrolledEvent ¶
func NewMouseScrolledEvent(xoff, yoff float64) *MouseScrolledEvent
func (MouseScrolledEvent) GetEventForDispatch ¶
func (mse MouseScrolledEvent) GetEventForDispatch() *Event
func (MouseScrolledEvent) String ¶
func (mse MouseScrolledEvent) String() string
type WindowCloseEvent ¶
type WindowCloseEvent struct {
*Event
}
----WINDOW CLOSE EVENT----
func NewWindowCloseEvent ¶
func NewWindowCloseEvent() *WindowCloseEvent
func (WindowCloseEvent) GetEventForDispatch ¶
func (wce WindowCloseEvent) GetEventForDispatch() *Event
func (WindowCloseEvent) String ¶
func (wce WindowCloseEvent) String() string
type WindowResizeEvent ¶
----WINDOW RESIZE EVENT----
func NewWindowResizeEvent ¶
func NewWindowResizeEvent(height, width uint) *WindowResizeEvent
func (WindowResizeEvent) GetEventForDispatch ¶
func (wre WindowResizeEvent) GetEventForDispatch() *Event
func (WindowResizeEvent) String ¶
func (wre WindowResizeEvent) String() string
Click to show internal directories.
Click to hide internal directories.