-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindow.cpp
More file actions
60 lines (51 loc) · 1.08 KB
/
window.cpp
File metadata and controls
60 lines (51 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <GL/glext.h>
#include <vg/openvg.h>
#include <vg/vgu.h>
#include "window.h"
Window::Window(int argc, char* argv[]){
_width = 800;
_height = 600;
_title = NULL;
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA |
GLUT_STENCIL | GLUT_MULTISAMPLE);
#if 0
glutReshapeFunc(testReshape);
glutDisplayFunc(testDisplay);
glutIdleFunc(testAnimate);
glutKeyboardFunc(testKeyboard);
glutSpecialFunc(testSpecialKeyboard);
glutMouseFunc(testButton);
glutMotionFunc(testDrag);
glutPassiveMotionFunc(testMove);
atexit(testCleanup);
#endif
}
Window::~Window(){
if (NULL != _title){
free(_title);
}
}
void Window::setSize(int w, int h){
_width = w;
_height = h;
glutInitWindowPosition(0,0);
glutInitWindowSize(w,h);
//vgCreateContextSH(w,h);
}
void Window::setTitle(char* title){
if (NULL == title){
return;
}
_title = strdup(title);
glutCreateWindow(title);
}
void Window::run(){
glutMainLoop();
}