SDL 2.0
SDL_system.h File Reference
#include "SDL_stdinc.h"
#include "SDL_keyboard.h"
#include "SDL_render.h"
#include "SDL_video.h"
#include "begin_code.h"
#include "close_code.h"
+ Include dependency graph for SDL_system.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void(* SDL_WindowsMessageHook) (void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam)
 
typedef struct IDirect3DDevice9 IDirect3DDevice9
 
typedef struct ID3D11Device ID3D11Device
 
typedef struct ID3D12Device ID3D12Device
 

Functions

void SDL_SetWindowsMessageHook (SDL_WindowsMessageHook callback, void *userdata)
 
int SDL_Direct3D9GetAdapterIndex (int displayIndex)
 
IDirect3DDevice9SDL_RenderGetD3D9Device (SDL_Renderer *renderer)
 
ID3D11DeviceSDL_RenderGetD3D11Device (SDL_Renderer *renderer)
 
ID3D12DeviceSDL_RenderGetD3D12Device (SDL_Renderer *renderer)
 
SDL_bool SDL_DXGIGetOutputInfo (int displayIndex, int *adapterIndex, int *outputIndex)
 
SDL_bool SDL_IsTablet (void)
 
void SDL_OnApplicationWillTerminate (void)
 
void SDL_OnApplicationDidReceiveMemoryWarning (void)
 
void SDL_OnApplicationWillResignActive (void)
 
void SDL_OnApplicationDidEnterBackground (void)
 
void SDL_OnApplicationWillEnterForeground (void)
 
void SDL_OnApplicationDidBecomeActive (void)
 

Detailed Description

Include file for platform specific SDL API functions

Definition in file SDL_system.h.

Typedef Documentation

◆ ID3D11Device

typedef struct ID3D11Device ID3D11Device

Definition at line 93 of file SDL_system.h.

◆ ID3D12Device

typedef struct ID3D12Device ID3D12Device

Definition at line 113 of file SDL_system.h.

◆ IDirect3DDevice9

Definition at line 77 of file SDL_system.h.

◆ SDL_WindowsMessageHook

typedef void(* SDL_WindowsMessageHook) (void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam)

Definition at line 46 of file SDL_system.h.

Function Documentation

◆ SDL_Direct3D9GetAdapterIndex()

int SDL_Direct3D9GetAdapterIndex ( int  displayIndex)
extern

Get the D3D9 adapter index that matches the specified display index.

The returned adapter index can be passed to IDirect3D9::CreateDevice and controls on which monitor a full screen application will appear.

Parameters
displayIndexthe display index for which to get the D3D9 adapter index
Returns
the D3D9 adapter index on success or a negative error code on failure; call SDL_GetError() for more information.
Since
This function is available since SDL 2.0.1.

◆ SDL_DXGIGetOutputInfo()

SDL_bool SDL_DXGIGetOutputInfo ( int  displayIndex,
int *  adapterIndex,
int *  outputIndex 
)
extern

Get the DXGI Adapter and Output indices for the specified display index.

The DXGI Adapter and Output indices can be passed to EnumAdapters and EnumOutputs respectively to get the objects required to create a DX10 or DX11 device and swap chain.

Before SDL 2.0.4 this function did not return a value. Since SDL 2.0.4 it returns an SDL_bool.

Parameters
displayIndexthe display index for which to get both indices
adapterIndexa pointer to be filled in with the adapter index
outputIndexa pointer to be filled in with the output index
Returns
SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() for more information.
Since
This function is available since SDL 2.0.2.

◆ SDL_IsTablet()

SDL_bool SDL_IsTablet ( void  )
extern

Query if the current device is a tablet.

If SDL can't determine this, it will return SDL_FALSE.

Returns
SDL_TRUE if the device is a tablet, SDL_FALSE otherwise.
Since
This function is available since SDL 2.0.9.

◆ SDL_OnApplicationDidBecomeActive()

void SDL_OnApplicationDidBecomeActive ( void  )
extern

◆ SDL_OnApplicationDidEnterBackground()

void SDL_OnApplicationDidEnterBackground ( void  )
extern

◆ SDL_OnApplicationDidReceiveMemoryWarning()

void SDL_OnApplicationDidReceiveMemoryWarning ( void  )
extern

◆ SDL_OnApplicationWillEnterForeground()

void SDL_OnApplicationWillEnterForeground ( void  )
extern

◆ SDL_OnApplicationWillResignActive()

void SDL_OnApplicationWillResignActive ( void  )
extern

◆ SDL_OnApplicationWillTerminate()

void SDL_OnApplicationWillTerminate ( void  )
extern

◆ SDL_RenderGetD3D11Device()

ID3D11Device * SDL_RenderGetD3D11Device ( SDL_Renderer renderer)
extern

Get the D3D11 device associated with a renderer.

Once you are done using the device, you should release it to avoid a resource leak.

Parameters
rendererthe renderer from which to get the associated D3D11 device
Returns
the D3D11 device associated with given renderer or NULL if it is not a D3D11 renderer; call SDL_GetError() for more information.
Since
This function is available since SDL 2.0.16.

◆ SDL_RenderGetD3D12Device()

ID3D12Device * SDL_RenderGetD3D12Device ( SDL_Renderer renderer)
extern

Get the D3D12 device associated with a renderer.

Once you are done using the device, you should release it to avoid a resource leak.

Parameters
rendererthe renderer from which to get the associated D3D12 device
Returns
the D3D12 device associated with given renderer or NULL if it is not a D3D12 renderer; call SDL_GetError() for more information.
Since
This function is available since SDL 2.24.0.

◆ SDL_RenderGetD3D9Device()

IDirect3DDevice9 * SDL_RenderGetD3D9Device ( SDL_Renderer renderer)
extern

Get the D3D9 device associated with a renderer.

Once you are done using the device, you should release it to avoid a resource leak.

Parameters
rendererthe renderer from which to get the associated D3D device
Returns
the D3D9 device associated with given renderer or NULL if it is not a D3D9 renderer; call SDL_GetError() for more information.
Since
This function is available since SDL 2.0.1.

◆ SDL_SetWindowsMessageHook()

void SDL_SetWindowsMessageHook ( SDL_WindowsMessageHook  callback,
void *  userdata 
)
extern

Set a callback for every Windows message, run before TranslateMessage().

Parameters
callbackThe SDL_WindowsMessageHook function to call.
userdataa pointer to pass to every iteration of callback
Since
This function is available since SDL 2.0.4.