Add debug overlay for SDL renderer
This commit is contained in:
parent
4dac57cf8c
commit
46bd8ad83d
5 changed files with 113 additions and 11 deletions
|
|
@ -2,24 +2,31 @@
|
|||
|
||||
#include "renderer.h"
|
||||
|
||||
#include <SDL_ttf.h>
|
||||
|
||||
class SdlRenderer : public IFFmpegRenderer {
|
||||
public:
|
||||
SdlRenderer();
|
||||
virtual ~SdlRenderer();
|
||||
virtual ~SdlRenderer() override;
|
||||
virtual bool initialize(SDL_Window* window,
|
||||
int videoFormat,
|
||||
int width,
|
||||
int height,
|
||||
int maxFps,
|
||||
bool enableVsync);
|
||||
virtual bool prepareDecoderContext(AVCodecContext* context);
|
||||
virtual void renderFrameAtVsync(AVFrame* frame);
|
||||
virtual bool needsTestFrame();
|
||||
virtual int getDecoderCapabilities();
|
||||
virtual FramePacingConstraint getFramePacingConstraint();
|
||||
bool enableVsync) override;
|
||||
virtual bool prepareDecoderContext(AVCodecContext* context) override;
|
||||
virtual void renderFrameAtVsync(AVFrame* frame) override;
|
||||
virtual bool needsTestFrame() override;
|
||||
virtual int getDecoderCapabilities() override;
|
||||
virtual FramePacingConstraint getFramePacingConstraint() override;
|
||||
virtual void notifyOverlayUpdated(Overlay::OverlayType) override;
|
||||
|
||||
private:
|
||||
SDL_Renderer* m_Renderer;
|
||||
SDL_Texture* m_Texture;
|
||||
TTF_Font* m_DebugOverlayFont;
|
||||
SDL_Surface* m_DebugOverlaySurface;
|
||||
SDL_Texture* m_DebugOverlayTexture;
|
||||
SDL_Rect m_DebugOverlayRect;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue