]> icculus.org git repositories - divverent/darkplaces.git/blob - cl_video.h
changed texture formats from RGBA to BGRA, yes this is a massive change,
[divverent/darkplaces.git] / cl_video.h
1
2 #ifndef CL_VIDEO_H
3 #define CL_VIDEO_H
4
5 #define MAXCLVIDEOS             64 + 1 // 1 video is reserved for the cinematic mode
6 // yields DYNAMIC_TEXTURE_PATH_PREFIX CLVIDEOPREFIX video name for a path
7 #define CLVIDEOPREFIX   CLDYNTEXTUREPREFIX "video/"
8 #define CLTHRESHOLD             2.0
9
10 #define MENUOWNER               1
11
12 typedef enum clvideostate_e
13 {
14         CLVIDEO_UNUSED,
15         CLVIDEO_PLAY,
16         CLVIDEO_LOOP,
17         CLVIDEO_PAUSE,
18         CLVIDEO_FIRSTFRAME,
19         CLVIDEO_RESETONWAKEUP,
20         CLVIDEO_STATECOUNT
21 } clvideostate_t;
22
23 typedef struct clvideo_s
24 {
25         int             ownertag;
26         clvideostate_t state;
27
28         // private stuff
29         void    *stream;
30
31         double  starttime;
32         int             framenum;
33         double  framerate;
34
35         void    *imagedata;
36
37         cachepic_t cpif;
38
39         // if a video is suspended, it is automatically paused (else we'd still have to process the frames)
40
41         // used to determine whether the video's resources should be freed or not
42     double  lasttime;
43         // when lasttime - realtime > THRESHOLD, all but the stream is freed
44         qboolean suspended;
45
46         char    filename[MAX_QPATH];
47 } clvideo_t;
48
49 clvideo_t*      CL_OpenVideo( const char *filename, const char *name, int owner );
50 clvideo_t*      CL_GetVideoByName( const char *name );
51 void            CL_SetVideoState( clvideo_t *video, clvideostate_t state );
52 void            CL_RestartVideo( clvideo_t *video );
53
54 void            CL_CloseVideo( clvideo_t * video );
55 void            CL_PurgeOwner( int owner );
56
57 void            CL_Video_Frame( void ); // update all videos
58 void            CL_Video_Init( void );
59 void            CL_Video_Shutdown( void );
60
61 // old interface
62 extern int cl_videoplaying;
63
64 void CL_DrawVideo( void );
65 void CL_VideoStart( char *filename );
66 void CL_VideoStop( void );
67
68 // new function used for fullscreen videos
69 // TODO: Andreas Kirsch: move this subsystem somewhere else (preferably host) since the cl_video system shouldnt do such work like managing key events..
70 void CL_Video_KeyEvent( int key, int ascii, qboolean down );
71
72 #endif