sgl

view src/sgl.c @ 5:0570e27e5ebc

pretty much done with the basic functionality and GLX shit
author John Tsiombikas <nuclear@siggraph.org>
date Fri, 13 May 2011 07:49:47 +0300
parents 648f8604d2b2
children edbfc96fe80d
line source
1 #include "sgl.h"
2 #include "wsys.h"
4 void sgl_modules_init(void);
6 static struct wsys_module *ws;
8 int sgl_init(void)
9 {
10 sgl_modules_init();
11 sgl_sort_modules();
13 if(!(ws = sgl_wsys_module())) {
14 return -1;
15 }
16 return ws->init();
17 }
19 void sgl_quit(void)
20 {
21 ws->shutdown();
22 }
24 int sgl_set_video_mode(int xsz, int ysz)
25 {
26 return ws->set_vidmode(xsz, ysz);
27 }
29 int sgl_get_video_mode(int *xsz, int *ysz)
30 {
31 return ws->get_vidmode(xsz, ysz);
32 }
34 int sgl_create_window(int xsz, int ysz, unsigned int mode)
35 {
36 return ws->create_window(xsz, ysz, mode);
37 }
39 void sgl_close_window(int win)
40 {
41 ws->close_window(win);
42 }
44 int sgl_set_active(int id)
45 {
46 return ws->set_active(id);
47 }
49 int sgl_set_title(const char *str)
50 {
51 return ws->set_title(str);
52 }
54 void sgl_redisplay(void)
55 {
56 ws->redisplay();
57 }
59 void sgl_swap_buffers(void)
60 {
61 ws->swap_buffers();
62 }
64 int sgl_process_events(void)
65 {
66 return ws->process_events();
67 }
69 void sgl_event_loop(void)
70 {
71 while(ws->process_events() == 0);
72 }