Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import libtcod
- proc function(key: ptr TKey, mouse: ptr TMouse) {.closure.} =
- echo "test"
- const # no error if var instead of const
- samples = @[function]
- var
- cur_sample = 0
- key: TKey
- mouse: TMouse
- renderer_name = @["F1 GLSL ","F2 OPENGL ","F3 SDL "]
- console_init_root(80, 50, "libtcod Nimrod sample")
- while not console_is_window_closed():
- # ==== ERROR-CAUSING BLOCK ==== #
- samples[cur_sample](addr(key), addr(mouse)) # no error if using 0 instead of cur_sample
- # or remove just one of function's arguments
- for i in 0..NB_RENDERERS.int-1: # no error if this cycle is removed
- console_print_ex(nil, 42, 46-(NB_RENDERERS.int-i), BKGND_SET, LEFT, renderer_name[i])
- # ==== END OF ERROR CAUSING BLOCK ==== #
- console_flush();
- discard sys_check_for_event(EVENT_KEY_PRESS or EVENT_MOUSE, addr(key), addr(mouse))
- #
- # OUTPUT (ON WINDOWS):
- #
- # 24 bits font.
- # key color : 0 0 0
- # character for ascii code 255 is colored
- #Using SDL renderer...
- # test
- # test
- # test
- # test
- # test
- # test
- # test
- # test
- # test
- # Assertion failed: dat != ((void *)0) && (unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h, file src/console_c.c, line 658
- #
- # err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x4078e8
- #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement