FreeBASIC  0.91.0
gfx_window.c
Go to the documentation of this file.
1 /* WINDOW statement */
2 
3 #include "fb_gfx.h"
4 
5 
6 /*:::::*/
7 FBCALL void fb_GfxWindow(float x1, float y1, float x2, float y2, int screen)
8 {
10  float temp;
11 
12  if (!__fb_gfx)
13  return;
14 
15  if (x1 || y1 || x2 || y2) {
16  if (x2 < x1) {
17  temp = x1;
18  x1 = x2;
19  x2 = temp;
20  }
21  if (y2 < y1) {
22  temp = y1;
23  y1 = y2;
24  y2 = temp;
25  }
26 
27  context->win_x = x1;
28  context->win_w = x2 - x1;
29  context->win_y = y1;
30  context->win_h = y2 - y1;
31  context->flags |= CTX_WINDOW_ACTIVE;
32  if (screen)
33  context->flags |= CTX_WINDOW_SCREEN;
34  }
35  else
36  context->flags &= ~(CTX_WINDOW_ACTIVE | CTX_WINDOW_SCREEN);
37 }