فهرست منبع

Updated a README.

Philipp Wiesemann 10 سال پیش
والد
کامیت
60f50c70a7

+ 1 - 1
CMakeLists.txt

@@ -1050,7 +1050,7 @@ elseif(APPLE)
   endif()
 
   if(SDL_AUDIO)
-    set(MACOSX_COREAUDIO 1)
+    set(SDL_AUDIO_DRIVER_COREAUDIO 1)
     file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.c)
     set(SOURCE_FILES ${SOURCE_FILES} ${AUDIO_SOURCES})
     set(HAVE_SDL_AUDIO TRUE)

+ 2 - 2
android-project/src/org/libsdl/app/SDLActivity.java

@@ -392,7 +392,7 @@ public class SDLActivity extends Activity {
     public static native void nativeQuit();
     public static native void nativePause();
     public static native void nativeResume();
-    public static native void onNativeResize(int x, int y, int format);
+    public static native void onNativeResize(int x, int y, int format, float rate);
     public static native int onNativePadDown(int device_id, int keycode);
     public static native int onNativePadUp(int device_id, int keycode);
     public static native void onNativeJoy(int device_id, int axis,
@@ -1041,7 +1041,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
 
         mWidth = width;
         mHeight = height;
-        SDLActivity.onNativeResize(width, height, sdlFormat);
+        SDLActivity.onNativeResize(width, height, sdlFormat, mDisplay.getRefreshRate());
         Log.v("SDL", "Window size:" + width + "x"+height);
 
         // Set mIsSurfaceReady to 'true' *before* making a call to handleResume

+ 1 - 1
docs/README-porting.md

@@ -15,7 +15,7 @@ There are two basic ways of building SDL at the moment:
 
    If you have a GNUish system, then you might try this.  Edit configure.in,
    take a look at the large section labelled:
-	"Set up the configuration based on the target platform!"
+	"Set up the configuration based on the host platform!"
    Add a section for your platform, and then re-run autogen.sh and build!
 
 2. Using an IDE:

+ 29 - 12
include/SDL_system.h

@@ -43,19 +43,25 @@ extern "C" {
 /* Platform specific functions for Windows */
 #ifdef __WIN32__
 
-/* Returns the D3D9 adapter index that matches the specified display index.
+/**
+   \brief Returns the D3D9 adapter index that matches the specified display index.
+
    This adapter index can be passed to IDirect3D9::CreateDevice and controls
    on which monitor a full screen application will appear.
 */
 extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
 
-/* Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer.
+typedef struct IDirect3DDevice9 IDirect3DDevice9;
+/**
+   \brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer.
+
    Once you are done using the device, you should release it to avoid a resource leak.
  */
-typedef struct IDirect3DDevice9 IDirect3DDevice9;
 extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
 
-/* Returns the DXGI Adapter and Output indices for the specified display index. 
+/**
+   \brief Returns the DXGI Adapter and Output indices for the specified display index.
+
    These can be passed to EnumAdapters and EnumOutputs respectively to get the objects
    required to create a DX10 or DX11 device and swap chain.
  */
@@ -76,12 +82,16 @@ extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
 /* Platform specific functions for Android */
 #if defined(__ANDROID__) && __ANDROID__
 
-/* Get the JNI environment for the current thread
+/**
+   \brief Get the JNI environment for the current thread
+
    This returns JNIEnv*, but the prototype is void* so we don't need jni.h
  */
 extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv();
 
-/* Get the SDL Activity object for the application
+/**
+   \brief Get the SDL Activity object for the application
+
    This returns jobject, but the prototype is void* so we don't need jni.h
    The jobject returned by SDL_AndroidGetActivity is a local reference.
    It is the caller's responsibility to properly release it
@@ -89,26 +99,33 @@ extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv();
  */
 extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity();
 
-/* See the official Android developer guide for more information:
+/**
+   See the official Android developer guide for more information:
    http://developer.android.com/guide/topics/data/data-storage.html
 */
 #define SDL_ANDROID_EXTERNAL_STORAGE_READ   0x01
 #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE  0x02
 
-/* Get the path used for internal storage for this application.
+/**
+   \brief Get the path used for internal storage for this application.
+
    This path is unique to your application and cannot be written to
    by other applications.
  */
 extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath();
 
-/* Get the current state of external storage, a bitmask of these values:
+/**
+   \brief Get the current state of external storage, a bitmask of these values:
     SDL_ANDROID_EXTERNAL_STORAGE_READ
     SDL_ANDROID_EXTERNAL_STORAGE_WRITE
+
    If external storage is currently unavailable, this will return 0.
 */
 extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState();
 
-/* Get the path used for external storage for this application.
+/**
+   \brief Get the path used for external storage for this application.
+
    This path is unique to your application, but is public and can be
    written to by other applications.
  */
@@ -151,7 +168,7 @@ typedef enum
  *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
  *
  *  \param pathType The type of path to retrieve.
- *  \ret A UCS-2 string (16-bit, wide-char) containing the path, or NULL
+ *  \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL
  *      if the path is not available for any reason.  Not all paths are
  *      available on all versions of Windows.  This is especially true on
  *      Windows Phone.  Check the documentation for the given
@@ -168,7 +185,7 @@ extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path
  *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
  *
  *  \param pathType The type of path to retrieve.
- *  \ret A UTF-8 string (8-bit, multi-byte) containing the path, or NULL
+ *  \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL
  *      if the path is not available for any reason.  Not all paths are
  *      available on all versions of Windows.  This is especially true on
  *      Windows Phone.  Check the documentation for the given

+ 2 - 2
src/core/android/SDL_android.c

@@ -143,9 +143,9 @@ JNIEXPORT void JNICALL SDL_Android_Init(JNIEnv* mEnv, jclass cls)
 /* Resize */
 JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeResize(
                                     JNIEnv* env, jclass jcls,
-                                    jint width, jint height, jint format)
+                                    jint width, jint height, jint format, jfloat rate)
 {
-    Android_SetScreenResolution(width, height, format);
+    Android_SetScreenResolution(width, height, format, rate);
 }
 
 /* Paddown */

+ 1 - 2
src/joystick/haiku/SDL_haikujoystick.cc

@@ -53,8 +53,7 @@ extern "C"
     static int SDL_SYS_numjoysticks = 0;
 
 /* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks.  Joystick 0 should be the system default joystick.
+ * Joystick 0 should be the system default joystick.
  * It should return 0, or -1 on an unrecoverable fatal error.
  */
     int SDL_SYS_JoystickInit(void)

+ 1 - 2
src/joystick/iphoneos/SDL_sysjoystick.m

@@ -37,8 +37,7 @@ const char *accelerometerName = "iOS accelerometer";
 static CMMotionManager *motionManager = nil;
 
 /* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks.  Joystick 0 should be the system default joystick.
+ * Joystick 0 should be the system default joystick.
  * It should return 0, or -1 on an unrecoverable fatal error.
  */
 int

+ 1 - 4
src/joystick/psp/SDL_sysjoystick.c

@@ -97,16 +97,13 @@ int JoystickUpdate(void *data)
 
 
 /* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks.  Joystick 0 should be the system default joystick.
+ * Joystick 0 should be the system default joystick.
  * It should return number of joysticks, or -1 on an unrecoverable fatal error.
  */
 int SDL_SYS_JoystickInit(void)
 {
     int i;
 
-/*  SDL_numjoysticks = 1; */
-
     /* Setup input */
     sceCtrlSetSamplingCycle(0);
     sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);

+ 1 - 2
src/joystick/windows/SDL_mmjoystick.c

@@ -143,8 +143,7 @@ GetJoystickName(int index, const char *szRegKey)
 static int SDL_SYS_numjoysticks = 0;
 
 /* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks.  Joystick 0 should be the system default joystick.
+ * Joystick 0 should be the system default joystick.
  * It should return 0, or -1 on an unrecoverable fatal error.
  */
 int

+ 1 - 2
src/joystick/windows/SDL_windowsjoystick.c

@@ -278,8 +278,7 @@ void SDL_SYS_AddJoystickDevice(JoyStick_DeviceData *device)
 }
 
 /* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks.  Joystick 0 should be the system default joystick.
+ * Joystick 0 should be the system default joystick.
  * It should return 0, or -1 on an unrecoverable fatal error.
  */
 int

+ 5 - 2
src/video/android/SDL_androidvideo.c

@@ -64,6 +64,8 @@ extern int Android_GLES_LoadLibrary(_THIS, const char *path);
 int Android_ScreenWidth = 0;
 int Android_ScreenHeight = 0;
 Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN;
+int Android_ScreenRate = 0;
+
 SDL_sem *Android_PauseSem = NULL, *Android_ResumeSem = NULL;
 
 /* Currently only one window */
@@ -166,7 +168,7 @@ Android_VideoInit(_THIS)
     mode.format = Android_ScreenFormat;
     mode.w = Android_ScreenWidth;
     mode.h = Android_ScreenHeight;
-    mode.refresh_rate = 0;
+    mode.refresh_rate = Android_ScreenRate;
     mode.driverdata = NULL;
     if (SDL_AddBasicVideoDisplay(&mode) < 0) {
         return -1;
@@ -189,11 +191,12 @@ Android_VideoQuit(_THIS)
 
 /* This function gets called before VideoInit() */
 void
-Android_SetScreenResolution(int width, int height, Uint32 format)
+Android_SetScreenResolution(int width, int height, Uint32 format, float rate)
 {
     Android_ScreenWidth = width;
     Android_ScreenHeight = height;
     Android_ScreenFormat = format;
+    Android_ScreenRate = rate;
 
     if (Android_Window) {
         SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height);

+ 1 - 1
src/video/android/SDL_androidvideo.h

@@ -28,7 +28,7 @@
 #include "../SDL_sysvideo.h"
 
 /* Called by the JNI layer when the screen changes size or format */
-extern void Android_SetScreenResolution(int width, int height, Uint32 format);
+extern void Android_SetScreenResolution(int width, int height, Uint32 format, float rate);
 
 /* Private display data */
 

+ 0 - 2
test/testautomation_video.c

@@ -541,7 +541,6 @@ video_getWindowBrightnessNegative(void *arg)
 {
   const char *invalidWindowError = "Invalid window";
   char *lastError;
-  const char* title = "video_getWindowBrightnessNegative Test Window";
   float result;
 
   /* Call against invalid window */
@@ -728,7 +727,6 @@ video_getWindowGammaRamp(void *arg)
 int
 video_getWindowGammaRampNegative(void *arg)
 {
-  const char* title = "video_getWindowGammaRampNegative Test Window";
   Uint16 red[256];
   Uint16 green[256];
   Uint16 blue[256];