Qbasicnews.com
July 21, 2018, 06:45:06 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 12379 times)
v3cz0r
I hold this place together
*****
Posts: 924



WWW
« Reply #15 on: December 03, 2004, 06:53:46 PM »

Yeah i know, but: ".extern is accepted in the source program--for compatibility with other assemblers--but it is ignored. as treats all undefined symbols as external", that's from gas' manual.

Like in QB, there's no way to shared vars between modules, then using COMMON, but in C you would have to declare them the same way as in FB, that would be all names in uppercase - and if you declare them in QB using suffixes (%&), it's even more difficult to know the right name.

Why do you need to share that kind of var between C and basic? I don't think it would be too safe, anyone could do screen = garbage at fb and loads of craps would happen - why not doing the SDL way? The user has the control over the bitmaps/surfaces, i thought Allegro was that way too..
Logged

DrV
Na_th_an
*****
Posts: 1553



WWW
« Reply #16 on: December 03, 2004, 06:59:59 PM »

Allegro uses an external variable called 'screen' to represent the hardware screen bitmap, and one called 'key' to represent the keyboard keys, etc... I'm not sure how it all works under the hood, but it works in C...   Smiley
Logged
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #17 on: December 04, 2004, 12:17:15 AM »

Quote from: "Jofers"
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


trifecta.  The memories.... :*)

I thought it was you, wurka and chaoticmass?
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #18 on: December 04, 2004, 12:42:35 AM »

screen is just a BITMAP structure that represents the screen. That way, you do a :

Code:
blit (myBuffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);


to blit your buffer to the screen making it visible. That's why it is shared.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
v3cz0r
I hold this place together
*****
Posts: 924



WWW
« Reply #19 on: December 04, 2004, 12:55:38 AM »

And "screen" is a qb/fb keyword.. Allegro could have added at least dunno al_ to public procs and global variables, there are probably what, 50 different global vars with ordinary names.. backward compatibility, i guess..
Logged

barok
Na_th_an
*****
Posts: 1727


How about a tasty lead sandwich?


« Reply #20 on: December 04, 2004, 01:25:30 AM »

is there a different syntax for screen?  Any program that i try to compile in fb i have to end up taking out any screen statements.
Logged

Jumping Jahoolipers!
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #21 on: December 04, 2004, 01:31:03 AM »

Something in the mode of:

Screen width, height, bpp, screenmode

I guess that would work.
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
v3cz0r
I hold this place together
*****
Posts: 924



WWW
« Reply #22 on: December 04, 2004, 01:39:27 AM »

Not yet, but when Sterling finishes his qb-like gfx lib.
Logged

Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #23 on: December 04, 2004, 02:18:53 AM »

Yeah, something like that, rel.  But I was actually using the word "trifecta", meaning "triple winner" alluding to horse racing.
Logged
DrV
Na_th_an
*****
Posts: 1553



WWW
« Reply #24 on: December 05, 2004, 01:11:24 PM »

Okay, decided to use a little C lib for getting/setting externs since I needed it anyway for functions to convert string return values to FB strings...  here's a quick demo:
Download fballeg-prerelease-preview.zip
* smiles at qh2 people *
EDIT: crap... forgot to upload bitmap in the zip - fixed now
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!