Ryan C. Gordon | 1 Jul 01:21 2011

Re: Does current SDL 1.2 work OK on new Mac OS X Lion ?


> Does current SDL 1.2 work OK on new Mac OS X Lion ?
>
> Just wondering as my games use SDL 1.2 still...

Apparently it's broken at the moment unless you're using 
SDL_SetVideoMode(..., SDL_OPENGL).

Software-rendering games are all going to be broken and need updates for 
10.7, unfortunately, but once we fix this, it should only need a new 
libSDL dropped in to replace the old one.

SDL 1.3 should work fine on Lion.

--ryan.
josebagar | 1 Jul 04:07 2011
Picon

Crash in iPad with iOS 3.2

Hi!

I just found that SDL is crashing in the iPad simulator for iOS 3.2 but not for iOS 4.2 or over when compiling with Xcode 4.0.2.
The Xcode debugger points to line 127 in video/uikit/SDL_uikitopenglview.m as the line that triggers the crash.
On those lines one can find:







Code:
        /* Use the main screen scale (for retina display support) */
        if ([[UIScreen mainScreen] respondsToSelector: <at> selector(scale)])
                self.contentScaleFactor = [UIScreen mainScreen].scale;
I believe the problem to be that -contrarily to what Apple docs appear to state- the "scale" selector is supported in iOS 3.2 in the iPad, but contentScaleFactor is not.
I'm no expert in Objective-C, but I believe the following code to be more correct (it doesn't crash for me):







Code:
        /* Use the main screen scale (for retina display support) */
        if ([[UIScreen mainScreen] respondsToSelector: <at> selector(scale)] && [self respondsToSelector: <at> selector(contentScaleFactor)])
                self.contentScaleFactor = [UIScreen mainScreen].scale;
The same check is being performed in line 155 so I imagine it will crash there, too.

I've filed a bug with this same info in Bugzilla:
http://bugzilla.libsdl.org/show_bug.cgi?id=1239
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Ryan C. Gordon | 1 Jul 06:27 2011

Re: SDL, Allegro Android existential question :) ?


> I look the Android porject from Sam and I wondering how progressed the
> lib have been migrated ? it is finalised or this still need some work on
> it ?

I haven't tried it, but I assume it needs work, as the 1.3 API is still 
being improved on all platforms.

> how it is hard to pass from Allegro 4.4 to SDL 1.2 or SDL 1.3 ?

I don't know. Last time I looked at Allegro, it was much higher level 
than SDL...SDL is mostly concerned with giving a decent abstraction over 
platform-specific APIs, whereas Allegro seems to be more of a full 
toolkit of random stuff.

> if this port allow dev into native C/C++ application with SDL over
> Android ? (it is working over Android Java glue ? or directly access
> ressources via kind or driver !)

You write your app in C or C++. SDL provides a small piece of Java that 
calls into a JNI function, which transfers control to your main() function.

--ryan.
Eric Wing | 1 Jul 10:07 2011
Picon

Re: Crash in iPad with iOS 3.2

I'm speaking from memory at the moment, but I think you want to use contentScaleFactor exclusively; don't use scale.

Basically:

float my_scale_factor = 1.0;
if([your_ui_view respondsToSelector: <at> selector(contentScaleFactor)]
{
    my_scale_factor = [your_ui_view contentScaleFactor];

}

-Eric





On Thu, Jun 30, 2011 at 7:07 PM, josebagar <joseba.gar <at> gmail.com> wrote:
Hi!

I just found that SDL is crashing in the iPad simulator for iOS 3.2 but not for iOS 4.2 or over when compiling with Xcode 4.0.2.
The Xcode debugger points to line 127 in video/uikit/SDL_uikitopenglview.m as the line that triggers the crash.
On those lines one can find:


Code:


        /* Use the main screen scale (for retina display support) */
        if ([[UIScreen mainScreen] respondsToSelector: <at> selector(scale)])
                self.contentScaleFactor = [UIScreen mainScreen].scale;


I believe the problem to be that -contrarily to what Apple docs appear to state- the "scale" selector is supported in iOS 3.2 in the iPad, but contentScaleFactor is not.
I'm no expert in Objective-C, but I believe the following code to be more correct (it doesn't crash for me):


Code:


        /* Use the main screen scale (for retina display support) */
        if ([[UIScreen mainScreen] respondsToSelector: <at> selector(scale)] && [self respondsToSelector: <at> selector(contentScaleFactor)])
                self.contentScaleFactor = [UIScreen mainScreen].scale;


The same check is being performed in line 155 so I imagine it will crash there, too.

I've filed a bug with this same info in Bugzilla:
http://bugzilla.libsdl.org/show_bug.cgi?id=1239

_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
josebagar | 1 Jul 10:59 2011
Picon

Re: Crash in iPad with iOS 3.2 (contentScaleFactor unimplemtd)

Sorry, I didn't explain myself correctly.
The crash occurs in SDL code (here). I'm working with an interpreted game engine built on top of SDL and the crash occurs when setting the video mode, I'm not writing any Objective-C code myself.

Joseba
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
宋江山 | 1 Jul 15:25 2011
Picon

SDL_PollEvent not return until tslib touching up?

I'm using SDL on a embedded linux system.
I compiled the SDL version 1.2.14.
The input is tslib touch.
I call the SDL_PollEvent function something like below:

=======================
while(1)
{
   if (SDL_PollEvent(&event))
  {
   // deal event
  }

  // do something else
}
========================

The problem is that:
when i touch the screen, and move my figure on the screen, the SDL
cursor moves with my figure, but the SDL_PollEvent function will not
return until i remove my figure from the touch screen. I can not
handle the touch (mouse) move event immediately.

It looks like SDL_mutexP function probelm?

Does anyone meet the same problem?
Or any suggestion?

--

-- 
Best wishes,
Jiangshan
Sami Näätänen | 1 Jul 16:28 2011
Picon

Re: SDL_WINDOWEVENT_EXPOSED

On 9.6.2011 18:12, Andreas Schiffler wrote:
> I think switching to SDL_Rect would be poor design, as it would be a 
> semantic overload of SDL_Rect ... for resize and move events the 
> SDL_Rect "object" would really be invalid (as it does not describe a 
> "Rect" anymore). It would also break any existing code relying on the 
> data1 and data2 fields.
>
> One should extend SDL_WindowEvent like this:
>
> typedef struct SDL_WindowEvent
> {
>      Uint8 type;
>      Uint8 event;
>      int data1;
>      int data2;
>      SDL_WindowID windowID;
>      int data3; // append, so cast can be done without affecting windowID
>      int data4;
> } SDL_WindowEvent;
<removed content>
> Cheers,
> Andreas
>

It would be better to go through all the structs of SDL 1.3 as it is 
starting to creap closer to first official release and add some reserved 
bytes at the end of the structs.

This would in most cases allow ABI independent extensions in the future 
without severly breaking existing programs (ie no need to recompile for 
the new version if the new features are not used).

As most likely there will come cases where the current structs need 
extending, after SDL 1.3 has been released and it will be selected as 
the base for more and more applications. Where breaking the ABI would be 
quite anoying.

Cheers,
Sami
Brian Barnes | 1 Jul 19:11 2011
Picon

SDL 1.3 and Relative Mouse Movement

Any update on this?  I was thinking it was time for me to try 1.3 again, 
but relative mouse movement was the big missing feature for me.  Has 
this gotten working on OS X/Windows yet?

[>] Brian
josebagar | 1 Jul 21:46 2011
Picon

Re: Crash in iPad with iOS 3.2 (contentScaleFactor unimplemtd)

To say it in other words: just downloading the SDL source code from HG and compiling and running the testsdl scheme in the ipad 3.2 simulator crashes.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Nikos Chantziaras | 2 Jul 02:20 2011
Picon

glibc terminates all applications using SDL_mixer when playing MIDI

A few days ago, some update got performed by my Linux distro (Gentoo) 
which made glibc abort programs with a message like:

*** glibc detected *** /var/tmp/portage/SDL_mixer/build/.libs/playmus: 
free(): invalid pointer: 0x00000000012b0b80 ***

Programs using SDL_mixer to play MIDI (using the Timidity backend) are 
affected, including the "playmus" sample program that comes with 
SDL_mixer.  This happens with both SDL_mixer 1.2.11 as well as latest 
sources from Hg.  Running valgrind on playmus doesn't work (it just 
quits for some reason).  Running it on my own app, produces this:

(I deleted references to my own sources to make this smaller.)

==23754== Conditional jump or move depends on uninitialised value(s)
==23754==    at 0x4C2A569: groom_list (readmidi.c:692)
==23754==    by 0x4C2B8E1: read_midi_file (readmidi.c:1079)
==23754==    by 0x4C286E3: Timidity_LoadSong_RW (playmidi.c:1732)
==23754==    by 0x4C1C262: Mix_LoadMUS_RW (music.c:1501)
==23754==

==23754== Invalid write of size 2
==23754==    at 0x4C1F4F9: load_instrument (instrum.c:805)
==23754==    by 0x4C1FBBC: fill_bank (instrum.c:908)
==23754==    by 0x4C1FF21: load_missing_instruments (instrum.c:995)
==23754==    by 0x4C28723: Timidity_Start (playmidi.c:1744)
==23754==    by 0x4C1BA77: music_internal_play (music.c:787)
==23754==    by 0x4C1BBF3: Mix_FadeInMusicPos (music.c:874)
==23754==    by 0x4C1BC55: Mix_PlayMusic (music.c:885)
==23754==  Address 0x4fb9754 is 37,764 bytes inside a block of size 
37,765 alloc'd
==23754==    at 0x4A076AD: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23754==    by 0x4C1C949: safe_malloc (common.c:218)
==23754==    by 0x4C1EF6B: load_instrument (instrum.c:689)
==23754==    by 0x4C1FBBC: fill_bank (instrum.c:908)
==23754==    by 0x4C1FF21: load_missing_instruments (instrum.c:995)
==23754==    by 0x4C28723: Timidity_Start (playmidi.c:1744)
==23754==    by 0x4C1BA77: music_internal_play (music.c:787)
==23754==    by 0x4C1BBF3: Mix_FadeInMusicPos (music.c:874)
==23754==    by 0x4C1BC55: Mix_PlayMusic (music.c:885)
==23754==
==23754== Invalid write of size 2
==23754==    at 0x4C1F4F9: load_instrument (instrum.c:805)
==23754==    by 0x4C1FBBC: fill_bank (instrum.c:908)
==23754==    by 0x4C1FF50: load_missing_instruments (instrum.c:997)
==23754==    by 0x4C28723: Timidity_Start (playmidi.c:1744)
==23754==    by 0x4C1BA77: music_internal_play (music.c:787)
==23754==    by 0x4C1BBF3: Mix_FadeInMusicPos (music.c:874)
==23754==    by 0x4C1BC55: Mix_PlayMusic (music.c:885)
==23754==  Address 0x708f350 is 9,904 bytes inside a block of size 9,905 
alloc'd
==23754==    at 0x4A076AD: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23754==    by 0x4C1C949: safe_malloc (common.c:218)
==23754==    by 0x4C1EF6B: load_instrument (instrum.c:689)
==23754==    by 0x4C1FBBC: fill_bank (instrum.c:908)
==23754==    by 0x4C1FF50: load_missing_instruments (instrum.c:997)
==23754==    by 0x4C28723: Timidity_Start (playmidi.c:1744)
==23754==    by 0x4C1BA77: music_internal_play (music.c:787)
==23754==    by 0x4C1BBF3: Mix_FadeInMusicPos (music.c:874)
==23754==    by 0x4C1BC55: Mix_PlayMusic (music.c:885)
==23754==
==23754== Invalid read of size 2
==23754==    at 0x4C2CB85: pre_resample (resample.c:726)
==23754==    by 0x4C1F670: load_instrument (instrum.c:834)
==23754==    by 0x4C1FBBC: fill_bank (instrum.c:908)
==23754==    by 0x4C1FF50: load_missing_instruments (instrum.c:997)
==23754==    by 0x4C28723: Timidity_Start (playmidi.c:1744)
==23754==    by 0x4C1BA77: music_internal_play (music.c:787)
==23754==    by 0x4C1BBF3: Mix_FadeInMusicPos (music.c:874)
==23754==    by 0x4C1BC55: Mix_PlayMusic (music.c:885)
==23754==  Address 0x65031be is 52,830 bytes inside a block of size 
52,831 alloc'd
==23754==    at 0x4A076AD: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23754==    by 0x4C1C949: safe_malloc (common.c:218)
==23754==    by 0x4C1EF6B: load_instrument (instrum.c:689)
==23754==    by 0x4C1FBBC: fill_bank (instrum.c:908)
==23754==    by 0x4C1FF50: load_missing_instruments (instrum.c:997)
==23754==    by 0x4C28723: Timidity_Start (playmidi.c:1744)
==23754==    by 0x4C1BA77: music_internal_play (music.c:787)
==23754==    by 0x4C1BBF3: Mix_FadeInMusicPos (music.c:874)
==23754==    by 0x4C1BC55: Mix_PlayMusic (music.c:885)

(Audio starts playing after this point.)

==23754== Thread 2:
==23754== Conditional jump or move depends on uninitialised value(s)
==23754==    at 0x4C228FA: s32tos16 (output.c:82)
==23754==    by 0x4C27A66: compute_data (playmidi.c:1484)
==23754==    by 0x4C284C3: Timidity_PlaySome (playmidi.c:1663)
==23754==    by 0x4C1B4D6: music_mixer (music.c:292)
==23754==    by 0x4C1818D: mix_channels (mixer.c:300)
==23754==    by 0x3034A07E97: SDL_RunAudio (SDL_audio.c:198)
==23754==    by 0x3034A10214: SDL_RunThread (SDL_thread.c:204)
==23754==    by 0x3034A45358: RunThread (SDL_systhread.c:47)
==23754==    by 0x3002206D4B: start_thread (pthread_create.c:301)
==23754==    by 0x30016D12AC: clone (clone.S:115)
==23754==
==23754== Conditional jump or move depends on uninitialised value(s)
==23754==    at 0x4C2290C: s32tos16 (output.c:83)
==23754==    by 0x4C27A66: compute_data (playmidi.c:1484)
==23754==    by 0x4C284C3: Timidity_PlaySome (playmidi.c:1663)
==23754==    by 0x4C1B4D6: music_mixer (music.c:292)
==23754==    by 0x4C1818D: mix_channels (mixer.c:300)
==23754==    by 0x3034A07E97: SDL_RunAudio (SDL_audio.c:198)
==23754==    by 0x3034A10214: SDL_RunThread (SDL_thread.c:204)
==23754==    by 0x3034A45358: RunThread (SDL_systhread.c:47)
==23754==    by 0x3002206D4B: start_thread (pthread_create.c:301)
==23754==    by 0x30016D12AC: clone (clone.S:115)

Gmane