mirror of https://github.com/encounter/SDL.git
Android: try to fix resize with software rendering (bug 4669)
This commit is contained in:
parent
8a20d40d90
commit
12b92260cc
|
@ -82,6 +82,11 @@ SW_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
|
||||||
static int
|
static int
|
||||||
SW_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
|
SW_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
|
||||||
{
|
{
|
||||||
|
#if defined(ANDROID)
|
||||||
|
extern void Android_GetScreenResolution(int *w, int *h);
|
||||||
|
Android_GetScreenResolution(w, h);
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
SDL_Surface *surface = SW_ActivateRenderer(renderer);
|
SDL_Surface *surface = SW_ActivateRenderer(renderer);
|
||||||
|
|
||||||
if (surface) {
|
if (surface) {
|
||||||
|
@ -96,6 +101,7 @@ SW_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
|
||||||
SDL_SetError("Software renderer doesn't have an output surface");
|
SDL_SetError("Software renderer doesn't have an output surface");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -237,6 +237,18 @@ Android_SetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth
|
||||||
Android_ScreenRate = (int)rate;
|
Android_ScreenRate = (int)rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Android_GetScreenResolution(int *w, int *h)
|
||||||
|
{
|
||||||
|
if (w) {
|
||||||
|
*w = Android_SurfaceWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (h) {
|
||||||
|
*h = Android_SurfaceHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Android_SendResize(SDL_Window *window)
|
void Android_SendResize(SDL_Window *window)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
/* Called by the JNI layer when the screen changes size or format */
|
/* Called by the JNI layer when the screen changes size or format */
|
||||||
extern void Android_SetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, Uint32 format, float rate);
|
extern void Android_SetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, Uint32 format, float rate);
|
||||||
extern void Android_SendResize(SDL_Window *window);
|
extern void Android_SendResize(SDL_Window *window);
|
||||||
|
extern void Android_GetScreenResolution(int *w, int *h);
|
||||||
|
|
||||||
/* Private display data */
|
/* Private display data */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue