File: FOX_OSG.h

package info (click to toggle)
openscenegraph 3.2.1-6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 32,904 kB
  • ctags: 34,781
  • sloc: cpp: 370,251; ansic: 10,145; java: 1,020; yacc: 548; objc: 288; makefile: 282; xml: 155; lex: 151
file content (63 lines) | stat: -rw-r--r-- 1,775 bytes parent folder | download | duplicates (12)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _FOXOSG_H_
#define _FOXOSG_H_

#include <osgViewer/Viewer>
#include <string>

#include <fx.h>
#include <fx3d.h>

using namespace FX;

class GraphicsWindowFOX: public FXGLCanvas, public osgViewer::GraphicsWindow{

        FXDECLARE(GraphicsWindowFOX)

public:
    GraphicsWindowFOX(FXComposite *parent, FXGLVisual *vis,
        FXObject *tgt=NULL, FXSelector sel=0,
        FXuint opts=0, FXint x=0, FXint y=0,
        FXint w=0, FXint h=0);

    virtual ~GraphicsWindowFOX();

    // callback
    long onConfigure(FXObject*, FXSelector, void*);
    long onKeyPress(FXObject*, FXSelector, void*);
    long onKeyRelease(FXObject*, FXSelector, void*);
    long onLeftBtnPress(FXObject*, FXSelector, void*);
    long onLeftBtnRelease(FXObject*, FXSelector, void*);
    long onMiddleBtnPress(FXObject*, FXSelector, void*);
    long onMiddleBtnRelease(FXObject*, FXSelector, void*);
    long onRightBtnPress(FXObject*, FXSelector, void*);
    long onRightBtnRelease(FXObject*, FXSelector, void*);
    long onMotion(FXObject*, FXSelector, void*);

    void init();

    //
    // GraphicsWindow interface
    //
    void grabFocus();
    void grabFocusIfPointerInWindow();
    void useCursor(bool cursorOn);

    bool makeCurrentImplementation();
    bool releaseContext();
    void swapBuffersImplementation();

    // note implemented yet...just use dummy implementation to get working.    
    virtual bool valid() const { return true; }
    virtual bool realizeImplementation() { return true; }
    virtual bool isRealizedImplementation() const  { return true; }
    virtual void closeImplementation() {}
    virtual bool releaseContextImplementation() { return true; }

protected:
    GraphicsWindowFOX(){};

private:
    FXCursor* _oldCursor;
};

#endif // _FOXOSG_H_