Skip to content

Commit

Permalink
README tweaks, sample1 tweaked
Browse files Browse the repository at this point in the history
  • Loading branch information
gokr committed Jun 29, 2020
1 parent 4137f66 commit 4499aec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Norx
Norx is a Nim wrapper of the [ORX game engine](http://orx-project.org/) library. ORX is written in C99 and highly performant and cross platform.
The wrapper basically consists of one Nim module per ORX C header, almost 80 of them.
Norx is a Nim wrapper of the [ORX 2.5D game engine](http://orx-project.org/) library. ORX is written in C99, highly performant and cross platform.
The wrapper consists of two parts:

The only things you need to compile a Nim ORX game is this Nimble module and the ORX dynamic library files (`liborx[p|d].so|dll`) in a proper library path.
* The low level wrapper with basically one Nim module per ORX C header, almost 80 of them. All these are named o-xxx, like `oinput` or `oobject`.
* The high level wrapper with one Nim module per low level wrapper. Currently each high level wrapper also exports the low level wrapper.

However, for debugging etc it's more practical to also have the full ORX clone with ORX C sources etc.
The low level wrapper uses "C types" and is automatically generated as much as possible from the C header files.
The high level tries to use Nim style and Nim types as much as possible.

The only things you need to compile a Nim ORX game is this Nimble module and the ORX dynamic library files (`liborx[p|d].so|dll`) in a proper library path. However, for debugging etc it's more practical to also have the full ORX clone with ORX C sources etc.

# Build and install ORX
First install ORX dlls. At the moment best is to build them from a master git clone of ORX since it is in sync with the wrapper.
Expand Down
6 changes: 3 additions & 3 deletions samples/sample1/sample1.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import norx, norx/[incl, clock, event, system, config, resource, input, viewport
proc Update(pstClockInfo: ptr orxCLOCK_INFO, pContext: pointer) =
## Update function, it has been registered to be called every tick of the core clock
# Should we quit due to user pressing ESC?
if (orxInput_IsActive("Quit").bool):
if (isActive("Quit")):
# Send close event
echo "User quitting"
discard orxEvent_SendShort(orxEVENT_TYPE_SYSTEM, orxSYSTEM_EVENT_CLOSE.orxU32)
Expand All @@ -18,12 +18,12 @@ proc Init(): orxSTATUS =
orxLOG("Sample1 starting")

# Create the viewport
var v = orxViewport_CreateFromConfig("MainViewport")
var v = createFromConfig[orxVIEWPORT]("MainViewport")
if not v.isNil:
echo "Viewport created"

# Create the scene
var s = orxObject_CreateFromConfig("Scene")
var s = createFromConfig[orxOBJECT]("Scene")
if not s.isNil:
echo "Scene created"

Expand Down

0 comments on commit 4499aec

Please sign in to comment.