quakeforge/ruamoko/qwaq/qwaq-screen.r
Bill Currie bea64838cc [qwaq] Use new TextContext
Not quite right yet, but it worked first try (once I got another
compiler bug sorted).
2020-03-06 17:38:27 +09:00

51 lines
799 B
R

#include <Array.h>
#include "qwaq-curses.h"
#include "qwaq-screen.h"
@implementation Screen
+(Screen *) screen
{
return [[[self alloc] init] autorelease];
}
-init
{
if (!(self = [super initWithRect:getwrect (stdscr)])) {
return nil;
}
textContext = [TextContext screen];
[textContext scrollok: 1];
return self;
}
-handleEvent: (qwaq_event_t *) event
{
if (event.what & qe_mouse) {
[self printf:"%04x %2d %2d %d %08x \r", event.what, event.mouse.x, event.mouse.y, event.mouse.click, event.mouse.buttons];
[self redraw];
}
return self;
}
-draw
{
update_panels ();
[TextContext doupdate];
return self;
}
-redraw
{
update_panels ();
[textContext refresh];
[TextContext doupdate];
return self;
}
-setBackground: (int) ch
{
[textContext bkgd:ch];
return self;
}
@end