Blender  V2.93
GHOST_SystemSDL.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
22 #pragma once
23 
24 #include "../GHOST_Types.h"
26 #include "GHOST_Event.h"
27 #include "GHOST_System.h"
28 #include "GHOST_TimerManager.h"
29 #include "GHOST_WindowSDL.h"
30 
31 extern "C" {
32 #include "SDL.h"
33 }
34 
35 #if !SDL_VERSION_ATLEAST(2, 0, 0)
36 # error "SDL 2.0 or newer is needed to build with Ghost"
37 #endif
38 
39 class GHOST_WindowSDL;
40 
41 class GHOST_SystemSDL : public GHOST_System {
42  public:
43  void addDirtyWindow(GHOST_WindowSDL *bad_wind);
44 
47 
48  bool processEvents(bool waitForEvent);
49 
50  int toggleConsole(int action)
51  {
52  return 0;
53  }
54 
56 
57  GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const;
58 
59  GHOST_TUns8 *getClipboard(bool selection) const;
60 
61  void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
62 
64 
66 
68 
70 
72 
74 
76 
78 
79  private:
80  GHOST_TSuccess init();
81 
82  GHOST_IWindow *createWindow(const char *title,
89  GHOST_GLSettings glSettings,
90  const bool exclusive = false,
91  const bool is_dialog = false,
92  const GHOST_IWindow *parentWindow = NULL);
93 
94  /* SDL specific */
95  GHOST_WindowSDL *findGhostWindow(SDL_Window *sdl_win);
96 
97  bool generateWindowExposeEvents();
98 
99  void processEvent(SDL_Event *sdl_event);
100 
102  std::vector<GHOST_WindowSDL *> m_dirty_windows;
103 };
GHOST_TWindowState
Definition: GHOST_Types.h:144
unsigned int GHOST_TUns32
Definition: GHOST_Types.h:64
unsigned long long GHOST_TUns64
Definition: GHOST_Types.h:86
int GHOST_TInt32
Definition: GHOST_Types.h:63
GHOST_TDrawingContextType
Definition: GHOST_Types.h:156
char GHOST_TInt8
Definition: GHOST_Types.h:59
GHOST_TSuccess
Definition: GHOST_Types.h:91
unsigned char GHOST_TUns8
Definition: GHOST_Types.h:60
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble top
GHOST_TUns64 getMilliSeconds()
GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)
bool processEvents(bool waitForEvent)
GHOST_IContext * createOffscreenContext(GHOST_GLSettings glSettings)
GHOST_TSuccess disposeContext(GHOST_IContext *context)
void putClipboard(GHOST_TInt8 *buffer, bool selection) const
void addDirtyWindow(GHOST_WindowSDL *bad_wind)
GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const
int toggleConsole(int action)
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const
GHOST_TSuccess getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const
GHOST_TUns8 * getClipboard(bool selection) const
void getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const
void getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const
GHOST_TUns8 getNumDisplays() const
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
static ulong state[N]
static int left
struct SELECTID_Context context
Definition: select_engine.c:47