Advertisement
Vladar

Nimrod on windows error

Nov 28th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. import libtcod
  2.  
  3. proc function(key: ptr TKey, mouse: ptr TMouse) {.closure.} =
  4. echo "test"
  5.  
  6.  
  7. const # no error if var instead of const
  8. samples = @[function]
  9.  
  10.  
  11. var
  12. cur_sample = 0
  13. key: TKey
  14. mouse: TMouse
  15. renderer_name = @["F1 GLSL ","F2 OPENGL ","F3 SDL "]
  16.  
  17.  
  18. console_init_root(80, 50, "libtcod Nimrod sample")
  19.  
  20.  
  21. while not console_is_window_closed():
  22.  
  23. # ==== ERROR-CAUSING BLOCK ==== #
  24. samples[cur_sample](addr(key), addr(mouse)) # no error if using 0 instead of cur_sample
  25. # or remove just one of function's arguments
  26.  
  27. for i in 0..NB_RENDERERS.int-1: # no error if this cycle is removed
  28. console_print_ex(nil, 42, 46-(NB_RENDERERS.int-i), BKGND_SET, LEFT, renderer_name[i])
  29. # ==== END OF ERROR CAUSING BLOCK ==== #
  30.  
  31. console_flush();
  32. discard sys_check_for_event(EVENT_KEY_PRESS or EVENT_MOUSE, addr(key), addr(mouse))
  33.  
  34.  
  35. #
  36. # OUTPUT (ON WINDOWS):
  37. #
  38. # 24 bits font.
  39. # key color : 0 0 0
  40. # character for ascii code 255 is colored
  41. #Using SDL renderer...
  42. # test
  43. # test
  44. # test
  45. # test
  46. # test
  47. # test
  48. # test
  49. # test
  50. # test
  51. # Assertion failed: dat != ((void *)0) && (unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h, file src/console_c.c, line 658
  52. #
  53. # err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x4078e8
  54. #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement