aboutsummaryrefslogtreecommitdiff
path: root/Src/nsv/nsvplay/vid_ddraw.h
blob: 0feea9f52e45de3d721b814808054cdcb604b5e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _VIDEO_DDRAW_H
#define _VIDEO_DDRAW_H

#include <ddraw.h>
#include "video.h"

class SubsItem;

class DDrawVideoOutput : public VideoOutputChild {
public:
  DDrawVideoOutput();
  virtual ~DDrawVideoOutput();

  int create(VideoOutput *parent, int w, int h, unsigned int type, int flipit, double aspectratio); //return 1 if ok
  int needChange() { return needchange; }

  int onPaint(HWND hwnd, HDC hdc);
  void displayFrame(const char *buf, int size, int time);

  void goFullScreen();
  void removeFullScreen();

  void timerCallback();

  void setPalette(RGBQUAD *pal) { m_palette=pal; }

  int showOSD();
  void hideOSD();

  void drawSubtitle(SubsItem *item);
  void resetSubtitle();

private:
  int width, height, flip;
  int needchange;
  unsigned int type;
  VideoOutput *m_parent;
  LPDIRECTDRAW		   lpDD;
  LPDIRECTDRAWSURFACE lpddsOverlay, lpddsPrimary, lpddsSTTemp;
  int sttmp_w, sttmp_h;
  DDCAPS          capsDrv;
  unsigned int    uDestSizeAlign, uSrcSizeAlign;
  DWORD           dwUpdateFlags;
  RECT rs,rd;
  RECT lastresizerect;

  bool initing;
  int is_fullscreen;

  LPDIRECTDRAWCLIPPER lpddsClipper;
  DDPIXELFORMAT m_ddpf;
  int m_depth;
  RGBQUAD *m_palette;

  HFONT subFont;
  RECT subRect;
  SubsItem *m_lastsubtitle;
  int m_sub_needremeasure;
  RECT winRect;
  int m_fontsize;
};

#endif