SDL standard library
SDL_system.h@0:dda4f4550403, 2016-09-07 (annotated)
- Committer:
- miruga27
- Date:
- Wed Sep 07 18:46:53 2016 +0000
- Revision:
- 0:dda4f4550403
7/09/2016;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
miruga27 | 0:dda4f4550403 | 1 | /* |
miruga27 | 0:dda4f4550403 | 2 | Simple DirectMedia Layer |
miruga27 | 0:dda4f4550403 | 3 | Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org> |
miruga27 | 0:dda4f4550403 | 4 | |
miruga27 | 0:dda4f4550403 | 5 | This software is provided 'as-is', without any express or implied |
miruga27 | 0:dda4f4550403 | 6 | warranty. In no event will the authors be held liable for any damages |
miruga27 | 0:dda4f4550403 | 7 | arising from the use of this software. |
miruga27 | 0:dda4f4550403 | 8 | |
miruga27 | 0:dda4f4550403 | 9 | Permission is granted to anyone to use this software for any purpose, |
miruga27 | 0:dda4f4550403 | 10 | including commercial applications, and to alter it and redistribute it |
miruga27 | 0:dda4f4550403 | 11 | freely, subject to the following restrictions: |
miruga27 | 0:dda4f4550403 | 12 | |
miruga27 | 0:dda4f4550403 | 13 | 1. The origin of this software must not be misrepresented; you must not |
miruga27 | 0:dda4f4550403 | 14 | claim that you wrote the original software. If you use this software |
miruga27 | 0:dda4f4550403 | 15 | in a product, an acknowledgment in the product documentation would be |
miruga27 | 0:dda4f4550403 | 16 | appreciated but is not required. |
miruga27 | 0:dda4f4550403 | 17 | 2. Altered source versions must be plainly marked as such, and must not be |
miruga27 | 0:dda4f4550403 | 18 | misrepresented as being the original software. |
miruga27 | 0:dda4f4550403 | 19 | 3. This notice may not be removed or altered from any source distribution. |
miruga27 | 0:dda4f4550403 | 20 | */ |
miruga27 | 0:dda4f4550403 | 21 | |
miruga27 | 0:dda4f4550403 | 22 | /** |
miruga27 | 0:dda4f4550403 | 23 | * \file SDL_system.h |
miruga27 | 0:dda4f4550403 | 24 | * |
miruga27 | 0:dda4f4550403 | 25 | * Include file for platform specific SDL API functions |
miruga27 | 0:dda4f4550403 | 26 | */ |
miruga27 | 0:dda4f4550403 | 27 | |
miruga27 | 0:dda4f4550403 | 28 | #ifndef _SDL_system_h |
miruga27 | 0:dda4f4550403 | 29 | #define _SDL_system_h |
miruga27 | 0:dda4f4550403 | 30 | |
miruga27 | 0:dda4f4550403 | 31 | #include "SDL_stdinc.h" |
miruga27 | 0:dda4f4550403 | 32 | #include "SDL_keyboard.h" |
miruga27 | 0:dda4f4550403 | 33 | #include "SDL_render.h" |
miruga27 | 0:dda4f4550403 | 34 | #include "SDL_video.h" |
miruga27 | 0:dda4f4550403 | 35 | |
miruga27 | 0:dda4f4550403 | 36 | #include "begin_code.h" |
miruga27 | 0:dda4f4550403 | 37 | /* Set up for C function definitions, even when using C++ */ |
miruga27 | 0:dda4f4550403 | 38 | #ifdef __cplusplus |
miruga27 | 0:dda4f4550403 | 39 | extern "C" { |
miruga27 | 0:dda4f4550403 | 40 | #endif |
miruga27 | 0:dda4f4550403 | 41 | |
miruga27 | 0:dda4f4550403 | 42 | |
miruga27 | 0:dda4f4550403 | 43 | /* Platform specific functions for Windows */ |
miruga27 | 0:dda4f4550403 | 44 | #ifdef __WIN32__ |
miruga27 | 0:dda4f4550403 | 45 | |
miruga27 | 0:dda4f4550403 | 46 | /* Returns the D3D9 adapter index that matches the specified display index. |
miruga27 | 0:dda4f4550403 | 47 | This adapter index can be passed to IDirect3D9::CreateDevice and controls |
miruga27 | 0:dda4f4550403 | 48 | on which monitor a full screen application will appear. |
miruga27 | 0:dda4f4550403 | 49 | */ |
miruga27 | 0:dda4f4550403 | 50 | extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex ); |
miruga27 | 0:dda4f4550403 | 51 | |
miruga27 | 0:dda4f4550403 | 52 | /* Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer. |
miruga27 | 0:dda4f4550403 | 53 | Once you are done using the device, you should release it to avoid a resource leak. |
miruga27 | 0:dda4f4550403 | 54 | */ |
miruga27 | 0:dda4f4550403 | 55 | typedef struct IDirect3DDevice9 IDirect3DDevice9; |
miruga27 | 0:dda4f4550403 | 56 | extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer); |
miruga27 | 0:dda4f4550403 | 57 | |
miruga27 | 0:dda4f4550403 | 58 | /* Returns the DXGI Adapter and Output indices for the specified display index. |
miruga27 | 0:dda4f4550403 | 59 | These can be passed to EnumAdapters and EnumOutputs respectively to get the objects |
miruga27 | 0:dda4f4550403 | 60 | required to create a DX10 or DX11 device and swap chain. |
miruga27 | 0:dda4f4550403 | 61 | */ |
miruga27 | 0:dda4f4550403 | 62 | extern DECLSPEC void SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex ); |
miruga27 | 0:dda4f4550403 | 63 | |
miruga27 | 0:dda4f4550403 | 64 | #endif /* __WIN32__ */ |
miruga27 | 0:dda4f4550403 | 65 | |
miruga27 | 0:dda4f4550403 | 66 | |
miruga27 | 0:dda4f4550403 | 67 | /* Platform specific functions for iOS */ |
miruga27 | 0:dda4f4550403 | 68 | #if defined(__IPHONEOS__) && __IPHONEOS__ |
miruga27 | 0:dda4f4550403 | 69 | |
miruga27 | 0:dda4f4550403 | 70 | extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); |
miruga27 | 0:dda4f4550403 | 71 | extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); |
miruga27 | 0:dda4f4550403 | 72 | |
miruga27 | 0:dda4f4550403 | 73 | #endif /* __IPHONEOS__ */ |
miruga27 | 0:dda4f4550403 | 74 | |
miruga27 | 0:dda4f4550403 | 75 | |
miruga27 | 0:dda4f4550403 | 76 | /* Platform specific functions for Android */ |
miruga27 | 0:dda4f4550403 | 77 | #if defined(__ANDROID__) && __ANDROID__ |
miruga27 | 0:dda4f4550403 | 78 | |
miruga27 | 0:dda4f4550403 | 79 | /* Get the JNI environment for the current thread |
miruga27 | 0:dda4f4550403 | 80 | This returns JNIEnv*, but the prototype is void* so we don't need jni.h |
miruga27 | 0:dda4f4550403 | 81 | */ |
miruga27 | 0:dda4f4550403 | 82 | extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(); |
miruga27 | 0:dda4f4550403 | 83 | |
miruga27 | 0:dda4f4550403 | 84 | /* Get the SDL Activity object for the application |
miruga27 | 0:dda4f4550403 | 85 | This returns jobject, but the prototype is void* so we don't need jni.h |
miruga27 | 0:dda4f4550403 | 86 | The jobject returned by SDL_AndroidGetActivity is a local reference. |
miruga27 | 0:dda4f4550403 | 87 | It is the caller's responsibility to properly release it |
miruga27 | 0:dda4f4550403 | 88 | (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef) |
miruga27 | 0:dda4f4550403 | 89 | */ |
miruga27 | 0:dda4f4550403 | 90 | extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(); |
miruga27 | 0:dda4f4550403 | 91 | |
miruga27 | 0:dda4f4550403 | 92 | /* See the official Android developer guide for more information: |
miruga27 | 0:dda4f4550403 | 93 | http://developer.android.com/guide/topics/data/data-storage.html |
miruga27 | 0:dda4f4550403 | 94 | */ |
miruga27 | 0:dda4f4550403 | 95 | #define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 |
miruga27 | 0:dda4f4550403 | 96 | #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02 |
miruga27 | 0:dda4f4550403 | 97 | |
miruga27 | 0:dda4f4550403 | 98 | /* Get the path used for internal storage for this application. |
miruga27 | 0:dda4f4550403 | 99 | This path is unique to your application and cannot be written to |
miruga27 | 0:dda4f4550403 | 100 | by other applications. |
miruga27 | 0:dda4f4550403 | 101 | */ |
miruga27 | 0:dda4f4550403 | 102 | extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(); |
miruga27 | 0:dda4f4550403 | 103 | |
miruga27 | 0:dda4f4550403 | 104 | /* Get the current state of external storage, a bitmask of these values: |
miruga27 | 0:dda4f4550403 | 105 | SDL_ANDROID_EXTERNAL_STORAGE_READ |
miruga27 | 0:dda4f4550403 | 106 | SDL_ANDROID_EXTERNAL_STORAGE_WRITE |
miruga27 | 0:dda4f4550403 | 107 | If external storage is currently unavailable, this will return 0. |
miruga27 | 0:dda4f4550403 | 108 | */ |
miruga27 | 0:dda4f4550403 | 109 | extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(); |
miruga27 | 0:dda4f4550403 | 110 | |
miruga27 | 0:dda4f4550403 | 111 | /* Get the path used for external storage for this application. |
miruga27 | 0:dda4f4550403 | 112 | This path is unique to your application, but is public and can be |
miruga27 | 0:dda4f4550403 | 113 | written to by other applications. |
miruga27 | 0:dda4f4550403 | 114 | */ |
miruga27 | 0:dda4f4550403 | 115 | extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(); |
miruga27 | 0:dda4f4550403 | 116 | |
miruga27 | 0:dda4f4550403 | 117 | #endif /* __ANDROID__ */ |
miruga27 | 0:dda4f4550403 | 118 | |
miruga27 | 0:dda4f4550403 | 119 | /* Ends C function definitions when using C++ */ |
miruga27 | 0:dda4f4550403 | 120 | #ifdef __cplusplus |
miruga27 | 0:dda4f4550403 | 121 | } |
miruga27 | 0:dda4f4550403 | 122 | #endif |
miruga27 | 0:dda4f4550403 | 123 | #include "close_code.h" |
miruga27 | 0:dda4f4550403 | 124 | |
miruga27 | 0:dda4f4550403 | 125 | #endif /* _SDL_system_h */ |
miruga27 | 0:dda4f4550403 | 126 | |
miruga27 | 0:dda4f4550403 | 127 | /* vi: set ts=4 sw=4 expandtab: */ |