summaryrefslogtreecommitdiff
path: root/src/c_fl_surface.cpp
blob: 89d661f9bc5eb1b256d496d820ff4c546721c257 (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
37
38


#include <FL/Fl_Device.H>
#include "c_fl_surface.h"




class My_Surface_Device : public Fl_Surface_Device {
    public:
        using Fl_Surface_Device::Fl_Surface_Device;
        friend SURFACE new_fl_surface(void * g);
};




SURFACE new_fl_surface(void * g) {
    My_Surface_Device *s = new My_Surface_Device(reinterpret_cast<Fl_Graphics_Driver*>(g));
    return s;
}

void free_fl_surface(SURFACE s) {
    delete reinterpret_cast<My_Surface_Device*>(s);
}




void fl_surface_set_current(SURFACE s) {
    reinterpret_cast<Fl_Surface_Device*>(s)->set_current();
}

SURFACE fl_surface_get_surface(void) {
    return Fl_Surface_Device::surface();
}