Hi
I am a developer and I am trying to port an sdl game from ipad to android.
I am stuck on a weird thing that you may know how to go around.
I use windows 7, 64bit. Eclipse 3.7.2.
Latest android SDK and NDK r8b.
I use the android example by latest SDL HG.
I do this on Android 2.2.
The example works ok but:
The problem is that ‘SDL_CreateWindow’ always gives a 16bit color context
and I need 32bit.
Its pixel format RGB_565 which is the default I heard.
I need pixel format RGBA_8888 but it doesnt switch.
I tried in c++:
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
with no change.
I tried in SDLActivity.java in ‘onCreate’ before 'setContentView’
getWindow().setFormat(PixelFormat.RGBA_8888);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);
no change at all.
It keeps choosing: ‘PixelFormat.RGB_565’ in ‘surfaceChanged’.
Can you help me?
Can that change to RGBA_8888?
Or is RGB_565 hard-coded somewhere inside the SDL code?
Hi
I am a developer and I am trying to port an sdl game from ipad to android.
I am stuck on a weird thing that you may know how to go around.
I use windows 7, 64bit. Eclipse 3.7.2.
Latest android SDK and NDK r8b.
I use the android example by latest SDL HG.
I do this on Android 2.2.
The example works ok but:
The problem is that ‘SDL_CreateWindow’ always gives a 16bit color context
and I need 32bit.
Its pixel format RGB_565 which is the default I heard.
I need pixel format RGBA_8888 but it doesnt switch.
I tried in c++:
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
with no change.
I tried in SDLActivity.java in ‘onCreate’ before 'setContentView’
getWindow().setFormat(PixelFormat.RGBA_8888);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);
no change at all.
It keeps choosing: ‘PixelFormat.RGB_565’ in ‘surfaceChanged’.
Can you help me?
Can that change to RGBA_8888?
Or is RGB_565 hard-coded somewhere inside the SDL code?
I use the latest build of SDL HG and SDL2_mixer.
I made a library ‘libSDL2_mixer.so’ and a ‘libtremor.a’ with the SDL
example in android.
I target 2.2 android.
I read the ogg vorbis file from the SD card.
When I play an OGG vorbis music file on my Nexus One phone (running 2.3
android) it works ok.
When I play the same file on my Samsung Galaxy II tablet (running ICS
4.0.3 android) it plays fine but when I exit the app (with java’s
’finish()’) and relead the game I hear the music distorted like echoing.
This does not happen all the time. Half times it does and half not.
Hi again,
Can anyone help me out with this SDL_mixer issue in android?
I use the latest build of SDL HG and SDL2_mixer.
I made a library ‘libSDL2_mixer.so’ and a ‘libtremor.a’ with the SDL
example in android.
I target 2.2 android.
I read the ogg vorbis file from the SD card.
When I play an OGG vorbis music file on my Nexus One phone (running 2.3
android) it works ok.
When I play the same file on my Samsung Galaxy II tablet (running ICS
4.0.3 android) it plays fine but when I exit the app (with java’s
’finish()’) and relead the game I hear the music distorted like echoing
(Its like a helicopter sound!!). This does not happen all the time. Half
times it does and half not.