SDL Forum Index
SDL
Simple DirectMedia Layer Forums
Reply to topic
Features in SDL for touchscreen devices
pelya


Joined: 27 Nov 2009
Posts: 30
Reply with quote
Hi

When developing Android libSDL port I've added there two features that might be useful
for other ports to mobile platforms (thinking of iPhone mainly):

Resize application to the device screen - i.e. get the app that works only in 320x200 resolution,
and make it stretch video to variety of screen sizes by adding #define when compiling SDL.
My implementation only works with OpenGL ES renderer currently (and I don't think it will be
of any use to platforms other than mobile devices).

On-screen keyboard - basically it will intercept mouse events and send keyboard events instead
when you click on screen area where button should be, plus it will draw overlay buttons inside SDL_Flip().
Each game requires it's own key configuration, so the keyboard is tuned with another set of #defines,
but I consider that better than messing up with the internal game UI and input routines.
The implementation is also works only with OpenGL ES, is not portable and the code needs cleanup,
but that's not hard to do.
An example of that on-screen keyboard can be found on Android Market - check out OpenTyrian or
Ur-Quan Masters game (the graphics may need touch up, and keys sometimes stuck, you may also enjoy
my very first effort by selecting keyboard theme named "Ugly Arrows by pelya").

So, what do you think about porting that features to SDL HG? The majority of games around
uses SDL 1.2, and if you'll develop new game for SDL 1.3 I assume you'll design it touchscreen-friendly
from the very start, so the features will benefit mainly SDL 1.2 branch, but it's kinda frozen.
I'll prepare patches on the request.
View user's profileSend private messageVisit poster's websiteMSN MessengerICQ Number
Features in SDL for touchscreen devices
Jonny D


Joined: 12 Sep 2009
Posts: 736
Reply with quote
Would it be better to release this as a separate library? áIt would be simple enough to replace SDL_Flip with a different call (or separate the calls, like DrawKeyboard(screen)) and do these other things without needing special modification to SDL.

Jonny D


On Fri, Oct 1, 2010 at 5:10 AM, Sergiy Pylypenko wrote:
Quote:
Hi

When developing Android libSDL port I've added there two features that might be useful
for other ports to mobile platforms (thinking of iPhone mainly):

Resize application to the device screen - i.e. get the app that works only in 320x200 resolution,
and make it stretch video to variety of screen sizes by adding #define when compiling SDL.
My implementation only works with OpenGL ES renderer currently (and I don't think it will be
of any use to platforms other than mobile devices).

On-screen keyboard - basically it will intercept mouse events and send keyboard events instead
when you click on screen area where button should be, plus it will draw overlay buttons inside SDL_Flip().
Each game requires it's own key configuration, so the keyboard is tuned with another set of #defines,
but I consider that better than messing up with the internal game UI and input routines.
The implementation is also works only with OpenGL ES, is not portable and the code needs cleanup,
but that's not hard to do.
An example of that on-screen keyboard can be found on Android Market - check out OpenTyrian or
Ur-Quan Masters game (the graphics may need touch up, and keys sometimes stuck, you may also enjoy
my very first effort by selecting keyboard theme named "Ugly Arrows by pelya").

So, what do you think about porting that features to SDL HG? The majority of games around
uses SDL 1.2, and if you'll develop new game for SDL 1.3 I assume you'll design it touchscreen-friendly
from the very start, so the features will benefit mainly SDL 1.2 branch, but it's kinda frozen.
I'll prepare patches on the request.

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

View user's profileSend private messageVisit poster's website
Features in SDL for touchscreen devices
pelya


Joined: 27 Nov 2009
Posts: 30
Reply with quote
You have the point, I'll try to make a library out of screen keyboard. However what about multitouch functionality? SDL still lacks that, and my code resides between HW layer and SDL to process multitouch input.

And screen resizing definitely goes inside SDL (that's just few #ifdefs here and there).

On Fri, Oct 1, 2010 at 2:23 PM, Jonathan Dearborn wrote:
Quote:
Would it be better to release this as a separate library?  It would be simple enough to replace SDL_Flip with a different call (or separate the calls, like DrawKeyboard(screen)) and do these other things without needing special modification to SDL.

Jonny D



On Fri, Oct 1, 2010 at 5:10 AM, Sergiy Pylypenko wrote:


Quote:

Hi

When developing Android libSDL port I've added there two features that might be useful
for other ports to mobile platforms (thinking of iPhone mainly):

Resize application to the device screen - i.e. get the app that works only in 320x200 resolution,
and make it stretch video to variety of screen sizes by adding #define when compiling SDL.
My implementation only works with OpenGL ES renderer currently (and I don't think it will be
of any use to platforms other than mobile devices).

On-screen keyboard - basically it will intercept mouse events and send keyboard events instead
when you click on screen area where button should be, plus it will draw overlay buttons inside SDL_Flip().
Each game requires it's own key configuration, so the keyboard is tuned with another set of #defines,
but I consider that better than messing up with the internal game UI and input routines.
The implementation is also works only with OpenGL ES, is not portable and the code needs cleanup,
but that's not hard to do.
An example of that on-screen keyboard can be found on Android Market - check out OpenTyrian or
Ur-Quan Masters game (the graphics may need touch up, and keys sometimes stuck, you may also enjoy
my very first effort by selecting keyboard theme named "Ugly Arrows by pelya").

So, what do you think about porting that features to SDL HG? The majority of games around
uses SDL 1.2, and if you'll develop new game for SDL 1.3 I assume you'll design it touchscreen-friendly
from the very start, so the features will benefit mainly SDL 1.2 branch, but it's kinda frozen.
I'll prepare patches on the request.



_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

View user's profileSend private messageVisit poster's websiteMSN MessengerICQ Number
Features in SDL for touchscreen devices
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic