00001
00002
00003
00004
00005
00006 #ifndef OglGui_TexturedViewAnimator_h
00007 #define OglGui_TexturedViewAnimator_h
00008
00009 #ifndef OglGui_Window_h
00010 #include "OglGui/Window.h"
00011 #endif
00012
00013 namespace OglGui
00014 {
00015
00016 class TexturedViewAnimator : public Window
00017 {
00018 public:
00019 TexturedViewAnimator(int x, int y, int w, int h,
00020 OGLVIEW* oglView = 0) :
00021 Window(x, y, w, h, false)
00022 {
00023 Init(oglView);
00024 }
00025
00026 TexturedViewAnimator(Window* parent, int w, int h,
00027 OGLVIEW* oglView = 0) :
00028 Window(parent, w, h, false)
00029 {
00030 Init(oglView);
00031 }
00032
00033 TexturedViewAnimator(Window* parent, int x, int y, int w, int h,
00034 OGLVIEW* oglView = 0):
00035 Window(parent, x, y, w, h, false)
00036 {
00037 Init(oglView);
00038 }
00039
00040 void OglView2D(OGLVIEW* oglView)
00041 {
00042 mExternOglView2D = oglView;
00043 }
00044 OGLVIEW* OglView2D()
00045 {
00046 return mExternOglView2D;
00047 }
00048
00049 OGLVIEW3D* OglView3D()
00050 {
00051 return mInternOglView3D;
00052 }
00053
00054 virtual void DisplayFunc()
00055 {
00056 if (mExternOglView2D)
00057 view3DSys.SetImage(mInternOglView3D, mExternOglView2D->im);
00058 Window::DisplayFunc();
00059 }
00060
00061
00062 private:
00063 void Init(OGLVIEW* oglView)
00064 {
00065 OGLIMAGE *oglIm = 0;
00066 if (mExternOglView2D = oglView)
00067 oglIm = oglView->im;
00068 mInternOglView3D = view3DSys.View3D(mOglWnd,oglIm,0.,0.,-2,1,1,1);
00069 view3DSys.SetTags(mInternOglView3D, FlexViewTags);
00070 mInternOglView3D->bgCol = 0xff888888;
00071 view3DSys.SetObject3D(mInternOglView3D,2);
00072 view3DSys.SetRotationSpeed(mInternOglView3D,.1f,.2f,.3f);
00073 SetBorderType(BEV_ETCHED);
00074 oglSys.SetAllowCameraMove(mOglWnd, TRUE);
00075 SetAlwaysDraw(true);
00076 }
00077
00078 OGLVIEW* mExternOglView2D;
00079 OGLVIEW3D* mInternOglView3D;
00080 };
00081
00082 }
00083 #endif
00084