2 Copyright 2004-2005 Chris Tallon
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef OSDWINVECTOR_H
22 #define OSDWINVECTOR_H
26 #include "osdvector.h"
29 #include "windowsosd.h"
40 class OsdWinVector : public OsdVector, public WindowsOsd
42 friend class WICPictDecoder;
47 int init(void* device);
50 int isInitialized() { return initted; }
52 void getScreenSize(int &width, int &height);
53 void getRealScreenSize(int &width, int &height);
55 float getFontHeight();
56 float getCharWidth(wchar_t c);
58 bool screenShot(void *buffer, int width, int height, bool osd /*include osd*/);
60 int getFontNames(const char *** names, const char *** names_keys);
62 void setFont(const char * fontname);
64 float getPixelAspect() { return aspect_correction; };
67 LPDIRECT3DTEXTURE9 getNextOsdTexture();
68 void lostDestroyObjects();
69 void lostRecreateObjects();
71 void getTextureCoordinates(FLOAT*, FLOAT*);
73 /*osd vector implementation*/
74 void destroyImageRef(ImageIndex index);
75 ImageIndex createMonoBitmap(void *base, int width, int height);
76 ImageIndex createImagePalette(int width, int height, const unsigned char *image_data, const unsigned int*palette_data);
77 void createPicture(struct PictureInfo& pict_inf);
78 void destroyStyleRef(VectorHandle index);
79 VectorHandle createStyleRef(const DrawStyle &c);
80 bool getStaticImageData(unsigned int static_id, UCHAR **userdata, ULONG *length);
83 int loadFont(bool fontchange);
85 map<unsigned int, float> font_exp_x;
86 vector<char*> fontnames;
87 //vector<char*> fontnames_keys;
88 wchar_t * cur_fontname;
89 bool is_direct_write_initted;
90 IDWriteFactory* dwritefac;
92 IDWriteFontFace* fontface;
95 float fontaspect_corr;
99 unsigned char position;
102 TTIndex loadTTchar(cTeletextChar c);
104 map<unsigned int, TTIndex> tt_font_chars;
105 vector<ID2D1Bitmap *> tt_atlas;
107 ID2D1SolidColorBrush *ttbrush;
110 void executeDrawCommand(SVGCommand & command);
111 void drawSetTrans(SurfaceCommands & sc);
114 LPDIRECT3DTEXTURE9 surf9;
115 IDirect3DQuery9 * query9;
116 ID3D10Texture2D *surf10;
117 IDXGISurface * surfdxgi;
118 ID2D1RenderTarget *rendtarget2D;
119 ID3D10Query * query10;
123 std::queue<SurfaceInfo> d2dtod3d;
124 std::queue<SurfaceInfo> d3dtod2d;
125 std::list<SurfaceInfo> allsurfs;
126 SurfaceInfo currentosd_render;
127 SurfaceInfo currentosd_backbuffer;
128 ID2D1RenderTarget * LockOsdDrawing();
129 void UnlockOsdDrawing();
135 ID2D1PathGeometry *std_paths[PIPoint + 1];
137 ID3D10Device1 * d3ddevice10;
138 ID2D1Factory *d2dfactory;
139 IDXGIDevice * dxgidevice;
140 float aspect_correction;