quakeforge/ruamoko/qwaq/qwaq-screen.r
Bill Currie 6f1386fa0d [qwaq] Test out acs chars and the classes
Crashes due to flooding the command buffer, but otherwise works (with
larger buffer).
2020-03-02 18:29:31 +09:00

53 lines
798 B
R

#include "qwaq-curses.h"
#include "qwaq-screen.h"
@implementation Screen
+(Screen *) screen
{
return [[[self alloc] init] autorelease];
}
-init
{
if (!(self = [super init])) {
return nil;
}
views = [[Array array] retain];
event_handlers = [[Array array] retain];
window = stdscr;
rect = getwrect (window);
return self;
}
-add: obj
{
if ([obj conformsToProtocol: @protocol (Draw)]) {
[views addObject: obj];
}
if ([obj conformsToProtocol: @protocol (HandleEvent)]) {
[event_handlers addObject: obj];
}
return self;
}
-setBackground: (int) ch
{
wbkgd (window, ch);
wrefresh (window);
return self;
}
-handleEvent: (qwaq_event_t *) event
{
return self;
}
-draw
{
[views makeObjectsPerformSelector: @selector (draw)];
update_panels ();
doupdate ();
return self;
}
@end