Ok, great. I'll check SDL.bi. Do I need to include that manually to use SDL through libtcod? I did put the SDL.dll in my .exe's directory and haven't been getting any SDL problems, but I also can't seem to keep my program open. : )
Here's my simple test, with your .bi renamed to libtcod.bi and placed inside my libtcod-1.5.1 subdirectory:
Code: Select all
#LibPath "."
#Include "libtcod-1.5.1/libtcod.bi"
Type bool As UByte
Const SCREEN_WIDTH = 80, SCREEN_HEIGHT = 50, LIMIT_FPS = 20
TCOD_console_init_root(SCREEN_WIDTH, SCREEN_HEIGHT, "Rogue", 0, TCOD_RENDERER_SDL)
Do
Dim key As TCOD_key_t
' TCOD_console_set_foreground_color(0, TCOD_white)
TCOD_console_print(0, 1, 1, TCOD_BKGND_NONE, "@")
TCOD_console_flush()
key = TCOD_console_wait_for_keypress(0)
' If key.vk = TCODK_ESCAPE Then Exit Do
' If TCOD_console_is_window_closed() = 1 Then Exit Do
Loop
Attempting to use TCOD_console_set_foreground_color results in:
Build error(s)
C:\freebasic\fbc -s console "libtcod.bas"
Info: resolving _TCOD_white by linking to __imp__TCOD_white (auto-import)
libtcod.o:fake:(.text+0x56): undefined reference to `TCOD_console_set_foreground_color'
Even though I see that sub declared in the .bi and TCOD_white declared via an EXTERN statement (though I'm not sure what that is). I commented out my keypress evaluation functions to see if those were the reason my program was closing as soon as it opened, but that didn't work.
In case anyone is helped, here's the documentation for 1.5.1:
http://doryen.eptalys.net/data/libtcod/ ... &lua=false
Also, I switched to using this tutorial:
http://roguebasin.roguelikedevelopment. ... od,_part_1