28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
+
+
+
|
if (!al_install_system(ALLEGRO_VERSION_INT, NULL))
@throw [OFInitializationFailedException
exceptionWithClass: self];
}
- initWithSize: (of_dimension_t)size
position: (of_point_t)position
fullscreen: (BOOL)fullscreen
resizable: (BOOL)resizable
{
int flags = 0;
self = [super init];
#if 0
/* TODO: Find a nice way to set these when requested */
flags |= ALLEGRO_OPENGL_3_0;
flags |= ALLEGRO_OPENGL_FORWARD_COMPATIBLE;
#endif
al_set_new_window_position(position.x, position.y);
if (fullscreen)
flags |= ALLEGRO_FULLSCREEN;
else if (resizable)
flags |= ALLEGRO_RESIZABLE;
al_set_new_display_flags(flags);
|
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
}
- (void)dealloc
{
if (display != NULL)
al_destroy_display(display);
}
- (void)setWindowTitle: (OFString*)title
{
al_set_window_title(display,
[title cStringWithEncoding: OF_STRING_ENCODING_NATIVE]);
}
- (void)setWindowPosition: (of_point_t)position
{
al_set_window_position(display, position.x, position.y);
}
- (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);
}
- (of_dimension_t)size
{
return of_dimension(
al_get_display_width(display),
al_get_display_height(display));
}
- (void)update
{
al_flip_display();
}
- (ALLEGRO_DISPLAY*)OGK_allegroDisplay
{
return display;
}
@end
|