src/video/raspberry/SDL_rpivideo.c
author Ryan C. Gordon <icculus@icculus.org>
Tue, 19 Feb 2019 23:46:54 -0500
changeset 12615 6f0eb21dd7d1
parent 12503 806492103856
permissions -rw-r--r--
raspberry: expose second display.

This lets apps see and choose between both an HDMI and DSI-connected display,
such as a television and the Pi Foundation's official touchscreen. It only
exposes the second display if the hardware reports that it is connected.
gabomdq@7753
     1
/*
gabomdq@7753
     2
  Simple DirectMedia Layer
slouken@12503
     3
  Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
gabomdq@7753
     4
gabomdq@7753
     5
  This software is provided 'as-is', without any express or implied
gabomdq@7753
     6
  warranty.  In no event will the authors be held liable for any damages
gabomdq@7753
     7
  arising from the use of this software.
gabomdq@7753
     8
gabomdq@7753
     9
  Permission is granted to anyone to use this software for any purpose,
gabomdq@7753
    10
  including commercial applications, and to alter it and redistribute it
gabomdq@7753
    11
  freely, subject to the following restrictions:
gabomdq@7753
    12
gabomdq@7753
    13
  1. The origin of this software must not be misrepresented; you must not
gabomdq@7753
    14
     claim that you wrote the original software. If you use this software
gabomdq@7753
    15
     in a product, an acknowledgment in the product documentation would be
gabomdq@7753
    16
     appreciated but is not required.
gabomdq@7753
    17
  2. Altered source versions must be plainly marked as such, and must not be
gabomdq@7753
    18
     misrepresented as being the original software.
gabomdq@7753
    19
  3. This notice may not be removed or altered from any source distribution.
gabomdq@7753
    20
*/
gabomdq@7753
    21
icculus@8093
    22
#include "../../SDL_internal.h"
gabomdq@7753
    23
gabomdq@7753
    24
#if SDL_VIDEO_DRIVER_RPI
gabomdq@7753
    25
gabomdq@7753
    26
/* References
gabomdq@7753
    27
 * http://elinux.org/RPi_VideoCore_APIs
gabomdq@7753
    28
 * https://github.com/raspberrypi/firmware/blob/master/opt/vc/src/hello_pi/hello_triangle/triangle.c
gabomdq@7753
    29
 * http://cgit.freedesktop.org/wayland/weston/tree/src/rpi-renderer.c
gabomdq@7753
    30
 * http://cgit.freedesktop.org/wayland/weston/tree/src/compositor-rpi.c
gabomdq@7753
    31
 */
gabomdq@7753
    32
gabomdq@7753
    33
/* SDL internals */
gabomdq@7753
    34
#include "../SDL_sysvideo.h"
gabomdq@7753
    35
#include "SDL_version.h"
gabomdq@7753
    36
#include "SDL_syswm.h"
gabomdq@7753
    37
#include "SDL_loadso.h"
gabomdq@7753
    38
#include "SDL_events.h"
gabomdq@7753
    39
#include "../../events/SDL_mouse_c.h"
gabomdq@7753
    40
#include "../../events/SDL_keyboard_c.h"
slouken@10553
    41
#include "SDL_hints.h"
gabomdq@7753
    42
gabomdq@7753
    43
#ifdef SDL_INPUT_LINUXEV
slouken@8000
    44
#include "../../core/linux/SDL_evdev.h"
gabomdq@7753
    45
#endif
gabomdq@7753
    46
gabomdq@7753
    47
/* RPI declarations */
gabomdq@7753
    48
#include "SDL_rpivideo.h"
gabomdq@7753
    49
#include "SDL_rpievents_c.h"
gabomdq@7753
    50
#include "SDL_rpiopengles.h"
gabomdq@7753
    51
#include "SDL_rpimouse.h"
gabomdq@7753
    52
gabomdq@7753
    53
static int
gabomdq@7753
    54
RPI_Available(void)
gabomdq@7753
    55
{
gabomdq@7753
    56
    return 1;
gabomdq@7753
    57
}
gabomdq@7753
    58
gabomdq@7753
    59
static void
gabomdq@7753
    60
RPI_Destroy(SDL_VideoDevice * device)
gabomdq@7753
    61
{
icculus@10922
    62
    SDL_free(device->driverdata);
icculus@10922
    63
    SDL_free(device);
gabomdq@7753
    64
}
gabomdq@7753
    65
slouken@11853
    66
static int 
slouken@11853
    67
RPI_GetRefreshRate()
slouken@11853
    68
{
slouken@11853
    69
    TV_DISPLAY_STATE_T tvstate;
slouken@11853
    70
    if (vc_tv_get_display_state( &tvstate ) == 0) {
slouken@11853
    71
        //The width/height parameters are in the same position in the union
slouken@11853
    72
        //for HDMI and SDTV
slouken@11853
    73
        HDMI_PROPERTY_PARAM_T property;
slouken@11853
    74
        property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE;
slouken@11853
    75
        vc_tv_hdmi_get_property(&property);
slouken@11853
    76
        return property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? 
slouken@11853
    77
            tvstate.display.hdmi.frame_rate * (1000.0f/1001.0f) : 
slouken@11853
    78
            tvstate.display.hdmi.frame_rate;
slouken@11853
    79
    } 
slouken@11853
    80
    return 60;  /* Failed to get display state, default to 60 */
slouken@11853
    81
}
slouken@11853
    82
gabomdq@7753
    83
static SDL_VideoDevice *
gabomdq@7753
    84
RPI_Create()
gabomdq@7753
    85
{
gabomdq@7753
    86
    SDL_VideoDevice *device;
gabomdq@7753
    87
    SDL_VideoData *phdata;
gabomdq@7753
    88
gabomdq@7753
    89
    /* Initialize SDL_VideoDevice structure */
gabomdq@7753
    90
    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
gabomdq@7753
    91
    if (device == NULL) {
gabomdq@7753
    92
        SDL_OutOfMemory();
gabomdq@7753
    93
        return NULL;
gabomdq@7753
    94
    }
gabomdq@7753
    95
gabomdq@7753
    96
    /* Initialize internal data */
gabomdq@7753
    97
    phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
gabomdq@7753
    98
    if (phdata == NULL) {
gabomdq@7753
    99
        SDL_OutOfMemory();
gabomdq@7753
   100
        SDL_free(device);
gabomdq@7753
   101
        return NULL;
gabomdq@7753
   102
    }
gabomdq@7753
   103
gabomdq@7753
   104
    device->driverdata = phdata;
gabomdq@7753
   105
philipp@10202
   106
    /* Setup amount of available displays */
gabomdq@7753
   107
    device->num_displays = 0;
gabomdq@7753
   108
gabomdq@7753
   109
    /* Set device free function */
gabomdq@7753
   110
    device->free = RPI_Destroy;
gabomdq@7753
   111
gabomdq@7753
   112
    /* Setup all functions which we can handle */
gabomdq@7753
   113
    device->VideoInit = RPI_VideoInit;
gabomdq@7753
   114
    device->VideoQuit = RPI_VideoQuit;
gabomdq@7753
   115
    device->GetDisplayModes = RPI_GetDisplayModes;
gabomdq@7753
   116
    device->SetDisplayMode = RPI_SetDisplayMode;
slouken@11383
   117
    device->CreateSDLWindow = RPI_CreateWindow;
slouken@11383
   118
    device->CreateSDLWindowFrom = RPI_CreateWindowFrom;
gabomdq@7753
   119
    device->SetWindowTitle = RPI_SetWindowTitle;
gabomdq@7753
   120
    device->SetWindowIcon = RPI_SetWindowIcon;
gabomdq@7753
   121
    device->SetWindowPosition = RPI_SetWindowPosition;
gabomdq@7753
   122
    device->SetWindowSize = RPI_SetWindowSize;
gabomdq@7753
   123
    device->ShowWindow = RPI_ShowWindow;
gabomdq@7753
   124
    device->HideWindow = RPI_HideWindow;
gabomdq@7753
   125
    device->RaiseWindow = RPI_RaiseWindow;
gabomdq@7753
   126
    device->MaximizeWindow = RPI_MaximizeWindow;
gabomdq@7753
   127
    device->MinimizeWindow = RPI_MinimizeWindow;
gabomdq@7753
   128
    device->RestoreWindow = RPI_RestoreWindow;
gabomdq@7753
   129
    device->SetWindowGrab = RPI_SetWindowGrab;
gabomdq@7753
   130
    device->DestroyWindow = RPI_DestroyWindow;
philipp@11098
   131
#if 0
gabomdq@7753
   132
    device->GetWindowWMInfo = RPI_GetWindowWMInfo;
philipp@11098
   133
#endif
gabomdq@7753
   134
    device->GL_LoadLibrary = RPI_GLES_LoadLibrary;
gabomdq@7753
   135
    device->GL_GetProcAddress = RPI_GLES_GetProcAddress;
gabomdq@7753
   136
    device->GL_UnloadLibrary = RPI_GLES_UnloadLibrary;
gabomdq@7753
   137
    device->GL_CreateContext = RPI_GLES_CreateContext;
gabomdq@7753
   138
    device->GL_MakeCurrent = RPI_GLES_MakeCurrent;
gabomdq@7753
   139
    device->GL_SetSwapInterval = RPI_GLES_SetSwapInterval;
gabomdq@7753
   140
    device->GL_GetSwapInterval = RPI_GLES_GetSwapInterval;
gabomdq@7753
   141
    device->GL_SwapWindow = RPI_GLES_SwapWindow;
gabomdq@7753
   142
    device->GL_DeleteContext = RPI_GLES_DeleteContext;
icculus@11444
   143
    device->GL_DefaultProfileConfig = RPI_GLES_DefaultProfileConfig;
gabomdq@7753
   144
gabomdq@7753
   145
    device->PumpEvents = RPI_PumpEvents;
gabomdq@7753
   146
gabomdq@7753
   147
    return device;
gabomdq@7753
   148
}
gabomdq@7753
   149
gabomdq@7753
   150
VideoBootStrap RPI_bootstrap = {
gabomdq@7753
   151
    "RPI",
gabomdq@7753
   152
    "RPI Video Driver",
gabomdq@7753
   153
    RPI_Available,
gabomdq@7753
   154
    RPI_Create
gabomdq@7753
   155
};
gabomdq@7753
   156
icculus@12615
   157
gabomdq@7753
   158
/*****************************************************************************/
gabomdq@7753
   159
/* SDL Video and Display initialization/handling functions                   */
gabomdq@7753
   160
/*****************************************************************************/
icculus@12615
   161
icculus@12615
   162
static void
icculus@12615
   163
AddDispManXDisplay(const int display_id)
gabomdq@7753
   164
{
icculus@12615
   165
    DISPMANX_MODEINFO_T modeinfo;
icculus@12615
   166
    DISPMANX_DISPLAY_HANDLE_T handle;
gabomdq@7753
   167
    SDL_VideoDisplay display;
gabomdq@7753
   168
    SDL_DisplayMode current_mode;
icculus@7799
   169
    SDL_DisplayData *data;
gabomdq@7753
   170
icculus@12615
   171
    handle = vc_dispmanx_display_open(display_id);
icculus@12615
   172
    if (!handle) {
icculus@12615
   173
        return;  /* this display isn't available */
gabomdq@7753
   174
    }
gabomdq@7753
   175
icculus@12615
   176
    if (vc_dispmanx_display_get_info(handle, &modeinfo) < 0) {
icculus@12615
   177
        vc_dispmanx_display_close(handle);
icculus@12615
   178
        return;
icculus@12615
   179
    }
icculus@12615
   180
icculus@12615
   181
    /* RPI_GetRefreshRate() doesn't distinguish between displays. I'm not sure the hardware distinguishes either */
icculus@12615
   182
    SDL_zero(current_mode);
icculus@12615
   183
    current_mode.w = modeinfo.width;
icculus@12615
   184
    current_mode.h = modeinfo.height;
slouken@11853
   185
    current_mode.refresh_rate = RPI_GetRefreshRate();
gabomdq@7753
   186
    /* 32 bpp for default */
gabomdq@7753
   187
    current_mode.format = SDL_PIXELFORMAT_ABGR8888;
gabomdq@7753
   188
gabomdq@7753
   189
    current_mode.driverdata = NULL;
gabomdq@7753
   190
gabomdq@7753
   191
    SDL_zero(display);
gabomdq@7753
   192
    display.desktop_mode = current_mode;
gabomdq@7753
   193
    display.current_mode = current_mode;
gabomdq@7753
   194
gabomdq@7753
   195
    /* Allocate display internal data */
gabomdq@7753
   196
    data = (SDL_DisplayData *) SDL_calloc(1, sizeof(SDL_DisplayData));
gabomdq@7753
   197
    if (data == NULL) {
icculus@12615
   198
        vc_dispmanx_display_close(handle);
icculus@12615
   199
        return;  /* oh well */
gabomdq@7753
   200
    }
gabomdq@7753
   201
icculus@12615
   202
    data->dispman_display = handle;
gabomdq@7753
   203
gabomdq@7753
   204
    display.driverdata = data;
gabomdq@7753
   205
gabomdq@7753
   206
    SDL_AddVideoDisplay(&display);
icculus@12615
   207
}
icculus@12615
   208
icculus@12615
   209
int
icculus@12615
   210
RPI_VideoInit(_THIS)
icculus@12615
   211
{
icculus@12615
   212
    /* Initialize BCM Host */
icculus@12615
   213
    bcm_host_init();
icculus@12615
   214
icculus@12615
   215
    AddDispManXDisplay(DISPMANX_ID_MAIN_LCD);  /* your default display */
icculus@12615
   216
    AddDispManXDisplay(DISPMANX_ID_FORCE_OTHER);  /* an "other" display...maybe DSI-connected screen while HDMI is your main */
gabomdq@7753
   217
gabomdq@7753
   218
#ifdef SDL_INPUT_LINUXEV    
slouken@10794
   219
    if (SDL_EVDEV_Init() < 0) {
slouken@10794
   220
        return -1;
slouken@10794
   221
    }
gabomdq@7753
   222
#endif    
gabomdq@7753
   223
    
gabomdq@7753
   224
    RPI_InitMouse(_this);
gabomdq@7753
   225
gabomdq@7753
   226
    return 1;
gabomdq@7753
   227
}
gabomdq@7753
   228
gabomdq@7753
   229
void
gabomdq@7753
   230
RPI_VideoQuit(_THIS)
gabomdq@7753
   231
{
gabomdq@7753
   232
#ifdef SDL_INPUT_LINUXEV    
gabomdq@7753
   233
    SDL_EVDEV_Quit();
gabomdq@7753
   234
#endif    
gabomdq@7753
   235
}
gabomdq@7753
   236
gabomdq@7753
   237
void
gabomdq@7753
   238
RPI_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
gabomdq@7753
   239
{
gabomdq@7753
   240
    /* Only one display mode available, the current one */
gabomdq@7753
   241
    SDL_AddDisplayMode(display, &display->current_mode);
gabomdq@7753
   242
}
gabomdq@7753
   243
gabomdq@7753
   244
int
gabomdq@7753
   245
RPI_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
gabomdq@7753
   246
{
gabomdq@7753
   247
    return 0;
gabomdq@7753
   248
}
gabomdq@7753
   249
brandontschaefer@11694
   250
static void
brandontschaefer@11694
   251
RPI_vsync_callback(DISPMANX_UPDATE_HANDLE_T u, void *data)
brandontschaefer@11694
   252
{
brandontschaefer@11694
   253
   SDL_WindowData *wdata = ((SDL_WindowData *) data);
brandontschaefer@11694
   254
brandontschaefer@11694
   255
   SDL_LockMutex(wdata->vsync_cond_mutex);
brandontschaefer@11694
   256
   SDL_CondSignal(wdata->vsync_cond);
brandontschaefer@11694
   257
   SDL_UnlockMutex(wdata->vsync_cond_mutex);
brandontschaefer@11694
   258
}
brandontschaefer@11694
   259
gabomdq@7753
   260
int
gabomdq@7753
   261
RPI_CreateWindow(_THIS, SDL_Window * window)
gabomdq@7753
   262
{
gabomdq@7753
   263
    SDL_WindowData *wdata;
gabomdq@7753
   264
    SDL_VideoDisplay *display;
gabomdq@7753
   265
    SDL_DisplayData *displaydata;
gabomdq@7753
   266
    VC_RECT_T dst_rect;
gabomdq@7753
   267
    VC_RECT_T src_rect;
gabomdq@7753
   268
    VC_DISPMANX_ALPHA_T         dispman_alpha;
gabomdq@7753
   269
    DISPMANX_UPDATE_HANDLE_T dispman_update;
slouken@10553
   270
    uint32_t layer = SDL_RPI_VIDEOLAYER;
slouken@10553
   271
    const char *env;
gabomdq@7753
   272
gabomdq@7753
   273
    /* Disable alpha, otherwise the app looks composed with whatever dispman is showing (X11, console,etc) */
gabomdq@7753
   274
    dispman_alpha.flags = DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS; 
gabomdq@7753
   275
    dispman_alpha.opacity = 0xFF; 
gabomdq@7753
   276
    dispman_alpha.mask = 0;
gabomdq@7753
   277
gabomdq@7753
   278
    /* Allocate window internal data */
gabomdq@7753
   279
    wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData));
gabomdq@7753
   280
    if (wdata == NULL) {
gabomdq@7753
   281
        return SDL_OutOfMemory();
gabomdq@7753
   282
    }
gabomdq@7753
   283
    display = SDL_GetDisplayForWindow(window);
gabomdq@7753
   284
    displaydata = (SDL_DisplayData *) display->driverdata;
gabomdq@7753
   285
gabomdq@7753
   286
    /* Windows have one size for now */
gabomdq@7753
   287
    window->w = display->desktop_mode.w;
gabomdq@7753
   288
    window->h = display->desktop_mode.h;
gabomdq@7753
   289
gabomdq@7753
   290
    /* OpenGL ES is the law here, buddy */
gabomdq@7753
   291
    window->flags |= SDL_WINDOW_OPENGL;
gabomdq@7753
   292
gabomdq@7753
   293
    /* Create a dispman element and associate a window to it */
gabomdq@7753
   294
    dst_rect.x = 0;
gabomdq@7753
   295
    dst_rect.y = 0;
gabomdq@7753
   296
    dst_rect.width = window->w;
gabomdq@7753
   297
    dst_rect.height = window->h;
gabomdq@7753
   298
gabomdq@7753
   299
    src_rect.x = 0;
gabomdq@7753
   300
    src_rect.y = 0;
gabomdq@7753
   301
    src_rect.width = window->w << 16;
gabomdq@7753
   302
    src_rect.height = window->h << 16;
gabomdq@7753
   303
slouken@10553
   304
    env = SDL_GetHint(SDL_HINT_RPI_VIDEO_LAYER);
slouken@10553
   305
    if (env) {
slouken@10553
   306
        layer = SDL_atoi(env);
slouken@10553
   307
    }
slouken@10553
   308
gabomdq@7753
   309
    dispman_update = vc_dispmanx_update_start( 0 );
slouken@10553
   310
    wdata->dispman_window.element = vc_dispmanx_element_add (dispman_update,
slouken@10553
   311
                                                             displaydata->dispman_display,
slouken@10553
   312
                                                             layer /* layer */,
slouken@10553
   313
                                                             &dst_rect,
slouken@10553
   314
                                                             0 /*src*/,
slouken@10553
   315
                                                             &src_rect,
slouken@10553
   316
                                                             DISPMANX_PROTECTION_NONE,
slouken@10553
   317
                                                             &dispman_alpha /*alpha*/,
slouken@10553
   318
                                                             0 /*clamp*/,
slouken@10553
   319
                                                             0 /*transform*/);
gabomdq@7753
   320
    wdata->dispman_window.width = window->w;
gabomdq@7753
   321
    wdata->dispman_window.height = window->h;
slouken@10553
   322
    vc_dispmanx_update_submit_sync(dispman_update);
gabomdq@7753
   323
    
gabomdq@7753
   324
    if (!_this->egl_data) {
gabomdq@7753
   325
        if (SDL_GL_LoadLibrary(NULL) < 0) {
gabomdq@7753
   326
            return -1;
gabomdq@7753
   327
        }
gabomdq@7753
   328
    }
gabomdq@7753
   329
    wdata->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) &wdata->dispman_window);
gabomdq@7753
   330
gabomdq@7753
   331
    if (wdata->egl_surface == EGL_NO_SURFACE) {
gabomdq@7753
   332
        return SDL_SetError("Could not create GLES window surface");
gabomdq@7753
   333
    }
gabomdq@7753
   334
brandontschaefer@11694
   335
    /* Start generating vsync callbacks if necesary */
brandontschaefer@11694
   336
    wdata->double_buffer = SDL_FALSE;
brandontschaefer@11694
   337
    if (SDL_GetHintBoolean(SDL_HINT_VIDEO_DOUBLE_BUFFER, SDL_FALSE)) {
brandontschaefer@11694
   338
        wdata->vsync_cond = SDL_CreateCond();
brandontschaefer@11694
   339
        wdata->vsync_cond_mutex = SDL_CreateMutex();
brandontschaefer@11694
   340
        wdata->double_buffer = SDL_TRUE;
brandontschaefer@11694
   341
        vc_dispmanx_vsync_callback(displaydata->dispman_display, RPI_vsync_callback, (void*)wdata);
brandontschaefer@11694
   342
    }
brandontschaefer@11694
   343
gabomdq@7753
   344
    /* Setup driver data for this window */
gabomdq@7753
   345
    window->driverdata = wdata;
brandontschaefer@11694
   346
gabomdq@7753
   347
    /* One window, it always has focus */
gabomdq@7753
   348
    SDL_SetMouseFocus(window);
gabomdq@7753
   349
    SDL_SetKeyboardFocus(window);
gabomdq@7753
   350
gabomdq@7753
   351
    /* Window has been successfully created */
gabomdq@7753
   352
    return 0;
gabomdq@7753
   353
}
gabomdq@7753
   354
gabomdq@7986
   355
void
gabomdq@7986
   356
RPI_DestroyWindow(_THIS, SDL_Window * window)
gabomdq@7986
   357
{
icculus@9711
   358
    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
brandontschaefer@11694
   359
    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
brandontschaefer@11694
   360
    SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
brandontschaefer@11694
   361
icculus@9711
   362
    if(data) {
slouken@12201
   363
        if (data->double_buffer) {
slouken@12201
   364
            /* Wait for vsync, and then stop vsync callbacks and destroy related stuff, if needed */
slouken@12201
   365
            SDL_LockMutex(data->vsync_cond_mutex);
slouken@12201
   366
            SDL_CondWait(data->vsync_cond, data->vsync_cond_mutex);
slouken@12201
   367
            SDL_UnlockMutex(data->vsync_cond_mutex);
brandontschaefer@11694
   368
slouken@12201
   369
            vc_dispmanx_vsync_callback(displaydata->dispman_display, NULL, NULL);
brandontschaefer@11694
   370
slouken@12201
   371
            SDL_DestroyCond(data->vsync_cond);
slouken@12201
   372
            SDL_DestroyMutex(data->vsync_cond_mutex);
slouken@12201
   373
        }
brandontschaefer@11694
   374
icculus@9711
   375
#if SDL_VIDEO_OPENGL_EGL
gabomdq@7986
   376
        if (data->egl_surface != EGL_NO_SURFACE) {
gabomdq@7986
   377
            SDL_EGL_DestroySurface(_this, data->egl_surface);
gabomdq@7986
   378
        }
icculus@9711
   379
#endif
icculus@9711
   380
        SDL_free(data);
gabomdq@7986
   381
        window->driverdata = NULL;
gabomdq@7986
   382
    }
gabomdq@7986
   383
}
gabomdq@7986
   384
gabomdq@7753
   385
int
gabomdq@7753
   386
RPI_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
gabomdq@7753
   387
{
gabomdq@7753
   388
    return -1;
gabomdq@7753
   389
}
gabomdq@7753
   390
gabomdq@7753
   391
void
gabomdq@7753
   392
RPI_SetWindowTitle(_THIS, SDL_Window * window)
gabomdq@7753
   393
{
gabomdq@7753
   394
}
gabomdq@7753
   395
void
gabomdq@7753
   396
RPI_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
gabomdq@7753
   397
{
gabomdq@7753
   398
}
gabomdq@7753
   399
void
gabomdq@7753
   400
RPI_SetWindowPosition(_THIS, SDL_Window * window)
gabomdq@7753
   401
{
gabomdq@7753
   402
}
gabomdq@7753
   403
void
gabomdq@7753
   404
RPI_SetWindowSize(_THIS, SDL_Window * window)
gabomdq@7753
   405
{
gabomdq@7753
   406
}
gabomdq@7753
   407
void
gabomdq@7753
   408
RPI_ShowWindow(_THIS, SDL_Window * window)
gabomdq@7753
   409
{
gabomdq@7753
   410
}
gabomdq@7753
   411
void
gabomdq@7753
   412
RPI_HideWindow(_THIS, SDL_Window * window)
gabomdq@7753
   413
{
gabomdq@7753
   414
}
gabomdq@7753
   415
void
gabomdq@7753
   416
RPI_RaiseWindow(_THIS, SDL_Window * window)
gabomdq@7753
   417
{
gabomdq@7753
   418
}
gabomdq@7753
   419
void
gabomdq@7753
   420
RPI_MaximizeWindow(_THIS, SDL_Window * window)
gabomdq@7753
   421
{
gabomdq@7753
   422
}
gabomdq@7753
   423
void
gabomdq@7753
   424
RPI_MinimizeWindow(_THIS, SDL_Window * window)
gabomdq@7753
   425
{
gabomdq@7753
   426
}
gabomdq@7753
   427
void
gabomdq@7753
   428
RPI_RestoreWindow(_THIS, SDL_Window * window)
gabomdq@7753
   429
{
gabomdq@7753
   430
}
gabomdq@7753
   431
void
gabomdq@7753
   432
RPI_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
gabomdq@7753
   433
{
gabomdq@7753
   434
gabomdq@7753
   435
}
gabomdq@7753
   436
gabomdq@7753
   437
/*****************************************************************************/
gabomdq@7753
   438
/* SDL Window Manager function                                               */
gabomdq@7753
   439
/*****************************************************************************/
philipp@11098
   440
#if 0
gabomdq@7753
   441
SDL_bool
gabomdq@7753
   442
RPI_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info)
gabomdq@7753
   443
{
gabomdq@7753
   444
    if (info->version.major <= SDL_MAJOR_VERSION) {
gabomdq@7753
   445
        return SDL_TRUE;
gabomdq@7753
   446
    } else {
philipp@10945
   447
        SDL_SetError("application not compiled with SDL %d.%d",
gabomdq@7753
   448
                     SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
gabomdq@7753
   449
        return SDL_FALSE;
gabomdq@7753
   450
    }
gabomdq@7753
   451
gabomdq@7753
   452
    /* Failed to get window manager information */
gabomdq@7753
   453
    return SDL_FALSE;
gabomdq@7753
   454
}
philipp@11098
   455
#endif
gabomdq@7753
   456
gabomdq@7753
   457
#endif /* SDL_VIDEO_DRIVER_RPI */
gabomdq@7753
   458
gabomdq@7753
   459
/* vi: set ts=4 sw=4 expandtab: */