better opengl wrapper; oids and endians modules documented

This commit is contained in:
Araq
2012-04-04 21:26:23 +02:00
parent a4a99ae997
commit 07b355bea4
7 changed files with 2572 additions and 2529 deletions

View File

@@ -7,7 +7,8 @@
# distribution, for details about the copyright.
#
## This module contains helpers that deal with `endian`:idx: changes.
## This module contains helpers that deal with different byte orders
## (`endian`:idx:).
proc swapEndian64*(outp, inp: pointer) =
## copies `inp` to `outp` swapping bytes. Both buffers are supposed to

View File

@@ -7,10 +7,12 @@
# distribution, for details about the copyright.
#
## Nimrod OID support. An OID consists of a timestamp, a unique counter
## and a random value. This combination should suffice to produce a globally
## distributed unique ID. This implementation was extracted from the
## Mongodb interface. This calls ``math.randomize()`` for the first call of
## Nimrod OID support. An OID is a global ID that consists of a timestamp,
## a unique counter and a random value. This combination should suffice to
## produce a globally distributed unique ID. This implementation was extracted
## from the Mongodb interface and it thus binary compatible with a Mongo OID.
##
## This implementation calls ``math.randomize()`` for the first call of
## ``genOid``.
import times, endians
@@ -79,3 +81,6 @@ proc generatedTime*(oid: TOid): TTime =
bigEndian32(addr(tmp), addr(dummy))
result = TTime(tmp)
when isMainModule:
let xo = genOID()
echo xo.generatedTime

File diff suppressed because it is too large Load Diff