00001
00002
00003
00004
00005
00006 #ifndef Impala_Application_SDash_LogoAnimation_h
00007 #define Impala_Application_SDash_LogoAnimation_h
00008
00009 #include <string>
00010
00011 #include "Link/OGL/OGLWnd.h"
00012
00013 namespace Impala {
00014 namespace Application {
00015 namespace SDash {
00016
00017 class LogoAnimation {
00018 public:
00019 LogoAnimation(Window* parent, int width, int height)
00020 {
00021 OGLWND* oglWnd =
00022 oglSys.CreateOGLViewPort(parent->GetOGLWND(),0,0,width,height);
00023 MNAnimFuncs(oglWnd);
00024 Window* animWnd = new Window(oglWnd);
00025 animWnd->SetVisible(false);
00026 animWnd->ConnectTo(parent);
00027 animWnd->SetWindowListener(new AnimWindowListener());
00028
00029 OGLIMAGE* logo = TryReadPNG("Logos.png");
00030 WindowView2D* logos =
00031 new WindowView2D(parent,width-logo->w-2,2,logo->w,logo->h,logo);
00032 oglSys.ReleaseOglImage(logo);
00033 logos->SetBorderType(1);
00034 logos->GetOglView()->texturing = 0;
00035 logos->SetActAsButton(true);
00036 logos->SetWndView2DListener(new LogoListener(), (void*)animWnd);
00037 logos->ScaleTo(parent);
00038 }
00039
00041
00042 class AnimWindowListener : public WindowListener
00043 {
00044 virtual void
00045 WindowMouseEvent(Window *src, int msg, int but, int state,
00046 int x, int y, void* userData )
00047 {
00048 if (msg==oglMouseDown)
00049 src->SetVisible(false);
00050 }
00051 };
00052
00053 class LogoListener : public WindowView2DListener
00054 {
00055 virtual void SelectionEvent(WindowView2D *src, void* userData)
00056 {
00057 Window* animWnd = (Window*) userData;
00058 animWnd->SetVisible(!animWnd->GetVisible());
00059 if (animWnd->GetVisible())
00060 oglFocusWnd = animWnd->GetOGLWND();
00061 }
00062 };
00063
00064 };
00065
00066 }
00067 }
00068 }
00069 #endif
00070