00001 #ifndef _AVI_H_ 00002 #define _AVI_H_ 00003 00004 #include "../Common/OS/Windows.h" 00005 #include "../Graphics/OpenGL/OpenGLRenderer.h" 00006 #include <vfw.h> 00007 00008 class AVI { 00009 public: 00010 AVI(); 00011 virtual ~AVI(); 00012 void unload(); 00013 bool load(LPCSTR filename); 00014 bool isDone() { return done; }; 00015 void update(DWORD milliseconds); 00016 void setFrame(int frame); 00017 void setSpeed(float playSpeed) { scale = playSpeed; }; 00018 void setState(int state); 00019 GLuint genTex(int w=256, int h=256); 00020 00021 void sethDC(HDC hDC) { this->hdc = hDC; }; 00022 00023 private: 00024 GLuint texture; 00025 00026 int curFrame; 00027 AVISTREAMINFO psi; 00028 PAVISTREAM pavi; 00029 PGETFRAME pgf; 00030 BITMAPINFOHEADER bmih; 00031 int lastframe; 00032 UINT width; 00033 UINT height; 00034 00035 char *pdata; 00036 00037 int millisPerFrame; 00038 int elapsedTime; 00039 00040 HDRAWDIB hdd; 00041 HBITMAP hBitmap; 00042 HDC hdc; 00043 00044 unsigned char * data; 00045 00046 bool play; 00047 bool looping; 00048 bool direction; 00049 00050 bool done; 00051 00052 float scale; 00053 }; 00054 00055 #endif