Historical forum-msg-id-134142-edit, Revision 1

Original date:2019-08-13 21:58:52 Edited by: Icy_Viking Subject: Re: EuAllegro Help

ghaberek said...

There are functions in std/math.e that will make those bit shifts easier. See or_all() and shift_bits().

public constant ALLEGRO_VERSION_INT = or_all({ 
    shift_bits( ALLEGRO_VERSION,     -24 ), 
    shift_bits( ALLEGRO_SUB_VERSION, -16 ), 
    shift_bits( ALLEGRO_WIP_VERSION,  -8 ), 
    ALLEGRO_UNSTABLE_BIT 
}) 

I don't think you should be setting ALLEGRO_UNSTABLE_BIT. AFAIK you should leave it at zero if you are using the release binaries. You should probably write your al_install_system() wrapper such that it first checks its ALLEGRO_VERSION_INT against the value returned by al_get_allegro_version(), and only proceed with calling al_install_system() if it matches.

If you're getting -1 for al_install_system() then check your output from open_dll() to make sure the library is loaded, and then check your define_c_func/proc() calls to make sure you're getting back proper function IDs (positive integers, not -1). You can load the library into Dependency Walker to make sure you're seeing the function names exported from the library. (I also recently discovered Dependencies which is a newer re-implementation of Dependency Walker for Windows 7 and up, but I haven't tried it yet. Might be worth a look.)

-Greg

Thanks for the tips. I've reformated to the new way. I've left out the UNSTABLE_BIT flag as it seems it was uneeded. However, I am now getting type_check failure ver is {83886080,131072,1280}, this is coming from the sample program al_init_system() function.

--misc flags 
public constant ALLEGRO_NEW_WINDOW_TITLE_MAX_SIZE = 255 
public constant ALLEGRO_PI = 3.14159265358979323846 
public constant ALLEGRO_VERSION_INT = ({shift_bits(ALLEGRO_VERSION,-24), 
									   shift_bits(ALLEGRO_SUB_VERSION,-16), 
									   shift_bits(ALLEGRO_WIP_VERSION,-8) 
									   }) 
Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu