22 |
|
#include <X11/StringDefs.h> |
23 |
|
#include <X11/Intrinsic.h> |
24 |
|
#include <X11/Shell.h> |
25 |
+ |
#include <X11/cursorfont.h> |
26 |
|
#include <X11/Xaw/Simple.h> |
27 |
|
#include <X11/extensions/XShm.h> |
28 |
|
#include <X11/extensions/Xv.h> |
39 |
|
static int image_width, image_height; |
40 |
|
static int win_width, win_height; |
41 |
|
|
42 |
< |
const int PAL_FPS = 50; |
43 |
< |
const int NTSC_FPS = 60; |
42 |
> |
const double PAL_FPS = 50.0; |
43 |
> |
const double NTSC_FPS = 59.94; |
44 |
|
|
45 |
< |
static int fps; |
45 |
> |
static double fps; |
46 |
|
|
47 |
|
static int brightness = 50, contrast = 50, color = 50; |
48 |
|
|
285 |
|
|
286 |
|
now = GetTicks_usec(); |
287 |
|
uint64 elapsed = now - prev; |
288 |
< |
int64 delay = 1000000 / fps - (now - prev); |
288 |
> |
int64 delay = int64(1000000.0 / fps) - (now - prev); |
289 |
|
#if LOGGING |
290 |
|
fprintf(log, "elapsed %Ld usec, delay %Ld usec\n", elapsed, delay); |
291 |
|
#endif |
463 |
|
NULL |
464 |
|
); |
465 |
|
XtRealizeWidget(app_shell); |
466 |
+ |
Cursor null_cursor = XCreateFontCursor(dpy, XC_left_ptr); |
467 |
+ |
XDefineCursor(dpy, XtWindow(app_shell), null_cursor); |
468 |
|
XtVaSetValues(app_shell, |
469 |
|
XtNtitle, "mintv", |
470 |
+ |
XtNinput, True, |
471 |
|
NULL |
472 |
|
); |
473 |
< |
XSetWMProtocols(XtDisplay(app_shell), XtWindow(app_shell), &wm, 1); |
473 |
> |
XSetWMProtocols(dpy, XtWindow(app_shell), &wm, 1); |
474 |
|
gc = XCreateGC(dpy, XtWindow(video), 0, NULL); |
475 |
|
|
476 |
|
// Set image format |