ObjGameKit  Diff

Differences From Artifact [2b13daa365]:

  • File src/OGKDisplay.m — part of check-in [4719f25709] at 2012-08-26 12:17:52 on branch trunk — Only call al_*_destroy if Allegro is initialized.

    Otherwise, it would crash if al_uinstall_system() has already been
    called. Handling it this way eliminates the need to dealloc all objects
    before calling al_uninstall_system(), which meant that it was the users
    repsonsibility to call al_uninstall_system() after the user made sure
    all objects are deallocated. Now the user does not get to see any
    al_*() function. (user: js, size: 3719) [annotate] [blame] [check-ins using]

To Artifact [90ca05166c]:


61
62
63
64
65
66
67



68
69
70
71
72
73
74
75
      position: (of_point_t)position
	 flags: (ogk_display_flags_t)flags
{
	int allegroFlags = 0;

	self = [super init];




	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;
	if (flags & OGK_DISPLAY_FLAGS_OPENGL)
		allegroFlags |= ALLEGRO_OPENGL;







>
>
>
|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
      position: (of_point_t)position
	 flags: (ogk_display_flags_t)flags
{
	int allegroFlags = 0;

	self = [super init];

	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;
	if (flags & OGK_DISPLAY_FLAGS_OPENGL)
		allegroFlags |= ALLEGRO_OPENGL;
124
125
126
127
128
129
130



131
132
133
134
135
136
137
}

- (of_point_t)windowPosition
{
	int x, y;

	al_get_window_position(display, &x, &y);




	return of_point(x, y);
}

- (void)setSize: (of_dimension_t)size
{
	al_resize_display(display, size.width, size.height);







>
>
>







127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
}

- (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
{
	al_resize_display(display, size.width, size.height);