summaryrefslogtreecommitdiff
path: root/src/c_fl_surface.cpp
blob: 08fbc2d33a7364024c361a45d55ee950eb249be0 (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
39
40
41
42
43


//  Programmed by Jedidiah Barber
//  Released into the public domain


#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) {
    //  virtual so disable dispatch
    reinterpret_cast<Fl_Surface_Device*>(s)->Fl_Surface_Device::set_current();
}

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