00001
00002
00003
00004 #ifndef Avi_Player_Header
00005 #define Avi_Player_Header
00006
00007 #ifdef _WIN32
00008
00009 #include <windows.h>
00010 #include <gl\gl.h>
00011 #include <gl\glu.h>
00012
00013 #undef SHORT // -> Needed before the <vfw.h> include, does not compile otherwise!
00014 #include <vfw.h>
00015
00016 #pragma comment( lib, "opengl32.lib" ) // Search For OpenGL32.lib While Linking
00017 #pragma comment( lib, "glu32.lib" ) // Search For GLu32.lib While Linking
00018 #pragma comment( lib, "vfw32.lib" ) // Search For VFW32.lib While Linking
00019
00020 #else
00021
00022
00023
00024
00025 #endif
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 class AviPlayer {
00039
00040 public:
00041
00042 AviPlayer(char* video, int width, int height);
00043 virtual ~AviPlayer();
00044
00045 static int debug;
00046 static const char* rcsid;
00047
00048 virtual void Update();
00049 virtual void Draw(float x, float y, float width, float height);
00050
00051 bool isRepeatMovie() { return repeatMovie; }
00052 void setRepeatMovie(bool repeat) { repeatMovie = repeat; }
00053
00054 private:
00055
00056
00057
00058 bool repeatMovie;
00059 #ifdef _WIN32
00060 void OpenAVI(LPCSTR szFile);
00061 void GrabAVIFrame(int frame);
00062 void CloseAVI();
00063 void flipIt(void* buffer);
00064
00065
00066 int textureWidth;
00067 int textureHeight;
00068 int textureSize;
00069 int next;
00070 int frame;
00071 DWORD lastTickCount;
00072
00073 AVISTREAMINFO psi;
00074 PAVISTREAM pavi;
00075 PGETFRAME pgf;
00076 BITMAPINFOHEADER bmih;
00077 long lastframe;
00078 int width;
00079 int height;
00080 char *pdata;
00081 int mpf;
00082
00083 GLUquadricObj *quadratic;
00084
00085 HDRAWDIB hdd;
00086 HBITMAP hBitmap;
00087 HDC hdc;
00088 unsigned char* data;
00089
00090 #else
00091
00092
00093
00094 #endif
00095
00096
00097 };
00098
00099 #endif // Avi_Player_Header