#endif
rend_init();
- load_options("retroray.cfg");
- app_resize(opt.xres, opt.yres);
app_vsync(opt.vsync);
if(opt.fullscreen) {
app_fullscreen(1);
int numpix = x * y;
int prev_numpix = win_width * win_height;
- dbgmsg("reshape(%d, %d)\n", x, y);
-
if(!framebuf || numpix > prev_numpix) {
void *tmp;
if(!(tmp = realloc(framebuf, numpix * sizeof *framebuf))) {
if(cur_scr && cur_scr->reshape) {
cur_scr->reshape(x, y);
}
+
+ app_redisplay(0, 0, 0, 0);
}
void app_keyboard(int key, int press)
msec = get_msec();
if(msec - prev_esc < 1000) {
app_quit();
+ return;
}
prev_esc = msec;
- return;
+ break;
#endif
case 'q':
static void gui_drawtext(int x, int y, const char *str)
{
+ use_font(uifont);
+ dtx_position(x, y);
+ dtx_color(0, 0, 0, 1);
+ dtx_string(str);
}
static void gui_textrect(const char *str, rtk_rect *rect)
{
- rect->x = rect->y = 0;
- rect->width = 20;
- rect->height = 10;/* TODO */
+ struct dtx_box dbox;
+
+ use_font(uifont);
+ dtx_string_box(str, &dbox);
+
+ rect->x = dbox.x;
+ rect->y = dbox.y;
+ rect->width = dbox.width;
+ rect->height = dbox.height;
}