![]() |
|
allegro interface |
Matěj Týč
Member #9,863
June 2008
![]() |
Hello again, I can do the work, I would just like to know whether it is OK for you or not... I would also like an advice from those who understand X11: The autotools-compiled allegro library works, but the resolution of the fullscreen mode is always set to the desktop resolution and although the screen bitmap has the right size, it is not stretched to the physical screen. Cheers, Matej --------------------------------------------------- |
Thomas Fjellstrom
Member #476
June 2000
![]() |
Quote:
3. I really suggest renaming ASM files with CPP code from foo.s to foo.S or something like that (gcc needs this to autodetect the right file type) The ASM code has been dropped. 4.2 is a dead end. 4.3 is WIP for 4.4 (4.4 will essentially be an updated 4.2), so please work on that and tells us how things go. Quote: 1. The distributed include files somehow contain platform-dependent stuff. I have read somwhere that the library interface should be platform independent and it sounds as a very smart thing... Allegro has to use platform specific code in order to work on the different platforms. In some cases you can also include special headers to gain access to platform specific allegro functions which make it easier to get at platform stuff like win32 window handles and such. The main allegro API is platform independent, if you only use Allegro and language functions (and other platform independent libs). -- |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Quote: 1. The distributed include files somehow contain platform-dependent stuff. I have read somwhere that the library interface should be platform independent and it sounds as a very smart thing... Not quite sure what you mean here. Could you be more specific and provide an example? The library interface is platform independent, and that ability comes from platform dependent headers that get included during the build process. At least that's how I see it. Quote: 3. I really suggest renaming ASM files with CPP code from foo.s to foo.S or something like that (gcc needs this to autodetect the right file type) I didn't know there was any C++ code in Allegro. Which files have it? My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Thomas Fjellstrom
Member #476
June 2000
![]() |
Quote: I didn't know there was any C++ code in Allegro. Which files have it? He probably means C PreProcessor. but you can call gcc with asm files and use -x assembler-with-cpp IIRC. Which allegro probably does... -- |
Peter Wang
Member #23
April 2000
|
Quote: 1. The distributed include files somehow contain platform-dependent stuff. I have read somwhere that the library interface should be platform independent and it sounds as a very smart thing... Not sure what you mean. Can you explain? Quote: 2. The allegro library has different names across platforms (for instance alleg42 on w32 and (lib)alleg on Linux). What about making it the same? Symlinks on Linux may ensure the backward compatibility I don't see what advantage there would be to making the Unix library names conform to DOS 8.3 limitations. Quote: 3. I really suggest renaming ASM files with CPP code from foo.s to foo.S or something like that (gcc needs this to autodetect the right file type) AFAIK, .S is for assembly files, so that wouldn't help at all. Quote: 4. Allegro 4.2 C and ASM versions are not compatible at that moment, what about fixing it? No. It would probably mean breaking ABI compatibility with existing 4.2.x versions, which is not allowed. Besides, as we keep saying, asm is dropped from 4.3 onwards.
|
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Quote: He probably means C PreProcessor. Oh, okay. Nevermind then. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Elias
Member #358
May 2000
|
Quote:
Hello again, I assume you mean that bug that some of the config results leak into allegro.h? I thought that was fixed some time ago, but maybe it wasn't. Quote: 2. The allegro library has different names across platforms (for instance alleg42 on w32 and (lib)alleg on Linux). What about making it the same? Symlinks on Linux may ensure the backward compatibility For A5, the static library names are now like: liballegro-static-4.9.6.a Quote: 3. I really suggest renaming ASM files with CPP code from foo.s to foo.S or something like that (gcc needs this to autodetect the right file type) Makes sense according to man gcc - however, are any such files still used in 4.3.10? If not, we might as well remove them instead of rename. Quote: 4. Allegro 4.2 C and ASM versions are not compatible at that moment, what about fixing it? I can do the work, I would just like to know whether it is OK for you or not... Hard to fix, as I believe some parts of the code (I think "bank switchers", whatever that is) are only written in C or ASM or something like that. And again, we mostly dropped asm support as far as I understand. Quote:
I would also like an advice from those who understand X11: The autotools-compiled allegro library works, but the resolution of the fullscreen mode is always set to the desktop resolution and although the screen bitmap has the right size, it is not stretched to the physical screen. We use the (by now half deprecated - so you may have to install it first on your system) XVidMode extension to set fullscreen modes. If you compile Allegro without that extension, you cannot get fullscreen modes (instead the window is centered and the rest of the desktop is blacked out). -- |
Evert
Member #794
November 2000
![]() |
As keeps being said, stop worrying about 4.2. It's not going to go anywhere at this point. It's done and finished, future development is elsewhere. Quote: 2. The allegro library has different names across platforms (for instance alleg42 on w32 and (lib)alleg on Linux). What about making it the same? What on Earth for? Seriously, why? Quote: 4. Allegro 4.2 C and ASM versions are not compatible at that moment, what about fixing it?
Great idea, now why did we never think of that? |
Matěj Týč
Member #9,863
June 2008
![]() |
Thank you all for your replies, Thomas Fjellstrom said: In some cases you can also include special headers to gain access to platform specific allegro functions which make it easier... OK, that sounds reasonable. Both Unix and Windows packages distribute all headers though, so I will investigate which ones are disposable. Peter Wang said: I don't see what advantage there would be to making the Unix library names conform to DOS 8.3 limitations.
I don't know what are those DOS limitations, but the reasons for that are following ones: One question I forgot to ask: Linux version produces also some alleg_unsharable library, what's that? Elias said: For A5, the static library names are now like: liballegro-static-4.9.6.a
And why to give different names to static and shared libraries? Why not just liballegro49.a? Peter Wang said: AFAIK, .S is for assembly files, so that wouldn't help at all.
It really works. However, are you really so sure that there won't be any further 4.2 release? With some bugs fixed and proper autotools support:D? Elias said: Hard to fix, as I believe some parts of the code (I think "bank switchers", whatever that is) are only written in C or ASM or something like that I am surprised that the fact that functions are implemented in a different way implies that the libraries are not compatible. Interesting, but I don't doubt that. Elias said: We use the ... XVidMode extension ... Thanks, it helped me to correct a bug in the build setup and now it seems to work;), thank you. --------------------------------------------------- |
Evert
Member #794
November 2000
![]() |
Quote: 1. Why not? The 4.2.x library can be named alleg42 on Windows and liballeg42.so.something on unix. Every time you would pass -lalleg42 to link with it... Except that you should not be linking with -lalleg on UNIX systems to begin with. Also, it's supposed to be liballeg.a on both platforms (alleg.lib for MSVC), just the DLL is called alleg42.dll on Windows. Quote: And why to give different names to static and shared libraries? Because you may want to have both installed. Quote: Linux version produces also some alleg_unsharable library, what's that? Code that should not go into the shared object for one reason or another, I forgot the details. I think the magic main goes in there if you use/need one, for instance. Quote: I am surprised that the fact that functions are implemented in a different way implies that the libraries are not compatible. Something to do with the calling conventions being different between the two. This is a remnant from long ago. Quote: However, are you really so sure that there won't be any further 4.2 release? With some bugs fixed and proper autotools support:D? Bug fixes at most, but not more. Shouldn't anyway. |
Matěj Týč
Member #9,863
June 2008
![]() |
Thank you for your replies, Quote: Except that you should not be linking with -lalleg on UNIX systems to begin with
Do you mean that I should use allegro-config and AM_PATH_ALLEGRO? I really don't like those tools and I think that thanks to the fact that Allegro is monolithic library, those tools are an overkill. I wanted to add pkg-config support, but that tool does not support cross compilation out of the box right now and also doesn't integrate well with autotools and it is not going to change in the near future Quote:
And why to give different names to static and shared libraries? This should be OK since they have different suffixes. Let the compiler choose(you can pass the -static flag)... Is something wrong with that? Quote:
Linux version produces also some alleg_unsharable library, what's that?
I am really surprised about that, I have never heard of such thing --------------------------------------------------- |
Martin Kalbfuß
Member #9,131
October 2007
![]() |
The simplest way, would be a multi-platform allegro-config. (pkg-config). Than the lib names aren't longer of interrest for the end user. allegro-config --static -L/usr/local/lib -Wl,--export-dynamic -lalleg -lm -lXxf86vm -lXcursor -lXpm -lXext -lX11 -lpthread -ldl
Simple passing -lalleg isn't enough. There is a m4 package for allegro. You don't need the allegro-config tool when using autotools. http://remote-lisp.spdns.de -- my server side lisp interpreter |
Evert
Member #794
November 2000
![]() |
Quote: Do you mean that I should use allegro-config and AM_PATH_ALLEGRO? Yes. Quote: I really don't like those tools and I think that thanks to the fact that Allegro is monolithic library, those tools are an overkill.
As pointed out, no, they're not. Do you prefer to enter the output of allegro-config --libs manually? Also, you may not like allegro-config for some reason, but lots of other people do. Quote: This should be OK since they have different suffixes. Hmm... yes, you're right, they do. Maybe it is indeed overkill. Quote:
I am really surprised about that, I have never heard of such thing
Usually not I think, but I really haven't looked at this recently. Most libraries you're likely to use probably do not try to hijack your main() function either. |
Martin Kalbfuß
Member #9,131
October 2007
![]() |
The difference between the names of the static and dynamic library is the version number. This is necessary for having different versions of allegro installed. But there should be a link called liballeg.so To ease the building process. http://remote-lisp.spdns.de -- my server side lisp interpreter |
Peter Wang
Member #23
April 2000
|
Quote: Let the compiler choose(you can pass the -static flag)... Is something wrong with that? Yes. That makes your binary completely statically linked, instead of just Allegro. Quote: I think there was some other code that had to go in there, but I don't remember the details. Pretty sure it was because some (all?) hand written asm functions were not relocatable. This wouldn't be a problem in 4.3+.
|
Martin Kalbfuß
Member #9,131
October 2007
![]() |
You can use -Wl,-static option to link only allegro as a static lib. http://remote-lisp.spdns.de -- my server side lisp interpreter |
Matěj Týč
Member #9,863
June 2008
![]() |
Quote:
Do you mean that I should use allegro-config and AM_PATH_ALLEGRO?
The AM_PATH_ALLEGRO macro is not trivial as well as the allegro-config script and they are probably a pain to maintain. Quote: Pretty sure it was because some (all?) hand written asm functions were not relocatable. This wouldn't be a problem in 4.3+. What is the consequence of this? I have compiled Allegro 4.2 with ASM to one shared library and stuff seem to work fine. Are there any risks assotiated? --------------------------------------------------- |
Thomas Fjellstrom
Member #476
June 2000
![]() |
Quote: What is the consequence of this? I have compiled Allegro 4.2 with ASM to one shared library and stuff seem to work fine. Are there any risks assotiated? The code wont link or run properly on all platforms. dynamic linking usually ends up relocating the code. Non relocatable code uses absolute jump points and such. Some linkers can manage to work with it, but many can't. -- |
Matt Smith
Member #783
November 2000
|
It was the calling conventions (as pointed out, in the bank switching funcs) in the asm that were different from the C version. The asm version was in the official 4.2 ABI, so if you made a C only version it made an incompatible DLL. In 4.3, the ABI uses the C calling convention. The asm has been stripped out for simplicity, but if it goes back in it will have to be wrapped in cdecl stack parameter passing. There is not currently any appetite for this, as the asm would only compile where gcc is available (not from within a VC project. All our attempts to invoke gas as an external tool failed with every version of VC) and would need to be maintained. I do somewhat regret losing all the asm code. compilers are getting better but it's a fact that many people find the asm faster, especially on older machines where it matters most. I do agree however, with stripping it all out first, as all the build tools treat x86 as the default choice, due to Allegro's DOS only origins. When/if asm is grafted back in, it should be triggered by non-default macros. I'm talking specifically about replacing ALLEGRO_USE_C and ALLEGRO_NO_ASM with an ALLEGRO_USE_686_ASM etc. when required. |
Matěj Týč
Member #9,863
June 2008
![]() |
Quote: I do somewhat regret losing all the asm code. Something can probably go back, but it should be more robust, standards-complying etc. I think that some external tool like this would be ideal for that. --------------------------------------------------- |
SiegeLord
Member #7,827
October 2006
![]() |
Quote: Something can probably go back, but it should be more robust, standards-complying etc. I think that some external tool like this would be ideal for that.
Too bad it's license is incompatible with that of allegro "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Matěj Týč
Member #9,863
June 2008
![]() |
Quote: Too bad it's license is incompatible with that of allegro It's two clause BSD license (http://l4ka.org/bsdlicense.php). How come that Allegro is not compatible with it? Do we have a different disclamer or what? --------------------------------------------------- |
Peter Wang
Member #23
April 2000
|
Traditionally we only accepted code which could be licensed under 'giftware' in Allegro, although we have relaxed that for the addons in 4.3.
|
Evert
Member #794
November 2000
![]() |
Quote: How come that Allegro is not compatible with it?
The other way around. Anyway, as Peter said, what goes for Allegro does not necessarily go for (bundled) addons. |
Matěj Týč
Member #9,863
June 2008
![]() |
So I see that the disclamer is +- the same --------------------------------------------------- |
|
|