


SdlVideoResize=y
SdlVideoResizeKeepAspect=y
NeedDepthBuffer=n
SwVideoMode=y
AppUsesMouse=n
AppNeedsTwoButtonMouse=n
AppNeedsArrowKeys=n
AppNeedsTextInput=y
AppUsesJoystick=y
AppHandlesJoystickSensitivity=y
AppUsesMultitouch=n
NonBlockingSwapBuffers=n
RedefinedKeys="SPACE RETURN LCTRL LALT SPACE"
AppTouchscreenKeyboardKeysAmount=0
AppTouchscreenKeyboardKeysAmountAutoFire=0
RedefinedKeysScreenKb="SPACE RETURN LCTRL LALT"
I/libSDL (13818): > display_sdl.c/display_init(): number of joysticks available : 1
I/libSDL (13818): - joystick : Android accelerometer/orientation sensor
I/libSDL (13818): - axes : 3
I/libSDL (13818): - buttons : 0
I/libSDL (13818): - trackballs: 0
I/libSDL (13818): - hats : 0



That's not intended, I think I'll fix that by sending fake touch event to EditText control.
Also, what place in a code you have on your mind?
Those keys are defined in ChangeAppSettings.sh, then in SDL_androidinput.h, then used in both SDL_androidinput.c and SDL_touchscreenkeyboard.c. And also you may re-map them through SDL config menu (ChangeAppSettings.sh gives you only 4 most common keys, so if user has unusual key like Camera for example he can make it return some SDL keycode).
Last 4 keycodes are generated when you do multitouch gesture - zoom in/out or rotate left/right, I've decided that it's better to pass them to app as keypress events rather than some obscure joystick or mouse wheel events.
The double-buffering is not supported in SDL itself, and I think I won't add it because most apps arent' using it anyway. And if by some chance an app properly uses double-buffered SW mode it's much easier to make it HW-accelerated by adding SDL_HWSURFACE flag everywhere, which will give an instant speed gain.


kurosu wrote:Following your work on this new API: text entry might not yet have text set, so calling SDL_ANDROID_GetScreenKeyboardTextInput will start with garbage. Once edited, the proper text seems to have been inserted, but there is in fact invisible garbage in front of it. And indeed 2nd call for SDL_ANDROID_GetScreenKeyboardTextInput starts with garbage (previous text not yet saved). pressing ok then no longer yields the text actually typed, but another kind of garbage.
kurosu wrote:Another note: on my phone, the physical camera button being pressed causes the camera keycode to be generated,g but releasing it generates focus keycode! To avoid disruption, i therefore set it to SDL_KEY(UNKNOWN)
Maybe having a section in the readme could help, but i was more thinking of modifying of modifying the script directly. btw, if you want the echo command to interpret '\n' you should call it with -e (ie echo -ne in your case).
8 is del, 9 is search and 10 is call. Those are mappable buttons afaik, so mapping them to multitouch gesture seems strange to me. Do you mean such key events are generated when a multitouch even occurs? Not that I care in my case, but i would probably prefer to map del/search/call to some actions, and then the multitouch events to something additional.

The h/w mode seems now more feasible for me, but I'm wondering... Firstly, I'm currently using sdl_gfx for drawing some shapes (rectangle, antialiased lines, box, polygon, ...) and rotozooming sprites. All of those are interfering with hw surface, and rotozoom can't be emulated using sdl 1.2 (only zooming, no rotation in 1.3) - all of this needs direct use of opengl. Secondly, I'm editing rather often the textures (i divide a map to display into 64x64 tiles which are the ones updated): do you think that might kill performance or is still practical (use of Lock / edit pixels / Unlock) ?
).cpasjuste wrote:In the meantime, i'm trying to play with another sdl project. I do have a problem, i can't get any joystick to work, no joystick overlay is shown on the screen.
is there a way to define all the variables found in the settings menu manually ? And maybe prevent the user from accessing them ? For example i would need to set the mouse as relative maunally.

pelya wrote:Did you initialize the output buffer before calling SDL_ANDROID_GetScreenKeyboardTextInput()? (sorry for a stupid question).
That's rather a device manufacturer' failure
BTW how is it generated? Camera down+up events on keypress, and Focus Down+Up events on release? Or Camera Down, then Focus Up?
You can bind different keycodes to hardware keys and to on-screen keys (including multitouch gestures) from ChangeAppSettings.sh . The multitouch gestures will return same keycodes as Del, Search and Call only when you not redefine them, or give less than 10 keycodes to ChangeAppSettings.sh.
That's kinda non-obvious, but I'm always accepting patches
If you're updating several small 64x64 tiles per frame it will be faster indeed then updating one big 640x480 texture (that's what SDL does in SW mode)
however rotating and zooming is CPU-intensive.
I don't want to give you any false advice, because the effort of making all things HW-accelerated might not be worth the performance gain (and by the time you'll do it everyone will get new fast device that run it comfortably even without acceleration, that's what usually happens).
Also I'm planning to include support for libjnigraphics, that might give another 10% acceleration for SW-only mode.

kurosu wrote:However, there's still garbage on the start of the returned string, consisting only of character 0x08.


_videoLayout = new FrameLayout(this);
mGLView = new DemoGLSurfaceView(this);
_videoLayout.addView(mGLView, new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
_videoLayout.addView(adView, new LayoutParams(LayoutParams.WRAP_CONTENT
, LayoutParams.WRAP_CONTENT));
mGLView.setFocusableInTouchMode(true);
mGLView.setFocusable(true);
adView.requestFreshAd();
setContentView(_videoLayout,
new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
mGLView.requestFocus();



kurosu wrote:SDL_ANDROID_TextInputInit() needs to do "textInputBufferPos = 0;"


pelya wrote:Also libjnigraphics is reported to work on some 2.1 devices, so I'll let user to enable/disable it.

V/SDL ( 5210): GLSurfaceView_SDL::onPause()
[some random logcat]
I/libSDL ( 5210): OpenGL context lost, waiting for new OpenGL context
V/SDL ( 5210): GLSurfaceView_SDL::EglHelper::finish(): destroying GL context
I/ ( 5210): libGLESv1_CM_fimg.so was unloaded and GLES 1.1 API was succes
sfully unmapped
I/warmux ( 5210): Pause: entering, state=7
I/warmux ( 5210): Dropping event 24
D/dalvikvm( 1949): GC freed 5386 objects / 319824 bytes in 149ms
D/LockScreen( 1949): onResume emer button : MotionEvent=MotionEvent{443da2a8 action=2 x=-60.0 y=-100.0 pressure=1.0 size=1.0}D/LockScreen( 1949): onResume emer button : MotionEvent=MotionEvent{44154458 action=2 x=-60.0 y=-100.0 pressure=1.0 size=1.0}
V/SDL ( 5210): GLSurfaceView_SDL::onResume()
[some key events as I'm unlocking screen]
I/warmux ( 5210): Dropping event 4
I/warmux ( 5210): Dropping event 5
I/warmux ( 5210): Dropping event 4
Return to Code Snippets for Android
Users browsing this forum: JanRusson and 10 guests