Index: src/OGKDisplay.h ================================================================== --- src/OGKDisplay.h +++ src/OGKDisplay.h @@ -16,13 +16,18 @@ * 2.) Altered source versions must be plainly marked as such, and must not * be misrepresented as being the original software. * 3.) This notice may not be removed or altered from any source distribution. */ +/* For NAN */ +#include + #include #import + +#define OGK_DISPLAY_POSITION_DEFAULT of_point(NAN, NAN) typedef enum ogk_display_flags_t { OGK_DISPLAY_FLAGS_FULLSCREEN = 0x01, OGK_DISPLAY_FLAGS_RESIZABLE = 0x02, OGK_DISPLAY_FLAGS_OPENGL = 0x04, Index: src/OGKDisplay.m ================================================================== --- src/OGKDisplay.m +++ src/OGKDisplay.m @@ -63,11 +63,14 @@ { int allegroFlags = 0; self = [super init]; - al_set_new_window_position(position.x, position.y); + if (isnan(position.x) || isnan(position.y)) + al_set_new_window_position(INT_MAX, INT_MAX); + else + al_set_new_window_position(position.x, position.y); if (flags & OGK_DISPLAY_FLAGS_FULLSCREEN) allegroFlags |= ALLEGRO_FULLSCREEN; if (flags & OGK_DISPLAY_FLAGS_RESIZABLE) allegroFlags |= ALLEGRO_RESIZABLE; @@ -126,10 +129,13 @@ - (of_point_t)windowPosition { int x, y; al_get_window_position(display, &x, &y); + + if (x == INT_MAX && y == INT_MAX) + return of_point(NAN, NAN); return of_point(x, y); } - (void)setSize: (of_dimension_t)size