Qbasicnews.com
October 22, 2019, 02:41:16 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Allegro port  (Read 14069 times)
DrV
Na_th_an
*****
Posts: 1553



WWW
« on: November 30, 2004, 09:12:10 PM »

Is anyone up for a freeBASIC port of Allegro?  I'm willing to help with this, and na_th_an's put forth the idea a couple of times; I'm willing to wait for the initial release of the compiler before starting, though... unless v1c sends me a pre-release ver, which would be okay too... I'm kinda low on free time this week anyway.  I think this would be a worthy cause for anyone with Allegro or C experience to contribute to this awesome project.  I'm up for it. Smiley
Logged
VonGodric
Ancient Guru
****
Posts: 674



WWW
« Reply #1 on: November 30, 2004, 09:35:04 PM »

I'm willing, though I dunno how much time I have.
Logged

url]http://fbide.sourceforge.net/[/url]
Nexinarus
Wandering Guru
***
Posts: 301



WWW
« Reply #2 on: December 01, 2004, 08:02:58 AM »

I think that all you have to do is port the headers (all .h to .bi), and compile the lib in MinGW.
Logged
Blitz
I hold this place together
*****
Posts: 853



WWW
« Reply #3 on: December 01, 2004, 08:14:26 AM »

Allegros headers are 20% macros. Trying to port it would be painfull since FB doesn't have macros, yet atleast. Besides that lib sucks imo.
Logged

oship me and i will give you lots of guurrls and beeea
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #4 on: December 01, 2004, 09:26:10 AM »

I will try to do my best as soon as FB is released. I'll try to convert the macros to functions. I'll count you both in the project, Vongodric and DRV Smiley
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
DrV
Na_th_an
*****
Posts: 1553



WWW
« Reply #5 on: December 02, 2004, 09:44:32 PM »

I'm gearing up to get down... I'll try to do the core gfx stuff and then put it up somewhere so other people can work on the other stuff.  Thanks for the support so fast. Smiley
Logged
ShadowWolf
Wandering Guru
***
Posts: 389



« Reply #6 on: December 02, 2004, 09:50:13 PM »

somone here should contacted Angelo Mottola he did some work on the Mac Os port of allegro he be the closest to a expert that the QB community has for allegro.

http://www.ecplusplus.com/
Logged
DrV
Na_th_an
*****
Posts: 1553



WWW
« Reply #7 on: December 02, 2004, 11:26:47 PM »

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?
Logged
marzecTM
Ancient Guru
****
Posts: 688


« Reply #8 on: December 02, 2004, 11:53:54 PM »

ehm if you mean like

extern void bleh

nevermind that extern. it'S just some stuff for the c-compiler to not redeclare the function somewhere else, would bitch on you otherwise. ignore extern

edit: i just was reminded by someone of common shared. hm... i'm a little confused now, but when i was porting that sdl headers i didn't have to add something to the declaration, so i guess ignoring extern when porting headers is fine.
Logged

quote="NecrosIhsan"]

[/quote]
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #9 on: December 03, 2004, 12:58:41 AM »

Quote from: "ShadowWolf"
somone here should contacted Angelo Mottola he did some work on the Mac Os port of allegro he be the closest to a expert that the QB community has for allegro.

http://www.ecplusplus.com/


Angelo sez: "no"

But he(Angelo) will work on the MAC OS port of FB. :*)
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #10 on: December 03, 2004, 02:22:13 AM »

Cool.  It's nice to Angelo returning... to... another scene. Wink
Logged
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #11 on: December 03, 2004, 04:45:42 AM »

Yeah, I wouldn't be surprised if Bobby would too. :*)
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #12 on: December 03, 2004, 06:21:49 AM »

Heh... for some reason Bobby Krusty (that font guy from years ago) came to mind, just seconds before the Cosmox Bobby. :Huh:  But now Jorden needs to launch a freebasic site and it'll be a trifecta Cheesy
Logged
v3cz0r
I hold this place together
*****
Posts: 924



WWW
« Reply #13 on: December 03, 2004, 08:25:20 AM »

Any external procs need to be declared with an ALIAS "realnamehere", coz all symbols are case-insensitive in FB.

The alias name doesn't have to include the initial _ or @, they will be added (unless the C proc already has an initial underscore on its name, course).

There's no extern, GAS will turn any non-declared symbol as extern automagically.


As Rel said, Angelo told us that it will a bitch to port, mainly 'cause the Allegro's main function - i know nothing about Allegro for Windows, i can't help on that.
Logged

DrV
Na_th_an
*****
Posts: 1553



WWW
« Reply #14 on: December 03, 2004, 06:02:43 PM »

No, no... I mean 'extern' vars... as in 'extern BITMAP *screen;' -- which is utterly necessary... do I have to write a crappy go-between lib in C to get and set vars?  :-?

EDIT: There is a gas thing for externs - the '.extern' directive (not extrn as I said before.... that's MASM/TASM.)
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!