double t = 0.0; | |
const double dt = 0.01; | |
double currentTime = hires_time_in_seconds(); | |
double accumulator = 0.0; | |
State previous; | |
State current; | |
while ( !quit ) |
Binding to C Libraries with Nim
type | |
Handness = enum | |
hLeft, | |
hRight | |
NearFar = enum | |
nfDefault, | |
nfReverse | |
Vec3 = object |
The below is a breakdown / bird's eye view of how a sparse-array backed ECS like EnTT or Shipyard works.
Please see the thanks and references at the bottom - without their help I would not have been able to share this breakdown with you... everything here is really just notes and rephrasing of what they've written already :)
Also, these notes do not cover archetype systems (like unity) nor adaptations of archetypes (like in Flecs). Though there's a couple comparative footnotes at the end.
Here we go!
import nico | |
import nico/vec | |
import strformat | |
type Object = ref object | |
color: int | |
pos: Vec2f | |
rawPoints: seq[Vec2f] | |
angle: float32 | |
highlightEdgeIndex: int |
import nico | |
import nico/vec | |
type GridLayout* = enum | |
gridSquare | |
gridHexPointyTop | |
type Grid*[T] = ref object | |
layout*: GridLayout | |
wrapX*: bool |
Note: this document is a collection of all proposals from the Nim v2 ideas thread. As such, it is/was not by any means reflective of intentions for 2.0: though I've updated this with accepted and implemented proposals.
Features
- kobi, exelotl, didlybom, solomonthewise, pdkoekfr, snej, apropos: Adopt Options module and make types
not nil
by default (discussion) - Zoom, apropos: Overhaul stdlib to work with view types and/or options/results for error handling
Original Author: Rui Ueyama (creator of the mold linker)
Translated by @windowsboy111
Minimally edited by @lleyton
Goals:
- Avoid Rust's Option/Either manual error handling strategy.
- Make exceptions cheaper.
- Avoid error translation between Nim libraries by construction. The new vocabulary type
ErrorCode
is what should be used. Wrappers should translate errors toErrorCode
. - Make the error
out of memory
easier to handle. - Resolve once and for all the "error codes vs exceptions" choice.