Subversion Repositories seema-scanner

Rev

Rev 1 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 205
1
//
1
//
2
//  OpenGLContext.h
2
//  OpenGLContext.h
3
//  OpenGLContext
3
//  OpenGLContext
4
//
4
//
5
//  Created by Jakob Wilm on 18/03/13.
5
//  Created by Jakob Wilm on 18/03/13.
6
//  Copyright (c) 2013 Jakob Wilm. All rights reserved.
6
//  Copyright (c) 2013 Jakob Wilm. All rights reserved.
7
//
7
//
8
 
8
 
9
#ifndef OPENGLCONTEXT_H
9
#ifndef OPENGLCONTEXT_H
10
#define OPENGLCONTEXT_H
10
#define OPENGLCONTEXT_H
11
 
11
 
12
#include <iostream>
12
#include <iostream>
13
#include <vector>
13
#include <vector>
14
#include <sys/types.h>
14
#include <sys/types.h>
15
 
15
 
16
struct ScreenInfo {
16
struct ScreenInfo {
17
    unsigned int resX, resY;
17
    unsigned int resX, resY;
18
    unsigned int posX, posY;
18
    unsigned int posX, posY;
19
    std::string name;
19
    std::string name;
20
    ScreenInfo(): resX(0), resY(0), posX(0), posY(0){}
20
    ScreenInfo(): resX(0), resY(0), posX(0), posY(0){}
21
};
21
};
22
 
22
 
23
// Platform dependent OpenGLContext class
23
// Platform dependent OpenGLContext class
24
class OpenGLContext{
24
class OpenGLContext{
25
    public:
25
    public:
26
        // Static "class" methods
26
        // Static "class" methods
27
        static std::vector<ScreenInfo> GetScreenInfo();
27
        static std::vector<ScreenInfo> GetScreenInfo();
28
        // Interface function
28
        // Interface function
29
        OpenGLContext(unsigned int _screenNum = 0);
29
        OpenGLContext(unsigned int _screenNum = 0);
30
        void setGamma(float gamma);
30
        void setGamma(float gamma);
31
        unsigned int getScreenResX(){return screenResX;}
31
        unsigned int getScreenResX(){return screenResX;}
32
        unsigned int getScreenResY(){return screenResY;}
32
        unsigned int getScreenResY(){return screenResY;}
33
        ~OpenGLContext();
33
        ~OpenGLContext();
34
        void makeContextCurrent();
34
        void makeContextCurrent();
35
        void flush();
35
        void flush();
36
    private:
36
    private:
37
        unsigned int screenNum;
37
        unsigned int screenNum;
38
        unsigned int screenResX, screenResY;
38
        unsigned int screenResX, screenResY;
39
        // Opaque data type defined in platform specific files
39
        // Opaque data type defined in platform specific files
40
        struct OpenGLContextInfo;
40
        struct OpenGLContextInfo;
41
        OpenGLContextInfo *contextInfo;
41
        OpenGLContextInfo *contextInfo;
42
};
42
};
43
 
43
 
44
#endif
44
#endif
45
 
45