![]() |
|
ak_create_display problem in Android |
drajin.cho
Member #17,558
March 2020
|
Simply I tried to create display with size (1280, 720). But, actual display was created with size (2094, 1080) as the attached png. Is any option or flag required? |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
drajin.cho said: Simply I tried to create display with size (1280, 720). But, actual display was created with size (2094, 1080) as the attached png. Is any option or flag required? On Android, you can generally only get a display the size of the physical screen. There may have been a development with ALLEGRO_FRAMELESS and ALLEGRO_FULLSCREEN_WINDOW, which is preferred to ALLEGRO_FULLSCREEN. You should probably be happy with what you get, and use a simple transform to draw everything. Some links ; http://docs.liballeg.org/transformations.html#al_get_current_transform https://liballeg.org/a5docs/trunk/display.html#al_set_new_display_flags ALLEGRO_TRANSFORM t; al_identity_transform(&t); al_get_current_transform(&t); al_scale_transform(&t , (float)al_get_display_width(display)/MYWIDTH , (float)al_get_display_height(display)/MYHEIGHT); Then in your drawing code, you use the transform to scale your graphics up to the screen dimensions. 1 if (redraw) {
2 al_clear_to_color(al_map_rgb(255,255,255));
3 ALLEGRO_TRANSFORM old;
4 al_get_view_transform(&old);
5 al_use_transform(&t);
6 /// Draw normally here
7 al_draw_my_cool_stuff();
8 al_flip_display();
9 al_use_transform(&old);
10 redraw = false;
11 }
12 do {
13 ALLEGRO_EVENT ev;
14 al_wait_for_event(queue , &ev);
15 if (ev.type == ALLEGRO_EVENT_WHATEVER) {
16 DoStuff();
17 }
18 } while (!al_is_event_queue_empty(queue));
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 |
drajin.cho
Member #17,558
March 2020
|
Thanks for your kind support!!! I fixed the problem. I have more questions. 1. is it possible to convert y-coordinate from top-to-bottom to bottom-to-top? I'd like to change coordinate only. image and drawing should be drawn in the normal way. 2. isn't "video" supported in Android release? 3. I tried to play audio (the attached) using al_load_audio_stream(). stream = al_load_audio_stream(filename.c_str(), 4, 2048); playing other files is OK. I guess that it's too short. |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
drajin.cho said: I'd like to change coordinate only. image and drawing should be drawn in the normal way. Then you don't need to use the transform, but rather apply it. Use https://liballeg.org/a5docs/trunk/transformations.html#al_transform_coordinates To transform *x and *y into right side up coordinates. But don't change your drawing coordinates or the drawing transform. drajin.cho said: 2. isn't "video" supported in Android release? I don't know. Right now you only have support for theora, if it was compiled in. 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 |
|