vdr-plugin-softhddevice-drm-gles 1.6.2
openglosd.h
Go to the documentation of this file.
1// SPDX-License-Identifier: AGPL-3.0-or-later
2
15#ifndef __SOFTHDDEVICE_OPENGLOSD_H
16#define __SOFTHDDEVICE_OPENGLOSD_H
17
18#include <cstdio>
19#include <memory>
20#include <mutex>
21#include <queue>
22
23#include <ft2build.h>
24#include FT_FREETYPE_H
25#include FT_LCD_FILTER_H
26#include FT_STROKER_H
27
28#undef __FTERRORS_H__
29#define FT_ERRORDEF( e, v, s ) { e, s },
30#define FT_ERROR_START_LIST {
31#define FT_ERROR_END_LIST { 0, 0 } };
32const struct {
33 int code;
34 const char* message;
35} FT_Errors[] =
36#include FT_ERRORS_H
37
38#include <GLES2/gl2.h>
39#include <glm/glm.hpp>
40#include <glm/gtc/matrix_transform.hpp>
41
42#include <vdr/osd.h>
43
45class cVideoRender;
46
52#define BORDERCOLOR 0x00000000
53
60
68
75public:
76 cOglShader(void) {};
77
78 bool Load(eShaderType);
79 void Use(void);
80 void SetFloat (const GLchar *, GLfloat);
81 void SetInteger (const GLchar *, GLint);
82 void SetVector2f (const GLchar *, GLfloat, GLfloat);
83 void SetVector3f (const GLchar *, GLfloat, GLfloat, GLfloat);
85 void SetMatrix4 (const GLchar *, const glm::mat4 &);
86
87private:
90
91 bool Compile(const char *, const char *);
92 bool CheckCompileErrors(GLuint, bool program = false);
93};
94
98class cOglGlyph : public cListObject {
99public:
101 virtual ~cOglGlyph();
102
103 FT_ULong CharCode(void) { return m_charCode; }
104 int AdvanceX(void) { return m_advanceX; }
105 int BearingLeft(void) const { return m_bearingLeft; }
106 int BearingTop(void) const { return m_bearingTop; }
107 int Width(void) const { return m_width; }
108 int Height(void) const { return m_height; }
110 void SetKerningCache(FT_ULong, int);
111 void LoadTexture(void);
112 void BindTexture(void);
113protected:
114 struct tKerning {
115 public:
117 this->prevSym = prevSym;
118 this->kerning = kerning;
119 }
122 };
128 unsigned char *m_pBuffer;
132};
133
139class cOglAtlasGlyph : public cOglGlyph {
140public:
146
147 int AdvanceY(void) { return m_advanceY; }
148 float OffsetX(void) const { return m_offsetX; }
149 float OffsetY(void) const { return m_offsetY; }
150private:
154};
155
156#define MIN_CHARCODE 32
157#define MAX_CHARCODE 255
158
172public:
174 virtual ~cOglFontAtlas(void);
175 cOglAtlasGlyph* GetGlyph(int) const;
176 int Height(void) const { return m_height; }
177 int Width(void) const { return m_width; }
178 void BindTexture(void);
179private:
181 int m_width = 0;
182 int m_height = 0;
184};
185
191class cOglFont : public cListObject {
192public:
193 virtual ~cOglFont(void);
194 static cOglFont *Get(const char *, int);
195 cOglFontAtlas *Atlas(void) { return m_pAtlas; };
196 static void Cleanup(void);
197 const char *Name(void) { return *m_name; };
198 int Size(void) { return m_size; };
199 int Bottom(void) {return m_bottom; };
200 int Height(void) {return m_height; };
201 cOglGlyph* Glyph(FT_ULong) const;
202 int Kerning(cOglGlyph *glyph, FT_ULong prevSym) const;
203private:
204 static bool s_initiated;
207
210 int m_height = 0;
211 int m_bottom = 0;
215
216 cOglFont(const char *, int);
217 static void Init(void);
218};
219
225class cOglFb {
226public:
228 virtual ~cOglFb(void);
229
230 bool Initiated(void) { return m_initiated; }
231 virtual bool Init(void);
232 void Bind(void);
233 virtual void Unbind(void);
234 bool BindTexture(void);
236 GLint Width(void) { return m_width; };
237 GLint Height(void) { return m_height; };
238 bool Scrollable(void) { return m_scrollable; };
241protected:
242 bool m_initiated = false;
244private:
248 bool m_scrollable = false;
249};
250
256class cOglOutputFb : public cOglFb {
257public:
258 cOglOutputFb(GLint width, GLint height) : cOglFb(width, height, width, height) {};
259
260 virtual bool Init(void);
261 virtual void Unbind(void);
262private:
265};
266
276
282class cOglVb {
283public:
284 cOglVb(int type) : m_type((eVertexBufferType)type) {};
285 virtual ~cOglVb(void) {};
286
287 bool Init(void);
288 void Bind(void);
289 void Unbind(void);
290 void ActivateShader(void);
291 void EnableBlending(void);
292 void DisableBlending(void);
293 void SetShaderColor(GLint);
296 void SetShaderAlpha(GLint);
298 void SetVertexSubData(GLfloat *, int count = 0);
299 void SetVertexData(GLfloat *, int count = 0);
300 void DrawArrays(int count = 0);
301private:
312};
313
320class cOglCmd {
321public:
324 virtual ~cOglCmd(void) {};
325 virtual const char* Description(void) = 0;
326 virtual bool Execute(void) = 0;
327 virtual bool NeedsLockingAgainstStateChange(void) { return false; };
328protected:
330};
331
333public:
337 virtual ~cOglCmdInitOutputFb(void) {};
338 virtual const char* Description(void) { return "InitOutputFramebuffer"; }
339 virtual bool Execute(void);
340private:
342};
343
344class cOglCmdInitFb : public cOglCmd {
345public:
349 virtual ~cOglCmdInitFb(void) {};
350 virtual const char* Description(void) { return "InitFramebuffer"; }
351 virtual bool Execute(void);
352private:
354};
355
356class cOglCmdDeleteFb : public cOglCmd {
357public:
360 virtual ~cOglCmdDeleteFb(void) {};
361 virtual const char* Description(void) { return "DeleteFramebuffer"; }
362 virtual bool Execute(void);
363};
364
396
398public:
400 : cOglCmd(fb),
402 m_x((GLfloat)x),
403 m_y((GLfloat)y),
405 m_active(active),
406 m_pDevice(device) {};
408 virtual const char* Description(void) { return "Copy buffer to OutputFramebuffer"; }
409 virtual bool Execute(void);
410 bool NeedsLockingAgainstStateChange(void) { return true; };
411private:
417};
418
419class cOglCmdFill : public cOglCmd {
420public:
424 virtual ~cOglCmdFill(void) {};
425 virtual const char* Description(void) { return "Fill"; }
426 virtual bool Execute(void);
427private:
429};
430
432public:
436 virtual ~cOglCmdBufferFill(void) {};
437 virtual const char* Description(void) { return "Fill Buffer "; }
438 virtual bool Execute(void);
439private:
441};
442
444public:
446 : cOglCmd(fb),
447 m_x(x),
448 m_y(y),
449 m_width(width),
450 m_height(height),
451 m_color(color) {};
452 virtual ~cOglCmdDrawRectangle(void) {};
453 virtual const char* Description(void) { return "DrawRectangle"; }
454 virtual bool Execute(void);
455private:
459};
460
462public:
464 : cOglCmd(fb),
465 m_x(x),
466 m_y(y),
467 m_width(width),
468 m_height(height),
469 m_color(color),
471 virtual ~cOglCmdDrawEllipse(void) {};
472 virtual const char* Description(void) { return "DrawEllipse "; }
473 virtual bool Execute(void);
474private:
479
483};
484
485class cOglCmdDrawSlope : public cOglCmd {
486public:
488 : cOglCmd(fb),
489 m_x(x),
490 m_y(y),
491 m_width(width),
492 m_height(height),
493 m_color(color),
494 m_type(type) {};
495 virtual ~cOglCmdDrawSlope(void) {};
496 virtual const char* Description(void) { return "DrawSlope "; }
497 virtual bool Execute(void);
498private:
503};
504
505class cOglCmdDrawText : public cOglCmd {
506public:
507 cOglCmdDrawText(cOglFb *fb, GLint x, GLint y, unsigned int *symbols, GLint limitX, const char *name, int fontSize, tColor colorText, int length)
508 : cOglCmd(fb),
509 m_x(x),
510 m_y(y),
514 m_fontName(name),
517 virtual ~cOglCmdDrawText(void) { free(m_pSymbols); };
518 virtual const char* Description(void) { return "DrawText "; }
519 virtual bool Execute(void);
520private:
527 unsigned int *m_pSymbols;
528};
529
530class cOglCmdDrawImage : public cOglCmd {
531public:
532 cOglCmdDrawImage(cOglFb *fb, tColor *argb, GLint width, GLint height, GLint x, GLint y, bool overlay = true, double scaleX = 1.0f, double scaleY = 1.0f)
533 : cOglCmd(fb),
534 m_argb(argb),
535 m_x(x),
536 m_y(y),
537 m_width(width),
538 m_height(height),
543 virtual ~cOglCmdDrawImage(void) { free(m_argb); };
544 virtual const char* Description(void) { return "Draw Image"; }
545 virtual bool Execute(void);
546private:
552};
553
555public:
556 cOglCmdDrawTexture(cOglFb *fb, sOglImage *imageRef, GLint x, GLint y, double scaleX = 1.0f, double scaleY = 1.0f)
557 : cOglCmd(fb),
559 m_x(x),
560 m_y(y),
564 virtual ~cOglCmdDrawTexture(void) {};
565 virtual const char* Description(void) { return "Draw Texture"; }
566 virtual bool Execute(void);
567private:
572};
573
575public:
580 virtual ~cOglCmdStoreImage(void) { free(m_pData); };
581 virtual const char* Description(void) { return "Store Image"; }
582 virtual bool Execute(void);
583private:
586};
587
588class cOglCmdDropImage : public cOglCmd {
589public:
594 virtual ~cOglCmdDropImage(void) {};
595 virtual const char* Description(void) { return "Drop Image"; }
596 virtual bool Execute(void);
597private:
600};
601
602#define OGL_MAX_OSDIMAGES 512
603#define OGL_CMDQUEUE_SIZE 200
604
617class cOglThread : public cThread {
618public:
620 virtual ~cOglThread(void) {};
621
622 void RequestStop(void);
623 void Stop(void);
624 void DoCmd(cOglCmd*);
625 int StoreImage(const cImage &);
626 void DropImageData(int);
628 int MaxTextureSize(void) { return m_maxTextureSize; };
629 void LockOutputFb(void) { m_mutex.lock(); };
630 void UnlockOutputFb(void) { m_mutex.unlock(); };
631protected:
632 virtual void Action(void);
633private:
636 bool m_stalled = false;
637 std::queue<cOglCmd*> m_commands;
640 long m_memCached = 0;
643 std::mutex m_mutex;
644
645 bool InitOpenGL(void);
646 bool InitShaders(void);
647 void DeleteShaders(void);
648 bool InitVertexBuffers(void);
649 void DeleteVertexBuffers(void);
650 void Cleanup(void);
651 void CleanupImageCache(void);
652 int GetFreeSlot(void);
653 void ClearSlot(int slot);
654 void eglAcquireContext(void);
655};
656
660class cOglPixmap : public cPixmap {
661public:
662 cOglPixmap(std::shared_ptr<cOglThread>, int, const cRect &, const cRect &DrawPort = cRect::Null);
663 virtual ~cOglPixmap(void);
664
666 int X(void) { return ViewPort().X(); };
667 int Y(void) { return ViewPort().Y(); };
668 virtual bool IsDirty(void) { return m_dirty; }
669 virtual void SetDirty(bool dirty = true) { m_dirty = dirty; }
670 virtual void SetLayer(int);
671 virtual void SetAlpha(int);
672 virtual void SetTile(bool);
673 virtual void SetViewPort(const cRect &);
674 virtual void SetDrawPortPoint(const cPoint &, bool Dirty = true);
675 virtual void Clear(void);
676 virtual void Fill(tColor);
677 virtual void DrawImage(const cPoint &, const cImage &);
678 virtual void DrawImage(const cPoint &, int);
679 virtual void DrawScaledImage(const cPoint &, const cImage &, double FactorX = 1.0f, double FactorY = 1.0f, bool AntiAlias = false);
680 virtual void DrawScaledImage(const cPoint &, int, double FactorX = 1.0f, double FactorY = 1.0f, bool AntiAlias = false);
681 virtual void DrawPixel(const cPoint &, tColor);
682 virtual void DrawBitmap(const cPoint &, const cBitmap &, tColor ColorFg = 0, tColor ColorBg = 0, bool Overlay = false);
683 virtual void DrawText(const cPoint &, const char *, tColor, tColor, const cFont *, int Width = 0, int Height = 0, int Alignment = taDefault);
684 virtual void DrawRectangle(const cRect &, tColor);
685 virtual void DrawEllipse(const cRect &, tColor, int Quadrants = 0);
686 virtual void DrawSlope(const cRect &, tColor, int);
687 virtual void Render(const cPixmap *, const cRect &, const cPoint &);
688 virtual void Copy(const cPixmap *, const cRect &, const cPoint &);
689 virtual void Scroll(const cPoint &, const cRect &Source = cRect::Null);
690 virtual void Pan(const cPoint &, const cRect &Source = cRect::Null);
691 virtual void MarkViewPortDirty(const cRect &);
692 virtual void SetClean(void);
693private:
695 std::shared_ptr<cOglThread> m_pOglThread;
696 bool m_dirty = true;
697#ifdef GRIDPOINTS
699
700 void DrawGridRect(const cRect &, int, int, tColor, tColor, const cFont *);
701 void DrawGridText(const cPoint &, const char *, tColor, tColor, const cFont *, int Width = 0, int Height = 0, int Alignment = taDefault);
702#endif
703 void DrawTextInternal(const cPoint &, const char *, tColor, tColor, const cFont *, int Width = 0, int Height = 0, int Alignment = taDefault, bool isGridText = false);
704};
705
709class cOglOsd : public cOsd {
710public:
711 cOglOsd(int, int, uint, std::shared_ptr<cOglThread>, cSoftHdDevice *);
712 virtual ~cOglOsd();
713
714 virtual eOsdError SetAreas(const tArea *, int);
715 virtual cPixmap *CreatePixmap(int, const cRect &, const cRect &DrawPort = cRect::Null);
716 virtual void DestroyPixmap(cPixmap *);
717 virtual void Flush(void);
718 virtual const cSize &MaxPixmapSize(void) const { return m_maxPixmapSize; };
719 virtual void DrawScaledBitmap(int, int, const cBitmap &, double, double, bool AntiAlias = false);
720
722private:
725 std::shared_ptr<cOglThread> m_pOglThread;
731};
732
735#endif
Glyph on a Texture Atlas.
Definition openglosd.h:139
float OffsetY(void) const
Definition openglosd.h:149
int AdvanceY(void)
Definition openglosd.h:147
float OffsetX(void) const
Definition openglosd.h:148
cOglAtlasGlyph(FT_ULong charCode, FT_BitmapGlyph ftGlyph, float offsetX, float offsetY)
Definition openglosd.h:141
virtual ~cOglCmdBufferFill(void)
Definition openglosd.h:436
cOglCmdBufferFill(cOglFb *fb, GLint color)
Definition openglosd.h:433
virtual const char * Description(void)
Definition openglosd.h:437
virtual const char * Description(void)
Definition openglosd.h:408
cOglOutputFb * m_pOutputFramebuffer
Definition openglosd.h:412
virtual ~cOglCmdCopyBufferToOutputFb(void)
Definition openglosd.h:407
bool NeedsLockingAgainstStateChange(void)
Definition openglosd.h:410
cOglCmdCopyBufferToOutputFb(cOglFb *fb, cOglOutputFb *oFb, GLint x, GLint y, int active, cSoftHdDevice *device)
Definition openglosd.h:399
cSoftHdDevice * m_pDevice
Definition openglosd.h:416
virtual ~cOglCmdDeleteFb(void)
Definition openglosd.h:360
virtual const char * Description(void)
Definition openglosd.h:361
cOglCmdDeleteFb(cOglFb *fb)
Definition openglosd.h:358
virtual ~cOglCmdDrawEllipse(void)
Definition openglosd.h:471
virtual const char * Description(void)
Definition openglosd.h:472
cOglCmdDrawEllipse(cOglFb *fb, GLint x, GLint y, GLint width, GLint height, GLint color, GLint quadrants)
Definition openglosd.h:463
virtual ~cOglCmdDrawImage(void)
Definition openglosd.h:543
virtual const char * Description(void)
Definition openglosd.h:544
cOglCmdDrawImage(cOglFb *fb, tColor *argb, GLint width, GLint height, GLint x, GLint y, bool overlay=true, double scaleX=1.0f, double scaleY=1.0f)
Definition openglosd.h:532
tColor * m_argb
Definition openglosd.h:547
cOglCmdDrawRectangle(cOglFb *fb, GLint x, GLint y, GLint width, GLint height, GLint color)
Definition openglosd.h:445
virtual ~cOglCmdDrawRectangle(void)
Definition openglosd.h:452
virtual const char * Description(void)
Definition openglosd.h:453
virtual const char * Description(void)
Definition openglosd.h:496
virtual ~cOglCmdDrawSlope(void)
Definition openglosd.h:495
cOglCmdDrawSlope(cOglFb *fb, GLint x, GLint y, GLint width, GLint height, GLint color, GLint type)
Definition openglosd.h:487
cOglCmdDrawText(cOglFb *fb, GLint x, GLint y, unsigned int *symbols, GLint limitX, const char *name, int fontSize, tColor colorText, int length)
Definition openglosd.h:507
cString m_fontName
Definition openglosd.h:525
unsigned int * m_pSymbols
Definition openglosd.h:527
virtual ~cOglCmdDrawText(void)
Definition openglosd.h:517
virtual const char * Description(void)
Definition openglosd.h:518
virtual const char * Description(void)
Definition openglosd.h:565
virtual ~cOglCmdDrawTexture(void)
Definition openglosd.h:564
sOglImage * m_pImageRef
Definition openglosd.h:568
cOglCmdDrawTexture(cOglFb *fb, sOglImage *imageRef, GLint x, GLint y, double scaleX=1.0f, double scaleY=1.0f)
Definition openglosd.h:556
virtual ~cOglCmdDropImage(void)
Definition openglosd.h:594
cOglCmdDropImage(sOglImage *imageRef, cCondWait *wait)
Definition openglosd.h:590
virtual const char * Description(void)
Definition openglosd.h:595
sOglImage * m_pImageRef
Definition openglosd.h:598
cCondWait * m_pWait
Definition openglosd.h:599
virtual const char * Description(void)
Definition openglosd.h:425
cOglCmdFill(cOglFb *fb, GLint color)
Definition openglosd.h:421
GLint m_color
Definition openglosd.h:428
virtual ~cOglCmdFill(void)
Definition openglosd.h:424
virtual ~cOglCmdInitFb(void)
Definition openglosd.h:349
cOglCmdInitFb(cOglFb *fb, cCondWait *wait=NULL)
Definition openglosd.h:346
virtual const char * Description(void)
Definition openglosd.h:350
cCondWait * m_wait
Definition openglosd.h:353
virtual const char * Description(void)
Definition openglosd.h:338
cOglCmdInitOutputFb(cOglOutputFb *oFb)
Definition openglosd.h:334
cOglOutputFb * m_pOutputFramebuffer
Definition openglosd.h:341
virtual ~cOglCmdInitOutputFb(void)
Definition openglosd.h:337
virtual ~cOglCmdRenderFbToBufferFb(void)
Definition openglosd.h:381
virtual const char * Description(void)
Definition openglosd.h:382
cOglCmdRenderFbToBufferFb(cOglFb *fb, cOglFb *buffer, GLint x, GLint y, GLint transparency, GLint drawPortX, GLint drawPortY, GLint dirtyX, GLint dirtyTop, GLint dirtyWidth, GLint dirtyHeight, bool alphablending)
Definition openglosd.h:367
sOglImage * m_pImageRef
Definition openglosd.h:584
cOglCmdStoreImage(sOglImage *imageRef, tColor *argb)
Definition openglosd.h:576
virtual ~cOglCmdStoreImage(void)
Definition openglosd.h:580
virtual const char * Description(void)
Definition openglosd.h:581
OpenGL Hardware Command.
Definition openglosd.h:320
cOglFb * m_pFramebuffer
Definition openglosd.h:329
virtual bool NeedsLockingAgainstStateChange(void)
Definition openglosd.h:327
virtual bool Execute(void)=0
virtual ~cOglCmd(void)
Definition openglosd.h:324
virtual const char * Description(void)=0
cOglCmd(cOglFb *fb)
Definition openglosd.h:322
OpenGL Framebuffer/ Texture Object.
Definition openglosd.h:225
GLint m_width
Definition openglosd.h:243
GLuint m_framebuffer
Definition openglosd.h:245
GLint ViewportHeight(void)
Definition openglosd.h:240
GLuint m_texture
Definition openglosd.h:246
GLint m_viewPortWidth
Definition openglosd.h:247
GLint Height(void)
Definition openglosd.h:237
void Blit(GLint, GLint, GLint, GLint)
GLint ViewportWidth(void)
Definition openglosd.h:239
GLint Width(void)
Definition openglosd.h:236
bool m_scrollable
Definition openglosd.h:248
bool Scrollable(void)
Definition openglosd.h:238
bool Initiated(void)
Definition openglosd.h:230
GLint m_height
Definition openglosd.h:243
GLint m_viewPortHeight
Definition openglosd.h:247
bool m_initiated
Definition openglosd.h:242
Texture Atlas for a Font.
Definition openglosd.h:171
GLuint m_texture
Definition openglosd.h:180
int Width(void) const
Definition openglosd.h:177
int Height(void) const
Definition openglosd.h:176
cOglAtlasGlyph * m_pGlyph[MAX_CHARCODE - MIN_CHARCODE+1]
Definition openglosd.h:183
OpenGL Representation of a VDR Font.
Definition openglosd.h:191
int Height(void)
Definition openglosd.h:200
int m_size
Definition openglosd.h:209
cString m_name
Definition openglosd.h:208
cOglFontAtlas * Atlas(void)
Definition openglosd.h:195
int Bottom(void)
Definition openglosd.h:199
FT_Face m_face
Definition openglosd.h:212
int Size(void)
Definition openglosd.h:198
cOglFontAtlas * m_pAtlas
Definition openglosd.h:214
cList< cOglGlyph > m_glyphCache
Definition openglosd.h:213
int m_bottom
Definition openglosd.h:211
int m_height
Definition openglosd.h:210
const char * Name(void)
Definition openglosd.h:197
Single Glyph of a Font.
Definition openglosd.h:98
int AdvanceX(void)
Definition openglosd.h:104
int m_advanceX
Definition openglosd.h:129
GLuint m_texture
Definition openglosd.h:131
FT_ULong m_charCode
Definition openglosd.h:123
unsigned char * m_pBuffer
Definition openglosd.h:128
int BearingTop(void) const
Definition openglosd.h:106
int Height(void) const
Definition openglosd.h:108
int m_bearingTop
Definition openglosd.h:125
int BearingLeft(void) const
Definition openglosd.h:105
int Width(void) const
Definition openglosd.h:107
FT_ULong CharCode(void)
Definition openglosd.h:103
int m_height
Definition openglosd.h:127
int m_bearingLeft
Definition openglosd.h:124
cVector< tKerning > m_pKerningCache
Definition openglosd.h:130
int m_width
Definition openglosd.h:126
Hardware Accelerated OpenGL OSD Implementation.
Definition openglosd.h:709
std::shared_ptr< cOglThread > m_pOglThread
pointer to thread, which executes the commands
Definition openglosd.h:725
bool m_isSubtitleOsd
true, if this is a subtitle osd
Definition openglosd.h:727
cSoftHdDevice * m_pDevice
pointer to cSofthdDevice
Definition openglosd.h:730
cOglFb * m_pBufferFramebuffer
all pixmaps are composed onto this framebuffer after each other, before this one is blit onto the OSD...
Definition openglosd.h:723
cRect m_pDirtyViewport
the dirty viewport
Definition openglosd.h:729
virtual const cSize & MaxPixmapSize(void) const
Definition openglosd.h:718
cVector< cOglPixmap * > m_pOglPixmaps
array of pixmaps
Definition openglosd.h:726
cSize m_maxPixmapSize
maximum allowed size of a pixmap (depends on the maximum OpenGL texture size)
Definition openglosd.h:728
Main Framebuffer/ Texture Object for OSD.
Definition openglosd.h:256
GLuint m_framebuffer
Definition openglosd.h:263
GLuint m_texture
Definition openglosd.h:264
cOglOutputFb(GLint width, GLint height)
Definition openglosd.h:258
OpenGL Implementation of a cPixmap.
Definition openglosd.h:660
int X(void)
Definition openglosd.h:666
virtual bool IsDirty(void)
Definition openglosd.h:668
cOglFb * m_pFramebuffer
everything is drawn onto this framebuffer (one per pixmap)
Definition openglosd.h:694
std::shared_ptr< cOglThread > m_pOglThread
Definition openglosd.h:695
int Y(void)
Definition openglosd.h:667
cOglFb * Framebuffer(void)
Definition openglosd.h:665
virtual void SetDirty(bool dirty=true)
Definition openglosd.h:669
virtual void DrawScaledImage(const cPoint &, int, double FactorX=1.0f, double FactorY=1.0f, bool AntiAlias=false)
bool m_dirty
true, if there was draw activity on the pixmap
Definition openglosd.h:696
virtual void DrawScaledImage(const cPoint &, const cImage &, double FactorX=1.0f, double FactorY=1.0f, bool AntiAlias=false)
Vertex/Fragment Shader.
Definition openglosd.h:74
cOglShader(void)
Definition openglosd.h:76
GLuint m_id
Definition openglosd.h:89
eShaderType m_type
Definition openglosd.h:88
OpenGL Commands Processing Thread.
Definition openglosd.h:617
long m_memCached
Definition openglosd.h:640
long m_maxCacheSize
Definition openglosd.h:641
bool m_stalled
Definition openglosd.h:636
sOglImage m_imageCache[OGL_MAX_OSDIMAGES]
Definition openglosd.h:639
void UnlockOutputFb(void)
Definition openglosd.h:630
void LockOutputFb(void)
Definition openglosd.h:629
virtual ~cOglThread(void)
Definition openglosd.h:620
cCondWait * m_startWait
Definition openglosd.h:634
cCondWait m_wait
Definition openglosd.h:635
cVideoRender * m_pRender
Definition openglosd.h:642
int MaxTextureSize(void)
Definition openglosd.h:628
std::mutex m_mutex
Definition openglosd.h:643
GLint m_maxTextureSize
Definition openglosd.h:638
std::queue< cOglCmd * > m_commands
Definition openglosd.h:637
Vertex Buffers.
Definition openglosd.h:282
int m_sizeVertex2
Definition openglosd.h:309
GLuint m_positionLoc
Definition openglosd.h:306
virtual ~cOglVb(void)
Definition openglosd.h:285
eVertexBufferType m_type
Definition openglosd.h:302
int m_sizeVertex1
Definition openglosd.h:308
int m_numVertices
Definition openglosd.h:310
eShaderType m_shader
Definition openglosd.h:303
GLuint m_vao
Definition openglosd.h:304
GLuint m_texCoordsLoc
Definition openglosd.h:307
GLuint m_vbo
Definition openglosd.h:305
cOglVb(int type)
Definition openglosd.h:284
GLuint m_drawMode
Definition openglosd.h:311
Output Device Implementation.
Video Renderer.
virtual ~cOglOsd()
void DoCmd(cOglCmd *)
void BindTexture(void)
virtual bool Execute(void)
#define OGL_MAX_OSDIMAGES
Definition openglosd.h:602
static void Cleanup(void)
virtual void Unbind(void)
virtual void Clear(void)
bool CheckCompileErrors(GLuint, bool program=false)
virtual void SetClean(void)
void EnableBlending(void)
virtual void Unbind(void)
virtual bool Execute(void)
#define BORDERCOLOR
This is needed for the GLES2 GL_CLAMP_TO_BORDER workaround.
Definition openglosd.h:52
virtual bool Execute(void)
cOglGlyph * Glyph(FT_ULong) const
virtual void DrawRectangle(const cRect &, tColor)
static cOglOutputFb * OutputFramebuffer
main OSD output framebuffer - this keeps our finished "OSD" (one per OSD)
Definition openglosd.h:721
static void Init(void)
bool InitOpenGL(void)
bool InitVertexBuffers(void)
#define MIN_CHARCODE
Definition openglosd.h:156
virtual bool Execute(void)
virtual void Pan(const cPoint &, const cRect &Source=cRect::Null)
virtual bool Execute(void)
virtual bool Execute(void)
void CleanupImageCache(void)
void LoadTexture(void)
void SetMatrix4(const GLchar *, const glm::mat4 &)
virtual void DrawPixel(const cPoint &, tColor)
void DrawTextInternal(const cPoint &, const char *, tColor, tColor, const cFont *, int Width=0, int Height=0, int Alignment=taDefault, bool isGridText=false)
eShaderType
Definition openglosd.h:61
virtual void DrawImage(const cPoint &, const cImage &)
void SetVector4f(const GLchar *, GLfloat, GLfloat, GLfloat, GLfloat)
virtual ~cOglPixmap(void)
void Bind(void)
eVertexBufferType
Definition openglosd.h:267
int GetFreeSlot(void)
static cOglFont * Get(const char *, int)
virtual void Flush(void)
void Use(void)
Definition openglosd.cpp:78
GLfloat * CreateVerticesFull(int &)
virtual ~cOglFont(void)
GLfloat * CreateVerticesHalf(int &)
virtual bool Execute(void)
GLfloat * CreateVerticesQuadrant(int &)
void SetFloat(const GLchar *, GLfloat)
void SetKerningCache(FT_ULong, int)
void SetInteger(const GLchar *, GLint)
void SetShaderColor(GLint)
virtual eOsdError SetAreas(const tArea *, int)
void Stop(void)
bool InitShaders(void)
int Kerning(cOglGlyph *glyph, FT_ULong prevSym) const
virtual void DrawSlope(const cRect &, tColor, int)
virtual void DrawText(const cPoint &, const char *, tColor, tColor, const cFont *, int Width=0, int Height=0, int Alignment=taDefault)
virtual ~cOglFb(void)
void SetShaderTexture(GLint)
virtual bool Execute(void)
void DisableBlending(void)
#define MAX_CHARCODE
Definition openglosd.h:157
void SetVertexSubData(GLfloat *, int count=0)
virtual ~cOglGlyph()
virtual void SetTile(bool)
void SetVector3f(const GLchar *, GLfloat, GLfloat, GLfloat)
void Bind(void)
virtual void DrawScaledBitmap(int, int, const cBitmap &, double, double, bool AntiAlias=false)
void SetShaderProjectionMatrix(GLint, GLint)
virtual bool Execute(void)
virtual void MarkViewPortDirty(const cRect &)
virtual void Scroll(const cPoint &, const cRect &Source=cRect::Null)
bool Load(eShaderType)
Definition openglosd.cpp:83
void SetVertexData(GLfloat *, int count=0)
virtual bool Execute(void)
void DropImageData(int)
cOglAtlasGlyph * GetGlyph(int) const
void Cleanup(void)
void DeleteShaders(void)
virtual bool Execute(void)
void DrawArrays(int count=0)
virtual void Action(void)
virtual ~cOglFontAtlas(void)
void ActivateShader(void)
virtual bool Init(void)
void ClearSlot(int slot)
bool BindTexture(void)
virtual bool Execute(void)
void RequestStop(void)
int StoreImage(const cImage &)
bool Compile(const char *, const char *)
virtual cPixmap * CreatePixmap(int, const cRect &, const cRect &DrawPort=cRect::Null)
virtual void SetLayer(int)
void SetVector2f(const GLchar *, GLfloat, GLfloat)
virtual void Fill(tColor)
sOglImage * GetImageRef(int)
void SetShaderAlpha(GLint)
int GetKerningCache(FT_ULong)
virtual bool Execute(void)
static bool s_initiated
Definition openglosd.h:204
bool Init(void)
virtual void SetDrawPortPoint(const cPoint &, bool Dirty=true)
virtual void DrawBitmap(const cPoint &, const cBitmap &, tColor ColorFg=0, tColor ColorBg=0, bool Overlay=false)
static FT_Library s_ftLib
Definition openglosd.h:205
void DeleteVertexBuffers(void)
void BindTexture(void)
void Unbind(void)
virtual bool Init(void)
virtual void Render(const cPixmap *, const cRect &, const cPoint &)
virtual void Copy(const cPixmap *, const cRect &, const cPoint &)
virtual void DrawEllipse(const cRect &, tColor, int Quadrants=0)
virtual void SetAlpha(int)
virtual void SetViewPort(const cRect &)
virtual bool Execute(void)
void SetShaderBorderColor(GLint)
virtual void DestroyPixmap(cPixmap *)
void eglAcquireContext(void)
static cList< cOglFont > * s_pFonts
Definition openglosd.h:206
virtual bool Execute(void)
@ stText
Definition openglosd.h:65
@ stCount
Definition openglosd.h:66
@ stTextureSwapBR
Definition openglosd.h:64
@ stRect
Definition openglosd.h:62
@ stTexture
Definition openglosd.h:63
@ vbSlope
Definition openglosd.h:270
@ vbCount
Definition openglosd.h:274
@ vbText
Definition openglosd.h:273
@ vbTexture
Definition openglosd.h:271
@ vbEllipse
Definition openglosd.h:269
@ vbRect
Definition openglosd.h:268
@ vbTextureSwapBR
Definition openglosd.h:272
const char * message
Definition openglosd.h:34
const struct @0 FT_Errors[]
int code
Definition openglosd.h:33
tKerning(FT_ULong prevSym, GLfloat kerning=0.0f)
Definition openglosd.h:116
GLint height
Definition openglosd.h:57
bool used
Definition openglosd.h:58
GLint width
Definition openglosd.h:56
GLuint texture
Definition openglosd.h:55