src/video/mir/SDL_mirvideo.c
changeset 10089 25fda20d0173
parent 9998 f67cf37e9cd4
child 10181 b82c0f22d22a
equal deleted inserted replaced
10088:33bee97dbcbb 10089:25fda20d0173
    25 
    25 
    26 #include "../../SDL_internal.h"
    26 #include "../../SDL_internal.h"
    27 
    27 
    28 #if SDL_VIDEO_DRIVER_MIR
    28 #if SDL_VIDEO_DRIVER_MIR
    29 
    29 
       
    30 #include "SDL_mirwindow.h"
    30 #include "SDL_video.h"
    31 #include "SDL_video.h"
    31 
    32 
    32 #include "SDL_mirframebuffer.h"
    33 #include "SDL_mirframebuffer.h"
    33 #include "SDL_mirmouse.h"
    34 #include "SDL_mirmouse.h"
    34 #include "SDL_miropengl.h"
    35 #include "SDL_miropengl.h"
    35 #include "SDL_mirvideo.h"
    36 #include "SDL_mirvideo.h"
    36 #include "SDL_mirwindow.h"
       
    37 
    37 
    38 #include "SDL_mirdyn.h"
    38 #include "SDL_mirdyn.h"
    39 
    39 
    40 #define MIR_DRIVER_NAME "mir"
    40 #define MIR_DRIVER_NAME "mir"
    41 
    41 
   144     device->GL_GetSwapInterval = MIR_GL_GetSwapInterval;
   144     device->GL_GetSwapInterval = MIR_GL_GetSwapInterval;
   145     device->GL_SetSwapInterval = MIR_GL_SetSwapInterval;
   145     device->GL_SetSwapInterval = MIR_GL_SetSwapInterval;
   146     device->GL_GetProcAddress  = MIR_GL_GetProcAddress;
   146     device->GL_GetProcAddress  = MIR_GL_GetProcAddress;
   147 
   147 
   148     /* mirwindow */
   148     /* mirwindow */
   149     device->CreateWindow        = MIR_CreateWindow;
   149     device->CreateWindow         = MIR_CreateWindow;
   150     device->DestroyWindow       = MIR_DestroyWindow;
   150     device->DestroyWindow        = MIR_DestroyWindow;
   151     device->GetWindowWMInfo     = MIR_GetWindowWMInfo;
   151     device->GetWindowWMInfo      = MIR_GetWindowWMInfo;
   152     device->SetWindowFullscreen = MIR_SetWindowFullscreen;
   152     device->SetWindowFullscreen  = MIR_SetWindowFullscreen;
   153     device->MaximizeWindow      = MIR_MaximizeWindow;
   153     device->MaximizeWindow       = MIR_MaximizeWindow;
   154     device->MinimizeWindow      = MIR_MinimizeWindow;
   154     device->MinimizeWindow       = MIR_MinimizeWindow;
   155     device->RestoreWindow       = MIR_RestoreWindow;
   155     device->RestoreWindow        = MIR_RestoreWindow;
       
   156     device->ShowWindow           = MIR_RestoreWindow;
       
   157     device->HideWindow           = MIR_HideWindow;
       
   158     device->SetWindowSize        = MIR_SetWindowSize;
       
   159     device->SetWindowMinimumSize = MIR_SetWindowMinimumSize;
       
   160     device->SetWindowMaximumSize = MIR_SetWindowMaximumSize;
       
   161     device->SetWindowTitle       = MIR_SetWindowTitle;
   156 
   162 
   157     device->CreateWindowFrom     = NULL;
   163     device->CreateWindowFrom     = NULL;
   158     device->SetWindowTitle       = NULL;
       
   159     device->SetWindowIcon        = NULL;
   164     device->SetWindowIcon        = NULL;
   160     device->SetWindowPosition    = NULL;
       
   161     device->SetWindowSize        = NULL;
       
   162     device->SetWindowMinimumSize = NULL;
       
   163     device->SetWindowMaximumSize = NULL;
       
   164     device->ShowWindow           = NULL;
       
   165     device->HideWindow           = NULL;
       
   166     device->RaiseWindow          = NULL;
   165     device->RaiseWindow          = NULL;
   167     device->SetWindowBordered    = NULL;
   166     device->SetWindowBordered    = NULL;
   168     device->SetWindowGammaRamp   = NULL;
   167     device->SetWindowGammaRamp   = NULL;
   169     device->GetWindowGammaRamp   = NULL;
   168     device->GetWindowGammaRamp   = NULL;
   170     device->SetWindowGrab        = NULL;
   169     device->SetWindowGrab        = NULL;
   171     device->OnWindowEnter        = NULL;
   170     device->OnWindowEnter        = NULL;
       
   171     device->SetWindowPosition    = NULL;
   172 
   172 
   173     /* mirframebuffer */
   173     /* mirframebuffer */
   174     device->CreateWindowFramebuffer  = MIR_CreateWindowFramebuffer;
   174     device->CreateWindowFramebuffer  = MIR_CreateWindowFramebuffer;
   175     device->UpdateWindowFramebuffer  = MIR_UpdateWindowFramebuffer;
   175     device->UpdateWindowFramebuffer  = MIR_UpdateWindowFramebuffer;
   176     device->DestroyWindowFramebuffer = MIR_DestroyWindowFramebuffer;
   176     device->DestroyWindowFramebuffer = MIR_DestroyWindowFramebuffer;
   270 int
   270 int
   271 MIR_VideoInit(_THIS)
   271 MIR_VideoInit(_THIS)
   272 {
   272 {
   273     MIR_Data* mir_data = _this->driverdata;
   273     MIR_Data* mir_data = _this->driverdata;
   274 
   274 
   275     mir_data->connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__);
   275     mir_data->connection     = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__);
   276     mir_data->software = SDL_FALSE;
   276     mir_data->current_window = NULL;
       
   277     mir_data->software       = SDL_FALSE;
       
   278     mir_data->pixel_format   = mir_pixel_format_invalid;
   277 
   279 
   278     if (!MIR_mir_connection_is_valid(mir_data->connection))
   280     if (!MIR_mir_connection_is_valid(mir_data->connection))
   279         return SDL_SetError("Failed to connect to the Mir Server");
   281         return SDL_SetError("Failed to connect to the Mir Server");
   280 
   282 
   281     MIR_InitDisplays(_this);
   283     MIR_InitDisplays(_this);