Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Allegro port
#8
here's a working example (you need to have liballeg.a in the fb lib/ dir):

Code:
Declare Function install_allegro CDecl Lib "alleg" (ByVal system_id As Integer, ByRef errno_ptr As Integer, ByVal atexit_ptr As Function()) As Integer
Declare Sub allegro_message CDecl Lib "alleg" (ByVal s As String)
Declare Sub allegro_exit CDecl Lib "alleg" ()

Declare Sub atexit CDecl Lib "crtdll" ()

Const SYSTEM_AUTODETECT = 0

Option Explicit

Dim Shared errno As Integer

Function allegro_init() As Integer
    allegro_init = install_allegro(SYSTEM_AUTODETECT, errno, ProcPtr(atexit))
End Function

'''
Dim ret As Integer
ret = allegro_init()
Print "ret = "; ret
Print "after allegro_init()..."
Call allegro_message("Hello, world!" + chr$(13) + "Press ok to exit")
Print "before allegro_exit()..."
allegro_exit
Print "after allegro_exit()..."


doesn't do much yet... help! v1ctor or somebody - how do I get at C externs? If I was just writing straight gas asm, i could use 'extrn' - is there an fb keyword for that?
Reply


Messages In This Thread
Allegro port - by DrV - 12-01-2004, 05:12 AM
Allegro port - by VonGodric - 12-01-2004, 05:35 AM
Allegro port - by Nexinarus - 12-01-2004, 04:02 PM
Allegro port - by Blitz - 12-01-2004, 04:14 PM
Allegro port - by na_th_an - 12-01-2004, 05:26 PM
Allegro port - by DrV - 12-03-2004, 05:44 AM
Allegro port - by ShadowWolf - 12-03-2004, 05:50 AM
Allegro port - by DrV - 12-03-2004, 07:26 AM
Allegro port - by marzecTM - 12-03-2004, 07:53 AM
Allegro port - by relsoft - 12-03-2004, 08:58 AM
Allegro port - by Jofers - 12-03-2004, 10:22 AM
Allegro port - by relsoft - 12-03-2004, 12:45 PM
Allegro port - by Jofers - 12-03-2004, 02:21 PM
Allegro port - by v3cz0r - 12-03-2004, 04:25 PM
Allegro port - by DrV - 12-04-2004, 02:02 AM
Allegro port - by v3cz0r - 12-04-2004, 02:53 AM
Allegro port - by DrV - 12-04-2004, 02:59 AM
Allegro port - by relsoft - 12-04-2004, 08:17 AM
Allegro port - by na_th_an - 12-04-2004, 08:42 AM
Allegro port - by v3cz0r - 12-04-2004, 08:55 AM
Allegro port - by barok - 12-04-2004, 09:25 AM
Allegro port - by relsoft - 12-04-2004, 09:31 AM
Allegro port - by v3cz0r - 12-04-2004, 09:39 AM
Allegro port - by Jofers - 12-04-2004, 10:18 AM
Allegro port - by DrV - 12-05-2004, 09:11 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)