Subversion Repositories seema-scanner

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 jakw 1
#ifndef PROJECTOROPENGL_H
2
#define PROJECTOROPENGL_H
3
 
4
#include <iostream>
5
#include <vector>
6
#include <sys/types.h>
7
 
8
#ifdef __APPLE__
9
    #include <OpenGL/gl.h>
10
#else
11
    #if _WIN32
12
        #include <windows.h>
13
    #endif
14
    #include <GL/gl.h>
15
#endif
16
 
17
#include "Projector.h"
18
#include "OpenGLContext.h"
19
 
20
struct texture{
21
    GLuint texName;
22
    unsigned int width, height;
23
};
24
 
25
// ProjectorOpenGL implementations
26
class ProjectorOpenGL : public Projector {
27
    public:
28
        // Interface function
29
        ProjectorOpenGL(unsigned int _screenNum = 0);
30
        // Define preset pattern sequence and upload to GPU
31
        void setPattern(unsigned int patternNumber, const unsigned char *tex, unsigned int texWidth, unsigned int texHeight);
32
        void displayPattern(unsigned int patternNumber);
33
        // Upload and display pattern on the fly
34
        void displayTexture(const unsigned char *tex, unsigned int width, unsigned int height);
35
        void displayBlack();
36
        void displayWhite();
37
        void getScreenRes(unsigned int *nx, unsigned int *ny);
38
        ~ProjectorOpenGL();
39
    private:
40
        std::vector<texture> textures;
41
        OpenGLContext *context;
42
};
43
 
44
#endif