Fl_Gl_Windowでのアニメーション
をテンプレートにして作成
[
トップ
|
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
----
#contents
----
#code(C){{
class rxFlGLWindow : public Fl_Gl_Window
{
enum DrawObject
{
};
public:
rxFlGLWindow(int x_, int y_, int w_, int h_, const char*...
: Fl_Gl_Window(x_, y_, w_, h_, l)
{
m_bAnimation = false;
m_iDraw = RX_IDD_FACE;
end();
}
virtual ~rxFlGLWindow()
{
}
public:
void InitGL(void);
void Resize(int w, int h);
void Display(void);
void Mouse(int button, int state, int x, int y);
void Motion(int x, int y);
void PassiveMotion(int x, int y);
void Keyboard(int key, int x, int y);
static void OnIdle_s(void* x);
static void OnTimer_s(void* x);
inline void Idle(void)
inline void Timer(void)
private:
void draw(void)
void resize(int x_, int y_, int w_, int h_);
int handle(int ev);
};
}}
#code(C){{
void rxFlGLWindow::Keyboard(int key, int x, int y)
{
make_current();
switch(key){
case 's':
m_bAnimation ^= 1;
if(m_bAnimation){
Fl::add_idle(OnIdle_s, this);
}
else{
Fl::remove_idle(OnIdle_s, this);
}
break;
case 't':
m_bAnimation ^= 1;
if(m_bAnimation){
Fl::add_timeout(0.033, OnTimer_s, this);
}
break;
}
redraw();
}
}}
Fl::add_idle(rxTest::OnIdle_s, pTest);
#code(C){{
static void rxFlGLWindow::OnIdle_s(void* x)
{
((rxFlGLWindow*)x)->Idle();
}
inline void rxFlGLWindow::Idle(void)
{
make_current();
m_tbView.AddRotation(1.0, 0, 1, 0);
redraw();
}
}}
#code(C){{
static void rxFlGLWindow::OnTimer_s(void* x)
{
((rxFlGLWindow*)x)->Timer();
}
inline void rxFlGLWindow::Timer(void)
{
make_current();
m_tbView.AddRotation(1.0, 0, 1, 0);
redraw();
if(m_bAnimation){
Fl::repeat_timeout(0.033, OnTimer_s, this);
}
}
}}
#ref(fltk_simple_opengl3.zip)
終了行:
----
#contents
----
#code(C){{
class rxFlGLWindow : public Fl_Gl_Window
{
enum DrawObject
{
};
public:
rxFlGLWindow(int x_, int y_, int w_, int h_, const char*...
: Fl_Gl_Window(x_, y_, w_, h_, l)
{
m_bAnimation = false;
m_iDraw = RX_IDD_FACE;
end();
}
virtual ~rxFlGLWindow()
{
}
public:
void InitGL(void);
void Resize(int w, int h);
void Display(void);
void Mouse(int button, int state, int x, int y);
void Motion(int x, int y);
void PassiveMotion(int x, int y);
void Keyboard(int key, int x, int y);
static void OnIdle_s(void* x);
static void OnTimer_s(void* x);
inline void Idle(void)
inline void Timer(void)
private:
void draw(void)
void resize(int x_, int y_, int w_, int h_);
int handle(int ev);
};
}}
#code(C){{
void rxFlGLWindow::Keyboard(int key, int x, int y)
{
make_current();
switch(key){
case 's':
m_bAnimation ^= 1;
if(m_bAnimation){
Fl::add_idle(OnIdle_s, this);
}
else{
Fl::remove_idle(OnIdle_s, this);
}
break;
case 't':
m_bAnimation ^= 1;
if(m_bAnimation){
Fl::add_timeout(0.033, OnTimer_s, this);
}
break;
}
redraw();
}
}}
Fl::add_idle(rxTest::OnIdle_s, pTest);
#code(C){{
static void rxFlGLWindow::OnIdle_s(void* x)
{
((rxFlGLWindow*)x)->Idle();
}
inline void rxFlGLWindow::Idle(void)
{
make_current();
m_tbView.AddRotation(1.0, 0, 1, 0);
redraw();
}
}}
#code(C){{
static void rxFlGLWindow::OnTimer_s(void* x)
{
((rxFlGLWindow*)x)->Timer();
}
inline void rxFlGLWindow::Timer(void)
{
make_current();
m_tbView.AddRotation(1.0, 0, 1, 0);
redraw();
if(m_bAnimation){
Fl::repeat_timeout(0.033, OnTimer_s, this);
}
}
}}
#ref(fltk_simple_opengl3.zip)
ページ名: