|
al_font_load_bitmap_font() fails |
Matthew Leverton
Supreme Loser
January 1999
|
I got Speed ported to Allegro 5 (Windows Binary). But when playing it on another computer, it doesn't work. It exits immediately due to the font not being loaded. I stripped my main routine down and the following code fails:
It works on my computer I'm developing on but fails on my laptop and Virtual PC. I'm static linking everything, including the VC runtime. Dependency viewer shows no unresolved dependencies. I tried absolute paths and relative paths and it fails just the same. Is there a bug here, or am I missing something stupid? |
Trent Gamblin
Member #261
April 2000
|
I had the same problem on my laptop with this game. Did you try running it when compiled with debug libs? For me that pointed out that it was asserting before loading the font and the reason was that I didn't have proper OpenGL drivers installed. I had 1.1 and A5 requires 1.2. That was displayed in the allegro.log as Driver: Microsoft.
|
Matthew Leverton
Supreme Loser
January 1999
|
Okay... that's odd. Why does it let me create a display but then fail to load a font? It seems like it should not create a window if that's the case. But you are right. When I use the D3D driver, it works. |
Milan Mimica
Member #3,877
September 2003
|
I figured that Allegro is fine here. It lets you create the OpenGL display so that you can use OpenGL 1.1 yourself if you really want to (you should always check OpenGL version anyway). However, al_create_bitmap() will fail for non-memory bitmaps because it requires OpenGL 1.2 (maybe even higher).
-- |
Matthew Leverton
Supreme Loser
January 1999
|
My Dell laptop has Mobile IntelĀ® 945GM graphics, which supports 100% of OpenGL 1.4, and some other miscellaneous features. So yes, it should be noted that using the OpenGL driver on Windows is pretty much worthless. |
Milan Mimica
Member #3,877
September 2003
|
No, OpenGL 1.4 should really be enough. Can you post the allegro.log?
-- |
Matthew Leverton
Supreme Loser
January 1999
|
Here's part of it: Quote: ... wgl-win INFO: OpenGL Version: 1.1.0 ... ogl_bitmap: glTexImage2D for format 18, size 1024x256 failed I assume that's the relevant portion. Why the "GDI Generic" ... Shouldn't that say Intel 945GM, as the OpenGL Extension Viewer program reports? Edit: Quote:
wgl-win INFO: Decoding visual no. 9... wgl-win INFO: select_pixel_format(): Chose visual no. 9 By hardcoding this one, it works: Quote:
wgl-win INFO: Decoding visual no. 6...
|
Milan Mimica
Member #3,877
September 2003
|
Yap, It chose the generic MS driver, not the Intel's one. Find the line printed by TRACE(PREFIX_I "Accelarated: %s\n", pf->rmethod ? "yes" : "no"); The code gives priority to visuals that claim to be accelerated. If none of them claims to be accelerated how can we tell which is the good one? EDIT: heh
-- |
Matthew Leverton
Supreme Loser
January 1999
|
If you see my edit, it skips accelerated ones. What it doesn't like is "_al_pixel_format_fits" Quote:
wgl-win INFO: get_available_pixel_formats_old(): Got 42 visuals. wgl-win INFO: -1 9
|
Milan Mimica
Member #3,877
September 2003
|
Ah I see, this is not new either. Default pixel format is ALLEGRO_PIXEL_FORMAT_ANY_NO_ALPHA, while all your accelerated visuals would fit in ALLEGRO_PIXEL_FORMAT_ANY_WITH_ALPHA. I am going to fix this by introducing ALLEGRO_PIXEL_FORMAT_ANY.
-- |
|