glviewvol

view src/dicomview.cc @ 1:cc9e0d8590e2

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 27 Dec 2014 06:32:28 +0200
parents 7bdf40403b9c
children 32c4a7160350
line source
1 #include "opengl.h"
2 #include "dicomview.h"
3 #include "rend_fast.h"
5 static int win_width, win_height;
6 static float cam_theta, cam_phi, cam_dist = 6;
8 static Renderer *rend;
10 extern "C" {
12 int init()
13 {
14 rend = new RendererFast;
15 if(!rend->init()) {
16 return -1;
17 }
19 return 0;
20 }
22 void cleanup()
23 {
24 rend->destroy();
25 delete rend;
26 }
28 void ev_display()
29 {
30 glClear(GL_COLOR_BUFFER_BIT);
32 rend->update(0);
33 rend->render();
34 }
36 void ev_reshape(int x, int y)
37 {
38 win_width = x;
39 win_height = y;
41 glViewport(0, 0, x, y);
42 }
44 void ev_keyboard(int key, int press, int x, int y)
45 {
46 if(press) {
47 switch(key) {
48 case 27:
49 quit();
50 }
51 }
52 }
54 void ev_mouse_button(int bn, int press, int x, int y)
55 {
56 }
58 void ev_mouse_motion(int x, int y)
59 {
60 }
62 } // extern "C"