Fixed horizontal screen orientation + resizing

This commit is contained in:
pelya
2010-06-11 15:48:24 +03:00
parent 0cc3384649
commit 09afe74eed
4 changed files with 13 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
AppName="Alien Blaster"
AppFullName=de.schwardtnet.alienblaster
ScreenOrientation=v
ScreenOrientation=h
AppDataDownloadUrl="http://sites.google.com/site/xpelyax/Home/alienblaster110_data.zip?attredirects=0&d=1"
DownloadToSdcard=n
SdlVideoResize=y

View File

@@ -126,6 +126,7 @@ mv -f project/res/values/strings.xml.1 project/res/values/strings.xml
touch project/jni/sdl_main/*.c
touch project/jni/sdl/src/video/android/*.c
touch project/jni/sdl/src/video/SDL_video.c
touch project/jni/sdl/src/video/SDL_renderer_gles.c
touch project/jni/sdl/src/audio/android/*.c
rm -f project/libs/armeabi/libapplication.so project/libs/armeabi/libsdl.so project/libs/armeabi/libsdl_main.so

View File

@@ -6,7 +6,7 @@
<application android:label="@string/app_name">
<activity android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:screenOrientation="landscape"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@@ -314,6 +314,10 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags)
data->GL_OES_draw_texture_supported = SDL_FALSE;
data->useDrawTexture = SDL_FALSE;
}
#ifdef ANDROID
data->GL_OES_draw_texture_supported = SDL_TRUE;
data->useDrawTexture = SDL_TRUE;
#endif
#endif
data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
@@ -890,7 +894,12 @@ GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
cropRect[3] = -srcrect->h;
data->glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES,
cropRect);
data->glDrawTexiOES(dstrect->x, window->h - dstrect->y - dstrect->h,
data->glDrawTexiOES(dstrect->x,
#if SDL_VIDEO_RENDER_RESIZE
window->display->current_mode.h - dstrect->y - dstrect->h,
#else
window->h - dstrect->y - dstrect->h,
#endif
0, dstrect->w, dstrect->h);
} else {