Oak v3.0.0-alpha.1
Pre-releaseThis release marks the first release of oak v3, an early alpha where much but not all of the engine has been overhauled.
The following packages are in a state we are happy with in oak v3, and we do not expect them to change substantially:
render
(and its subpackages)
mouse
collision
shiny
(new, brought in from oakmound/shiny)
alg
event
key
oakerr
physics
scene
shape
timing
The main package, oak
, is in a mostly good place, but some components like the debug console will likely be moved elsewhere before a stable v3 release.
The joystick
package needs to be reevaluated with respect to supporting more controllers before v3 is stable.
The dlog
package will still be significantly adjusted, to emphasize it is not meant to be a one-stop-shop logging solution, but just a 'here's what the engine will log to' destination.
The audio
and entities
packages have not been sufficiently reviewed to where we can say they will not change before v3 is stable.
We currently anticipate an Alpha 2 and Beta 1 release before a final Stable release.
Changelog:
overall
- The Gopkg.lock and Gopkg.toml files, used for dep, have been removed. Dep has been deprecated and archived.
- Throughout the project, tests have been expanded, and use of
github.com/stretchr/testify
has been removed. - Throughout the project, errors returned by packages are more regularly errors from the
oakerr
package.
alg
RemainingWeights
has been renamed toCumulativeWeights
, and the oldCumulativeWeights
function has been removed.
alg/floatgeom
- Added the
Polygon2
type.
alg/range
- New package, a port of github.com/200sc/go-dist, representing ranges of colors, integers, and floats
audio
DefFont
has been renamed toDefaultFont
DefChannel
has been renamed toDefaultChannel
DefActiveChannel
has been renamed toDefaultActiveChannel
DefPlay
has been renamed toDefaultPlay
- Added
FontManager.GetDefault
to get the manager's default channel - Fixed a bug in blank audio loading where the provided "blank" audio was invalid PCM
collision
DefTree
has been renamedDefaultTree
Attach
now takes a*Tree
argument, and no longer binds to priority -1PhaseCollision
now takes a single*Tree
which can benil
instead of a variadic setNewTree
now takes no arguments and cannot error. The oldNewTree
with custom node sizes has been renamed toNewCustomTree
- Fixed a bug where
With
would returnnil
spaces
entities/x/btn
- Added the
Label(collision.Label)
option
event
- Event bindings in the built in bus no longer support priority levels, as they were virtually unused
- Added the
Empty
helper, for when aBindable
does not care about its arguments or return value GlobalBind
andBind
now takestring, Bindable
as their argument order, formerlyBindable, string
- We felt
Bind(EventName, func(){})
read better, especially with larger functions
- We felt
Bindable
s now acceptCID, interface{}
instead ofint, interface{}
- The global caller list is now built into the
CallerMap
type - Many methods that used to be optional in a
Handler
are now required
examples
- Many new examples have been added and most existing examples have been tweaked
key
- Added the
State
type, encompassing key down/up/held states, which used to be global to theoak
package.
mouse
- Added the
Binding
helper, converting a weakly typedinterface{}
payload into amouse.Event
type DefTree
has been renamed toDefaultTree
- Buttons are now strongly typed
oakerr
- Errors now can be formatted to multiple languages
- Several redundant error types have been removed
render
Noisebox
has been removedScrollbox
has been removed- The
Polygon
type now usesfloatgeom.Polygon2
Font
s are now copied several times as they are passed around, to enforce that the same font is not used to draw two pieces of text at once, which can panicDrawOffset
onRenderable
s has been removed andDraw
has taken on its arguments (x and y offsets)Text
s are now drawn from the top left, like all otherRenderable
s.Font
s can now be provided fallback fonts, which they will try to use to render characters that would be rendered as an undefined characterFont.Generate
can now return an errorOverlaySprites
takes a slice of pointers instead of structsShinySet
has been removedShinyOverwrite
has been renamed toOverwriteImage
ShinyDraw
has been renamed toDrawImage
Stackable
s have been changed to an interface that can be externally used, by removing private methodsStackable
s now have aClear
method- FPS types are now
Renderable
s instead ofStackable
s - Deprecated methods have been removed
DefFont
is nowDefaultFont
render/mod
gift.Resampling
is now aliases as the localResampling
type
render/particle
- Added the
Allocator
type to contain particle allocation requests
scene
- Scene start functions now take in
(*scene.Context)
as their only argument, a new struct containing everything a scene should need to render, bind, modify the window, etc
shiny
- New package, brought in from
github.com/oakmound/shiny
- Oak programs shouldn't need to directly interact with
shiny
other than to decide which driver to use, if not using the default
timing
FPSToDuration
has been renamed toFPSToFrameDelay
- Added
FrameDelayToFPS
window
- New package, handling the interface between
scene
andoak.Controller
oak
Setup...
constants have been removed and folded into theConfig
structConfig.EventRefreshRate
can now be properly unmarshaled from JSON- Added
Config.IdleDrawFrameRate
, controlling how often the screen will redraw when it does not have focus - Config creation and loading has been overhauled, using
NewConfig
and functional option loaders,FileConfig
andReaderConfig
- Added the
Controller
type, containing old package globals and enabling running multiple oak windows simultaneously - Most public functions in the package are now methods on
Controller
s, in addition to defaultoak.<Method>
helpers, which will redirect to a default controller - The draw loop has been substantially simplified
- Backgrounds can now be any type that have
GetRGBA() *image.RGBA
, enabling complex or animating backgrounds - Init now takes in a variadic set of
ConfigOption
s, so patterns that used tosetup config, then oak.Init(scene)
now will look likeoak.Init(scene, func() {setup config})
- Shiny gestures are no longer supported at the input loop layer, as they were fundamentally unused. This could be revisited
- We now propagate the
event.FocusLoss
andevent.FocusGain
events on appropriate window changes - Key events now have a
key.Event
payload instead of astring
payload - Mouse events now trigger both an absolute and
Relative
event, the latter taking into account the viewport position - Keybindings have been removed as they did not cooperate well with other key refactoring. This will be revisited
- Language constants have moved to
oakerr
, and are in progress - Added
UpdateViewSize
, to enable resizing the rectangle rendered within the client window - SeedRNG is no longer public, and no longer logs excessively
- Removed
Add
, preferringAddScene
- DefShaker has been renamed to
DefaultShaker
- Added
HideCursor
,ShowNotification
, andSetTrayIcon
window methods