#ifndef PROZOR_H
#define PROZOR_H
#include <GL/glx.h>
#include <GL/gl.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/XKBlib.h>
#include <X11/keysymdef.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <time.h>
#define BEZ_PROBLEMA 0
#define BILO_PROBLEMA 1
struct prozor_t{
Display *konekcija;
int ekran;
XVisualInfo *info;
GLXContext kontekst;
Window roditelj;
Window prozor;
Colormap boje;
XSetWindowAttributes postavke;
unsigned int sirina;
unsigned int visina;
char radi;
pthread_t dretva;
void (*prikaz)(void);
char prikaz_registriran;
void (*tipkovnica)(char);
char tipkovnica_registriran;
pthread_t dretva_timer;
void (*timer)(void);
char timer_registriran;
time_t timer_zastoj_sekunde;
long timer_zastoj_nanosekunde;
};
static pthread_mutex_t KRITICNI = PTHREAD_MUTEX_INITIALIZER;
struct prozor_t* prozor_inicijaliziraj(const unsigned int, const unsigned int,
const char *);
void prozor_osvjezi(struct prozor_t*);
void prozor_registriraj_callback_prikaz(void (*)(void), struct prozor_t *);
void prozor_registriraj_callback_tipkovnica(void (*)(char),
struct prozor_t *);
void prozor_registriraj_callback_timer(void (*)(void), time_t, long,
struct prozor_t *);
void prozor_pokreni_petlju(struct prozor_t*);
void* prozor_glavna_petlja(void*);
void prozor_zavrsi_petlju(struct prozor_t*);
void* prozor_timer_petlja(void*);
void prozor_oslobodi(struct prozor_t*);
#endif