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, see <https://www.gnu.org/licenses/>.
20 #ifndef OSDWINVECTOR_H
21 #define OSDWINVECTOR_H
28 #include "windowsosd.h"
36 #include "osdvector.h"
38 class OsdWinVector : public OsdVector, public WindowsOsd
40 friend class WICPictDecoder;
48 bool isInitialized() { return initted; }
50 void getScreenSize(int &width, int &height);
51 void getRealScreenSize(int &width, int &height);
53 float getFontHeight();
54 float getCharWidth(wchar_t c);
56 bool screenShotInternal(void *buffer, int width, int height, bool includeOSD);
58 int getFontNames(const char *** names, const char *** names_keys);
60 void setFont(const char * fontname);
62 float getPixelAspect() { return aspect_correction; };
65 LPDIRECT3DTEXTURE9 getNextOsdTexture();
66 void lostDestroyObjects();
67 void lostRecreateObjects();
69 void getTextureCoordinates(FLOAT*, FLOAT*);
71 /*osd vector implementation*/
72 void destroyImageRef(VectorHandleImage index);
73 VectorHandleImage createMonoBitmap(void *base, int width, int height);
74 VectorHandleImage createImagePalette(int width, int height, const unsigned char *image_data, const unsigned int*palette_data);
75 void createPicture(struct PictureInfo& pict_inf);
76 void destroyDrawStyleHandle(VectorHandle index);
77 VectorHandle createDrawStyleHandle(const DrawStyle &c);
78 bool getStaticImageData(unsigned int static_id, UCHAR **userdata, ULONG *length);
81 int loadFont(bool fontchange);
83 std::map<unsigned int, float> font_exp_x;
84 std::vector<char*> fontnames;
85 //vector<char*> fontnames_keys;
86 wchar_t * cur_fontname;
87 bool is_direct_write_initted;
88 IDWriteFactory* dwritefac;
90 IDWriteFontFace* fontface;
93 float fontaspect_corr;
97 unsigned char position;
100 TTIndex loadTTchar(cTeletextChar c);
102 std::map<unsigned int, TTIndex> tt_font_chars;
103 std::vector<ID2D1Bitmap *> tt_atlas;
105 ID2D1SolidColorBrush *ttbrush;
108 void executeDrawCommand(SVGCommand & command);
109 void drawSetTrans(SurfaceInfo & sc);
112 LPDIRECT3DTEXTURE9 surf9;
113 IDirect3DQuery9 * query9;
114 ID3D10Texture2D *surf10;
115 IDXGISurface * surfdxgi;
116 ID2D1RenderTarget *rendtarget2D;
117 ID3D10Query * query10;
121 std::queue<SurfaceInfo> d2dtod3d;
122 std::queue<SurfaceInfo> d3dtod2d;
123 std::list<SurfaceInfo> allsurfs;
124 SurfaceInfo currentosd_render;
125 SurfaceInfo currentosd_backbuffer;
126 ID2D1RenderTarget * LockOsdDrawing();
127 void UnlockOsdDrawing();
129 std::mutex queuemutex;
133 ID2D1PathGeometry *std_paths[PIPoint + 1];
135 ID3D10Device1 * d3ddevice10;
136 ID2D1Factory *d2dfactory;
137 IDXGIDevice * dxgidevice;
138 float aspect_correction;