aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/utils/SkEGLContext.h
blob: 6aa8518e532c12dcc45ba7ffdb55aa3c5e3dad6b (plain)
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
#ifndef SkEGLContext_DEFINED
#define SkEGLContext_DEFINED

#if defined(SK_BUILD_FOR_MAC)
    #include <AGL/agl.h>
#elif defined(SK_BUILD_FOR_UNIX)
    #include <X11/Xlib.h>
    #include <GL/glx.h>
#else

#endif

/**
 *  Create an offscreen opengl context
 */
class SkEGLContext {
public:
    SkEGLContext();
    ~SkEGLContext();

    bool init(int width, int height);

private:
#if defined(SK_BUILD_FOR_MAC)
    AGLContext context;
#elif defined(SK_BUILD_FOR_UNIX)
    GLXContext context;
    Display *display;
    Pixmap pixmap;
    GLXPixmap glxPixmap;
#else

#endif
};

#endif