src/video/winrt/SDL_winrtvideo_cpp.h
changeset 9924 355cccccc7dc
parent 9619 b94b6d0bff0f
child 9931 0bb3dd1c95f2
     1.1 --- a/src/video/winrt/SDL_winrtvideo_cpp.h	Sun Nov 15 13:04:42 2015 -0500
     1.2 +++ b/src/video/winrt/SDL_winrtvideo_cpp.h	Thu Nov 26 00:41:39 2015 -0500
     1.3 @@ -29,6 +29,12 @@
     1.4  #include "SDL_video.h"
     1.5  #include "SDL_events.h"
     1.6  
     1.7 +#if NTDDI_VERSION >= NTDDI_WINBLUE  /* ApplicationView's functionality only becomes
     1.8 +                                       useful for SDL in Win[Phone] 8.1 and up.
     1.9 +                                       Plus, it is not available at all in WinPhone 8.0. */
    1.10 +#define SDL_WINRT_USE_APPLICATIONVIEW 1
    1.11 +#endif
    1.12 +
    1.13  extern "C" {
    1.14  #include "../SDL_sysvideo.h"
    1.15  #include "../SDL_egl_c.h"
    1.16 @@ -48,25 +54,17 @@
    1.17  */
    1.18  extern SDL_Window * WINRT_GlobalSDLWindow;
    1.19  
    1.20 -/* Creates a display mode for Plain Direct3D (non-XAML) apps, using the lone, native window's settings.
    1.21 -
    1.22 -   Pass in an allocated SDL_DisplayMode field to store the data in.
    1.23 -
    1.24 -   This function will return 0 on success, -1 on failure.
    1.25 -
    1.26 -   If this function succeeds, be sure to call SDL_free on the
    1.27 -   SDL_DisplayMode's driverdata field.
    1.28 +/* Updates one or more SDL_Window flags, by querying the OS' native windowing APIs.
    1.29 +   SDL_Window flags that can be updated should be specified in 'mask'.
    1.30  */
    1.31 -extern int WINRT_CalcDisplayModeUsingNativeWindow(SDL_DisplayMode * mode);
    1.32 -
    1.33 -/* Duplicates a display mode, copying over driverdata as necessary */
    1.34 -extern int WINRT_DuplicateDisplayMode(SDL_DisplayMode * dest, const SDL_DisplayMode * src);
    1.35 +extern void WINRT_UpdateWindowFlags(SDL_Window * window, Uint32 mask);
    1.36 +extern "C" Uint32 WINRT_DetectWindowFlags(SDL_Window * window);  /* detects flags w/o applying them */
    1.37  
    1.38  /* Display mode internals */
    1.39 -typedef struct
    1.40 -{
    1.41 -    Windows::Graphics::Display::DisplayOrientations currentOrientation;
    1.42 -} SDL_DisplayModeData;
    1.43 +//typedef struct
    1.44 +//{
    1.45 +//    Windows::Graphics::Display::DisplayOrientations currentOrientation;
    1.46 +//} SDL_DisplayModeData;
    1.47  
    1.48  #ifdef __cplusplus_winrt
    1.49  
    1.50 @@ -77,6 +75,10 @@
    1.51  #define WINRT_DISPLAY_PROPERTY(NAME) (Windows::Graphics::Display::DisplayProperties::NAME)
    1.52  #endif
    1.53  
    1.54 +/* Converts DIPS to physical pixels */
    1.55 +#define WINRT_DIPS_TO_PHYSICAL_PIXELS(DIPS) ((int)(0.5f + (((float)(DIPS) * (float)WINRT_DISPLAY_PROPERTY(LogicalDpi)) / 96.f)))
    1.56 +
    1.57 +
    1.58  /* Internal window data */
    1.59  struct SDL_WindowData
    1.60  {
    1.61 @@ -85,6 +87,9 @@
    1.62  #ifdef SDL_VIDEO_OPENGL_EGL
    1.63      EGLSurface egl_surface;
    1.64  #endif
    1.65 +#if SDL_WINRT_USE_APPLICATIONVIEW
    1.66 +    Windows::UI::ViewManagement::ApplicationView ^ appView;
    1.67 +#endif
    1.68  };
    1.69  
    1.70  #endif // ifdef __cplusplus_winrt