engine

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ImguiRelativeMouseModePosX float32
	ImguiRelativeMouseModePosY float32
)

Functions

func Init

func Init() error

func Quit added in v0.12.10

func Quit()

func Run added in v0.0.6

func Run(g Game, w *Window, rend renderer.Render, ui nmageimgui.ImguiInfo)

func SetMSAA added in v0.19.4

func SetMSAA(isEnabled bool)

func SetSrgbFramebuffer added in v0.19.3

func SetSrgbFramebuffer(isEnabled bool)

func SetVSync

func SetVSync(enabled bool)

Types

type Game added in v0.0.6

type Game interface {
	Init()

	Update()
	Render()
	FrameEnd()

	DeInit()
}

type Window

type Window struct {
	SDLWin         *sdl.Window
	GlCtx          sdl.GLContext
	EventCallbacks []func(sdl.Event)
}

func CreateOpenGLWindow

func CreateOpenGLWindow(title string, x, y, width, height int32, flags WindowFlags) (Window, error)

func CreateOpenGLWindowCentered

func CreateOpenGLWindowCentered(title string, width, height int32, flags WindowFlags) (Window, error)

func (*Window) Destroy

func (w *Window) Destroy() error

type WindowFlags

type WindowFlags int
const (
	WindowFlags_FULLSCREEN         WindowFlags = sdl.WINDOW_FULLSCREEN
	WindowFlags_OPENGL             WindowFlags = sdl.WINDOW_OPENGL
	WindowFlags_SHOWN              WindowFlags = sdl.WINDOW_SHOWN
	WindowFlags_HIDDEN             WindowFlags = sdl.WINDOW_HIDDEN
	WindowFlags_BORDERLESS         WindowFlags = sdl.WINDOW_BORDERLESS
	WindowFlags_RESIZABLE          WindowFlags = sdl.WINDOW_RESIZABLE
	WindowFlags_MINIMIZED          WindowFlags = sdl.WINDOW_MINIMIZED
	WindowFlags_MAXIMIZED          WindowFlags = sdl.WINDOW_MAXIMIZED
	WindowFlags_INPUT_GRABBED      WindowFlags = sdl.WINDOW_INPUT_GRABBED
	WindowFlags_INPUT_FOCUS        WindowFlags = sdl.WINDOW_INPUT_FOCUS
	WindowFlags_MOUSE_FOCUS        WindowFlags = sdl.WINDOW_MOUSE_FOCUS
	WindowFlags_FULLSCREEN_DESKTOP WindowFlags = sdl.WINDOW_FULLSCREEN_DESKTOP
	WindowFlags_FOREIGN            WindowFlags = sdl.WINDOW_FOREIGN
	WindowFlags_ALLOW_HIGHDPI      WindowFlags = sdl.WINDOW_ALLOW_HIGHDPI
	WindowFlags_MOUSE_CAPTURE      WindowFlags = sdl.WINDOW_MOUSE_CAPTURE
	WindowFlags_ALWAYS_ON_TOP      WindowFlags = sdl.WINDOW_ALWAYS_ON_TOP
	WindowFlags_SKIP_TASKBAR       WindowFlags = sdl.WINDOW_SKIP_TASKBAR
	WindowFlags_UTILITY            WindowFlags = sdl.WINDOW_UTILITY
	WindowFlags_TOOLTIP            WindowFlags = sdl.WINDOW_TOOLTIP
	WindowFlags_POPUP_MENU         WindowFlags = sdl.WINDOW_POPUP_MENU
)

Jump to

Keyboard shortcuts

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