sgl

view src/sgl.c @ 4:648f8604d2b2

cont. x11 module
author John Tsiombikas <nuclear@siggraph.org>
date Thu, 12 May 2011 11:04:10 +0300
parents 1b6c5dadb460
children 0570e27e5ebc
line source
1 #include "sgl.h"
2 #include "wsys.h"
4 void sgl_register_modules(void);
6 static struct wsys_module *ws;
8 int sgl_init(void)
9 {
10 sgl_register_modules();
11 sgl_sort_modules();
13 if(!(ws = sgl_wsys_module())) {
14 return -1;
15 }
16 return ws->init();
17 }
19 void sgl_shutdown(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 int sgl_process_events(void)
55 {
56 return ws->process_events();
57 }