mirror of
https://github.com/encounter/SDL.git
synced 2025-12-14 07:36:09 +00:00
Fixed missing prototypes on Android, patch from Sylvain
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
|
||||
#include "SDL_androidvideo.h"
|
||||
|
||||
#include "SDL_androidclipboard.h"
|
||||
#include "../../core/android/SDL_android.h"
|
||||
|
||||
int
|
||||
|
||||
@@ -29,19 +29,12 @@
|
||||
#include "SDL_events.h"
|
||||
#include "SDL_androidwindow.h"
|
||||
|
||||
/* Can't include sysaudio "../../audio/android/SDL_androidaudio.h"
|
||||
* because of THIS redefinition */
|
||||
extern void ANDROIDAUDIO_ResumeDevices(void);
|
||||
extern void ANDROIDAUDIO_PauseDevices(void);
|
||||
|
||||
void android_egl_context_backup();
|
||||
void android_egl_context_restore();
|
||||
|
||||
#if SDL_AUDIO_DRIVER_ANDROID
|
||||
void ANDROIDAUDIO_ResumeDevices(void);
|
||||
void ANDROIDAUDIO_PauseDevices(void);
|
||||
#else
|
||||
static void ANDROIDAUDIO_ResumeDevices(void) {}
|
||||
static void ANDROIDAUDIO_PauseDevices(void) {}
|
||||
#endif
|
||||
|
||||
void
|
||||
static void
|
||||
android_egl_context_restore()
|
||||
{
|
||||
SDL_Event event;
|
||||
@@ -55,7 +48,7 @@ android_egl_context_restore()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
android_egl_context_backup()
|
||||
{
|
||||
/* Keep a copy of the EGL Context so we can try to restore it when we resume */
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "SDL_androidwindow.h"
|
||||
|
||||
#include "SDL_androidvideo.h"
|
||||
#include "SDL_androidgl.h"
|
||||
#include "../../core/android/SDL_android.h"
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
34
src/video/android/SDL_androidgl.h
Normal file
34
src/video/android/SDL_androidgl.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#ifndef _SDL_androidgl_h
|
||||
#define _SDL_androidgl_h
|
||||
|
||||
SDL_GLContext Android_GLES_CreateContext(_THIS, SDL_Window * window);
|
||||
int Android_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
|
||||
void Android_GLES_SwapWindow(_THIS, SDL_Window * window);
|
||||
int Android_GLES_LoadLibrary(_THIS, const char *path);
|
||||
|
||||
|
||||
#endif /* _SDL_androidgl_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -23,12 +23,12 @@
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
|
||||
#include "SDL_messagebox.h"
|
||||
#include "SDL_androidmessagebox.h"
|
||||
#include "../../core/android/SDL_android.h"
|
||||
|
||||
int
|
||||
Android_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
|
||||
{
|
||||
int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
|
||||
|
||||
return Android_JNI_ShowMessageBox(messageboxdata, buttonid);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "../../events/SDL_windowevents_c.h"
|
||||
|
||||
#include "SDL_androidvideo.h"
|
||||
#include "SDL_androidgl.h"
|
||||
#include "SDL_androidclipboard.h"
|
||||
#include "SDL_androidevents.h"
|
||||
#include "SDL_androidkeyboard.h"
|
||||
@@ -47,11 +48,6 @@ static int Android_VideoInit(_THIS);
|
||||
static void Android_VideoQuit(_THIS);
|
||||
|
||||
#include "../SDL_egl_c.h"
|
||||
/* GL functions (SDL_androidgl.c) */
|
||||
extern SDL_GLContext Android_GLES_CreateContext(_THIS, SDL_Window * window);
|
||||
extern int Android_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
|
||||
extern void Android_GLES_SwapWindow(_THIS, SDL_Window * window);
|
||||
extern int Android_GLES_LoadLibrary(_THIS, const char *path);
|
||||
#define Android_GLES_GetProcAddress SDL_EGL_GetProcAddress
|
||||
#define Android_GLES_UnloadLibrary SDL_EGL_UnloadLibrary
|
||||
#define Android_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
|
||||
@@ -65,7 +61,7 @@ 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;
|
||||
static int Android_ScreenRate = 0;
|
||||
|
||||
SDL_sem *Android_PauseSem = NULL, *Android_ResumeSem = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user