ObjGameKit  Diff

Differences From Artifact [a1fc7a3a43]:

To Artifact [ff2ce8d9d5]:


32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
32
33
34
35
36
37
38

39
40
41
42
43
44
45
46







-
+








OF_APPLICATION_DELEGATE(TestMain)

@implementation TestMain
- (void)display: (OGKDisplay*)display
      wasClosed: (OGKCloseEvent*)event
{
	running = NO;
	[OFApplication terminate];
}

- (void)keyWasPressed: (OGKKeyPressEvent*)event
	      display: (OGKDisplay*)display
{
	of_log(@"Pressed: %d", event.keycode);
}
76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
76
77
78
79
80
81
82

83
84
85
86
87
88
89
90







-
+







	case OGK_KEY_RIGHT:
		rotation.angle += M_PI / 128;
		break;
	case OGK_KEY_A:
		[self toggleAnimation];
		break;
	case OGK_KEY_Q:
		running = NO;
		[OFApplication terminate];
		break;
	}
}

- (void)mouseWasMoved: (OGKMouseMovedEvent*)event
	      display: (OGKDisplay*)display
{
187
188
189
190
191
192
193
194

195
196
197
198
199
200
201
187
188
189
190
191
192
193

194
195
196
197
198
199
200
201







-
+







	bitmap = [[OGKBitmap alloc] initWithFile: @"test.bmp"];
	position = of_point(display.size.width / 2, display.size.height / 2);
	scale = of_dimension(1, 1);
	rotation = ogk_rotation(bitmap.size.width / 2, bitmap.size.height / 2,
	    0);
	tint = ogk_color(1, 1, 1, 0);

	for (running = YES; running;) {
	for (;;) {
		@autoreleasepool {
			[self handleEvents];
			[self draw];
		}
	}
}
@end