I can't seem to post in the other thread(timeout) , so I'll try here.
I decided to tackle loading fonts in android allegro as well It's not working
In Android Studio 3 I didn't see an assets folder so I made one.
Now, if I load a font, the application will hang.
Here's my code
I have VL-PGothic-Regular.ttf in my assets folder, but when I run the app I don't get a red or green screen, but a black one and it hangs...
What are you trying to do here? You can't set a zero resolution display.
I borrowing the code from the example at the bottom of liballeg lib for Android here...
https://github.com/liballeg/android
not only that - the example works
Setting zero width and height is unprecedented. The manual says absolutely nothing about ever doing that. I see the example does do that though, and if you say it works, fine.
Elias, that really needs to be documented.
By the way, you're not calling al_init_ttf_addon.
GRRR! I forgot the ttf header. It's tricky as phone development makes you lose the printf() debug console!
Now to figure out how to lock the screen in landscape!
I mean, I understand setting zero width and height if you're creating a fullscreen window, as the width and height are automatic. But you never set the new display flags, so I don't know why it would default to that. I thought default was windowed mode.
GRRR! I forgot the ttf header. It's tricky as phone development makes you lose the printf() debug console!
Use logcat instead. It will log to the android console.
Now to figure out how to lock the screen in landscape!
According to some notes I made a while back:
to force landscape add:
in AndroidManifest.xml, inside <activity>
android:configChanges="orientation|screenSize" android:screenOrientation="landscape"
AND before you create the display, call:
al_set_new_display_option(ALLEGRO_SUPPORTED_ORIENTATIONS,ALLEGRO_DISPLAY_ORIENTATION_LANDSCAPE,ALLEGRO_REQUIRE);
Elias, that really needs to be documented.
Well, those phones only support FULLSCREEN_WINDOW mode, so technically we could either make al_create_display fail if anything else is requested or fail if width/height are anything but 0 - but instead I think we just completely ignore them.
A simple note in the docs would be good enough, as long as it states the parameters passed to al_create_display will be ignored when creating a full screen window edit, and that full screen windows are the default.
It just struck me dumb that it worked.