Re: EuAllegro Help
- Posted by ghaberek (admin) Aug 13, 2019
- 1388 views
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