Guiliani  Version 2.5 revision 7293 (documentation build 13)
GfxEnvSDL2.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef __GFXENVSDL2_H__
11#define __GFXENVSDL2_H__
12
13#include "GUIRect.h"
14#include "GfxEnv.h"
15
16#include <SDL.h>
17#include <SDL_opengl.h>
18
20
26class CGfxEnvSDL2 : public CGfxEnv
27{
28public:
38 static eC_Bool CreateInstance(
39 const SurfaceMode_t& eSurfaceMode,
40 const CGUICommonEnums::ImageType_t& eScreenFormat,
41 const eC_UInt& uiWidth,
42 const eC_UInt& uiHeight,
43 const eC_UInt& uiBufferCount = 1,
44 const eC_Bool& bResizable = false);
45
46protected:
56 const SurfaceMode_t& eSurfaceMode,
57 const CGUICommonEnums::ImageType_t& eScreenFormat,
58 const eC_UInt& uiWidth,
59 const eC_UInt& uiHeight,
60 const eC_UInt& uiBufferCount = 1,
61 const eC_Bool& bResizable = false);
62
65 virtual ~CGfxEnvSDL2();
66
67protected:
68 virtual void SetScreenSize(
69 const eC_UInt& uiWidth,
70 const eC_UInt& uiHeight);
71
72 virtual eC_Bool IsCreated() const;
73
74 virtual eC_UInt GetWidth() const;
75
76 virtual eC_UInt GetHeight() const;
77
78 virtual void EndOfRefresh();
79
80 virtual void** GetFrameBuffers() const;
81
82 virtual void SetWindowCaption(const eC_String& kCaption);
83
84 virtual eC_Bool SwapBuffers();
85
86protected:
88 SDL_Window* m_pkSDLWindow;
90 SDL_GLContext m_pkGLContext;
92 SDL_Renderer* m_pkSDLRenderer;
96 SDL_Texture* m_pkSDLTexture;
97
98private:
99 void CreateScreen();
100
104 CGfxEnvSDL2(const CGfxEnvSDL2& kSource);
105
109 CGfxEnvSDL2& operator=(const CGfxEnvSDL2& kSource);
110
111private:
112 eC_UInt m_uiFlags;
113 int m_iSDLSurfaceBitsPerPixel;
114};
115#endif
ImageType_t
Definition: GUICommonEnums.h:80
Definition: GfxEnv.h:53
SurfaceMode_t
Definition: GfxEnv.h:60
Implements SDL2-specific features.
Definition: GfxEnvSDL2.h:27
virtual eC_Bool IsCreated() const
virtual void EndOfRefresh()
virtual eC_UInt GetHeight() const
SDL_GLContext m_pkGLContext
this is used as the context for OpenGL
Definition: GfxEnvSDL2.h:90
virtual ~CGfxEnvSDL2()
SDL_Window * m_pkSDLWindow
main-window
Definition: GfxEnvSDL2.h:88
CGfxEnvSDL2(const SurfaceMode_t &eSurfaceMode, const CGUICommonEnums::ImageType_t &eScreenFormat, const eC_UInt &uiWidth, const eC_UInt &uiHeight, const eC_UInt &uiBufferCount=1, const eC_Bool &bResizable=false)
SDL_Texture * m_pkSDLTexture
the texture used for framebuffer-access
Definition: GfxEnvSDL2.h:96
SDL_Renderer * m_pkSDLRenderer
main-renderer needed for framebuffer-access
Definition: GfxEnvSDL2.h:92
SDL_Surface * m_pkSDLFramebufferSurface
the surface used for framebuffer-access
Definition: GfxEnvSDL2.h:94
virtual eC_UInt GetWidth() const
virtual void SetScreenSize(const eC_UInt &uiWidth, const eC_UInt &uiHeight)
static eC_Bool CreateInstance(const SurfaceMode_t &eSurfaceMode, const CGUICommonEnums::ImageType_t &eScreenFormat, const eC_UInt &uiWidth, const eC_UInt &uiHeight, const eC_UInt &uiBufferCount=1, const eC_Bool &bResizable=false)
virtual void ** GetFrameBuffers() const
virtual eC_Bool SwapBuffers()
virtual void SetWindowCaption(const eC_String &kCaption)