|
Allegro 5.1.9 (GIT) -- al_set_new_window_position |
Stagera
Member #4,606
May 2004
|
Hi, Maybe someone can help me out 1#include <stdio.h>
2#include <allegro5/allegro.h>
3
4int main(int argc, char **argv)
5{
6 ALLEGRO_DISPLAY *display = NULL;
7
8 al_init();
9 ALLEGRO_MONITOR_INFO info;
10 al_get_monitor_info(0, &info);
11
12 fprintf(stderr, "info.x1: %d -- info.x2: %d\n", info.x1,info.x2);
13 fprintf(stderr, "info.y1: %d -- info.y2: %d\n\n", info.y1,info.y2);
14
15 al_set_new_window_position(info.x2 / 2, info.y2 / 2);
16 fprintf(stderr, "set new window position: %d %d\n\n", info.x2 / 2, info.y2 / 2);
17 al_set_new_display_flags (ALLEGRO_FRAMELESS);
18 display = al_create_display(100, 100);
19 al_clear_to_color(al_map_rgb(0,0,0));
20 al_flip_display();
21
22 int x,y;
23 al_get_window_position(display, &x, &y);
24 fprintf(stderr, "get window position: %d %d\n\n", x, y);
25
26 al_rest(10.0);
27
28 al_destroy_display(display);
29 return 0;
30}
|
pkrcel
Member #14,001
February 2012
|
I can't really evaluate the apparent discrepancy from the screenshot the top lef corner seems indeed a bit off....try drawing the window WITH the frame and check wehre that ends up drwan. It is unlikely that Google shares your distaste for capitalism. - Derezo |
Stagera
Member #4,606
May 2004
|
Hi pkrcel, The screenshot refer to my last test. I did several. Update |
SiegeLord
Member #7,827
October 2006
|
Stagera said: Displacement happens only on Windows 8 (8.1) Damn, I was going to try to fix this, but I only have Windows 7 . "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Stagera
Member #4,606
May 2004
|
Also the window size is messed up on my Windows 8.1 |
|