void app_resize(int x, int y);
void app_fullscreen(int fs);
void app_vsync(int vsync);
+void app_rband(int x, int y, int w, int h);
/* defined in scr_mod.c for convenience */
void primray(cgm_ray *ray, int x, int y);
static int quit, disp_pending, dirty_valid;
static rtk_rect dirty;
static int mx, my;
+static rtk_rect rband;
+
int main(int argc, char **argv)
{
{
}
+void app_rband(int x, int y, int w, int h)
+{
+ if(!(w | h)) {
+ w = h = 0;
+ }
+
+ rband.x = x;
+ rband.y = y;
+ rband.width = w;
+ rband.height = h;
+}
+
static void draw_cursor(int x, int y)
{
int i;
if(x < win_width - offs - 1) fbptr[offs] ^= 0xffffff;
}
}
+
+static void draw_rband(void)
+{
+ int i;
+ rtk_rect rect;
+ uint32_t *fbptr, *bptr;
+
+ rect = rband;
+ fix_rect(&rect);
+
+ fbptr = framebuf + rect.y * win_width + rect.x;
+ bptr = fbptr + win_width * (rect.height - 1);
+
+ for(i=0; i<rect.width; i++) {
+ fbptr[i] ^= 0xffffff;
+ bptr[i] ^= 0xffffff;
+ }
+ fbptr += win_width;
+ for(i=0; i<rect.height-2; i++) {
+ fbptr[0] ^= 0xffffff;
+ fbptr[rect.width - 1] ^= 0xffffff;
+ fbptr += win_width;
+ }
+ app_redisplay(rect.x, rect.y, rect.width, rect.height);
+}
if(rendering) {
if(!render(framebuf)) {
rendering = 0;
- vpdirty = 1;
}
app_redisplay(rendrect.x, rendrect.y, rendrect.width, rendrect.height);
}
rect->height = h;
}
-static void draw_rband(void)
-{
- int i;
- rtk_rect rect;
- uint32_t *fbptr, *bptr;
-
- rect = rband;
- fix_rect(&rect);
-
- fbptr = framebuf + rect.y * win_width + rect.x;
- bptr = fbptr + win_width * (rect.height - 1);
-
- for(i=0; i<rect.width; i++) {
- fbptr[i] ^= 0xffffff;
- bptr[i] ^= 0xffffff;
- }
- fbptr += win_width;
- for(i=0; i<rect.height-2; i++) {
- fbptr[0] ^= 0xffffff;
- fbptr[rect.width - 1] ^= 0xffffff;
- fbptr += win_width;
- }
- app_redisplay(rect.x, rect.y, rect.width, rect.height);
-}
void primray(cgm_ray *ray, int x, int y)
{