Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » ex_resize

This thread is locked; no one can reply to it. rss feed Print
ex_resize
Peter Hull
Member #1,136
March 2001

Quick question - in ex_resize, is the A supposed to fit exactly in the window?

Elias
Member #358
May 2000

https://github.com/liballeg/allegro5/blob/master/examples/ex_resize.c

w = al_get_bitmap_width(al_get_target_bitmap());
h = al_get_bitmap_height(al_get_target_bitmap());
al_draw_line(0, h, w / 2, 0, black, 0);
al_draw_line(w / 2, 0, w, h, black, 0);
al_draw_line(w / 4, h / 2, 3 * w / 4, h / 2, black, 0);

So the answer is yes, the two feet of the A are the bottom left and right corners exactly and the top is at the very top.

--
"Either help out or stop whining" - Evert

Peter Hull
Member #1,136
March 2001

I ask because, yes it does on Linux but not on MacOS. It seems like if you resize the window, it re-scales the GL context so that it has the same size as the original (100x100 in this case)

https://www.allegro.cc/files/attachment/612969

Elias
Member #358
May 2000

Hm, yeah, my first guess would be that al_resize_display() does not work correctly under MacOS.

--
"Either help out or stop whining" - Evert

Peter Hull
Member #1,136
March 2001

These functions get called:

  1. `al_resize_display` (cross-platform) calls...

  2. `resize_display_win` (mac specific) calls...

  3. `resize_display_win_main_thread` (mac specific) calls...

  4. `acknowledge_resize_display_win_main_thread` (mac specific) calls...

  5. `setup_gl` (mac specific) calls...

  6. `_al_ogl_setup_gl` (cross-platform) calls...

  7. `_al_ogl_resize_backbuffer` (cross-platform)

and in _al_ogl_resize_backbuffer it sets up a transformation involving the width and height. It's very confusing. I think the next step is to trace the same call on X11 and see where it differs - unless you can jump straight to the solution!?

Go to: