Skip to content

Instantly share code, notes, and snippets.

View gokr's full-sized avatar

Göran Krampe gokr

View GitHub Profile
Linking orxLIB
/home/gokr/orx/EmuELEC/build.EmuELEC-Amlogic.arm-3.6/toolchain/lib/gcc/armv8a-libreelec-linux-gnueabi/8.3.0/../../../../armv8a-libreelec-linux-gnueabi/bin/ld.gold: warning: skipping incompatible ../../../../extern/libwebp/lib/linux64/libwebpdecoder.a while searching for webpdecoder
/home/gokr/orx/EmuELEC/build.EmuELEC-Amlogic.arm-3.6/toolchain/lib/gcc/armv8a-libreelec-linux-gnueabi/8.3.0/../../../../armv8a-libreelec-linux-gnueabi/bin/ld.gold: error: cannot find -lsndfile
/home/gokr/orx/EmuELEC/build.EmuELEC-Amlogic.arm-3.6/toolchain/lib/gcc/armv8a-libreelec-linux-gnueabi/8.3.0/../../../../armv8a-libreelec-linux-gnueabi/bin/ld.gold: error: cannot find -lGL
/home/gokr/orx/EmuELEC/build.EmuELEC-Amlogic.arm-3.6/toolchain/lib/gcc/armv8a-libreelec-linux-gnueabi/8.3.0/../../../../armv8a-libreelec-linux-gnueabi/bin/ld.gold: error: cannot find -lstdc++
/home/gokr/orx/EmuELEC/build.EmuELEC-Amlogic.arm-3.6/toolchain/lib/gcc/armv8a-libreelec-linux-gnueabi/8.3.0/../../../../armv8a-libreelec-linux-gnueabi/bi
@gokr
gokr / howto.md
Created July 12, 2020 23:58
Howto build ORX for EmuELEC/ARM on Ubuntu in LXC
orxStructure.c
In file included from ../../../src/plugin/orxPlugin_EmbeddedList.cpp:68:
../../../include/../plugins/Display/GLFW/orxDisplay.c: In function 'orxSTATUS orxDisplay_GLFW_CompileShader(orxDISPLAY_SHADER*)':
../../../include/../plugins/Display/GLFW/orxDisplay.c:2153:71: error: 'uiProgram' was not declared in this scope
_pstShader->iProjectionMatrixLocation = glGetUniformLocationARB(uiProgram, "_mProjection_");
^~~~~~~~~
../../../include/../plugins/Display/GLFW/orxDisplay.c:2153:71: note: suggested alternative: 'hProgram'
_pstShader->iProjectionMatrixLocation = glGetUniformLocationARB(uiProgram, "_mProjection_");
^~~~~~~~~
hProgram
@gokr
gokr / gist:08418f1e4ab98198d793074a68c0fed6
Created July 12, 2020 18:19
Compilation error orxDisplay.c
==== Building orxLIB (release64) ====
orxPlugin_EmbeddedList.cpp
orxHashTable.c
orxTree.c
orxLinkList.c
orxString.c
orxPhysics.c
orxBody.c
orxScreenshot.c
orxDisplay.c
gokr@maz:~/orx/EmuELEC/build.EmuELEC-Amlogic-ng.arm-3.6/gcc-arm-aarch64-linux-gnu-8.3-2019.03/bin$ ./aarch64-linux-gnu-gcc -dM -E - < /dev/null
#define __DBL_MIN_EXP__ (-1021)
#define __FLT32X_MAX_EXP__ 1024
#define __UINT_LEAST16_MAX__ 0xffff
#define __ARM_SIZEOF_WCHAR_T 4
#define __ATOMIC_ACQUIRE 2
#define __FLT128_MAX_10_EXP__ 4932
#define __FLT_MIN__ 1.17549435082228750796873653722224568e-38F
#define __GCC_IEC_559_COMPLEX 2
#define __UINT_LEAST8_TYPE__ unsigned char
@gokr
gokr / code.nim
Last active July 2, 2020 13:42
Nim variant for ORX sample code
# A Nim port of https://wiki.orx-project.org/en/tutorials/cameras/fixing_camera_to_object_by_parenting
# Nim has templates (macros) defined for the canonical ORX init, run, exit, execute.
init:
# For Create, CreateFromConfig and a very select few other functions,
# Norx keeps the prefix, but shortened to for example "viewport".
# For other ORX functions the module prefix is stripped and the first letter
# in the function name is lower cased. So `orxViewport_GetCamera` turns into
# `getCamera`.
#
gokr@maz:~/orx/norx/src$ nim c -r -o:norxd norx
Set bootstrap: orxSTATUS_SUCCESS
@["/home/gokr/orx/norx/src/norxd"]
[17:23:37] [LOG] OK
[17:23:37] [LOG] DONE FFS
Main setup
Added storage: orxSTATUS_SUCCESS
[17:23:37] [CONFIG] [orxConfig.c:orxConfig_ProcessBuffer(2781)] [norxd.ini]: Begin include @norx.ini@
[17:23:37] [CONFIG] [orxConfig.c:orxConfig_ProcessBuffer(2787)] [norxd.ini]: End include @norx.ini@
[17:23:37] [CONFIG] [orxConfig.c:orxConfig_ProcessBuffer(2676)] [norxd.ini]: <Display.Title> = norx -> norx (Debug)
@gokr
gokr / sweep.md
Created May 29, 2020 22:07
A sweep over the old Spry articles

Spry moves again

After a period of slower progress I got reignited regarding Spry. So far I have written a lot of articles about Spry, and during this time things have evolved and changed.

So I am now trying to write down a summary on where Spry stands today, the changes I would like to make, and what I am doing next.

Let's go through the articles from the beginning, things wrong in article one:

  • funci is now called method
  • if as been changed to the more Smalltalkish then:else:
@gokr
gokr / gist:42547120d4fe8dd52bfdb88c6648b0dd
Created May 29, 2020 21:57
Error handling ramblings for Spry

Error handling

  • Activation record handlers. Each record can have a handler. If not set it is equivalent of [throw :x] just passing it up to the next activation record. Top activation record catches all and is set to [echo (:x printString) exit 1]
  • Throwing does not unwind call stack, so a handler doing return will return back to the throw! Unless it calls activation unwind first, if so, the return will instead go to caller of the record where the handler is installed.
  • Errors as values...

Exceptions, errors etc are simply "not so often expected paths of execution". Clarity of code can often be enhanced if the "vanilla path" is clean of clutter for all these "less expected" paths.

In other words, we want most Spry code to be "uncluttered". We also don't want too many concepts since Spry is meant to be minimalistic in nature.