Trouble with SDL + OpenFeint on iPhone

I’m trying to integrate OpenFeint with SDL for an iPhone game. It mostly
appears to work except one detail - I can’t tap on any entries in the
tableviews in the OF Dashboard. Essentially things like friends list,
leaderboard lists, chat room lists etc don’t register clicks. I can move
the position in the tables just fine.

Has anyone else tried to integrate OpenFeint (or alternative, any
tableview) with SDL on the iPhone and if so, did you manage to get it to
work?

Some more research using a simple example shows that even a basic TableView
doesn’t work - essentially no clicks are registered. If after creating the
tableview I run my own loop such as this:

while(true) {
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, FALSE);
};

I can actually get clicks to register. This work around doesn’t work with
OpenFeint however - it just makes it worse. Weird. I suppose most people
avoid using native iPhone UI combined with SDL.On Sun, Jan 10, 2010 at 01:00, David Hedbor <@David_Hedbor> wrote:

I’m trying to integrate OpenFeint with SDL for an iPhone game. It mostly
appears to work except one detail - I can’t tap on any entries in the
tableviews in the OF Dashboard. Essentially things like friends list,
leaderboard lists, chat room lists etc don’t register clicks. I can move the
position in the tables just fine.

Has anyone else tried to integrate OpenFeint (or alternative, any
tableview) with SDL on the iPhone and if so, did you manage to get it to
work?

And to answer my own email, again, I did get it working. In my main event
loop, I call the following method:

void RunOpenFeintLoopIfNeeded() {
while(dashboardVisible) {
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, TRUE);
};
}

The dashboardVisible boolean is set from the OpenFeintDelegate when the
dashboard is shown/hidden. Works perfectly.On Mon, Jan 11, 2010 at 22:33, David Hedbor wrote:

Some more research using a simple example shows that even a basic TableView
doesn’t work - essentially no clicks are registered. If after creating the
tableview I run my own loop such as this:

while(true) {
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, FALSE);
};

I can actually get clicks to register. This work around doesn’t work with
OpenFeint however - it just makes it worse. Weird. I suppose most people
avoid using native iPhone UI combined with SDL.

On Sun, Jan 10, 2010 at 01:00, David Hedbor <@David_Hedbor> wrote:

I’m trying to integrate OpenFeint with SDL for an iPhone game. It mostly
appears to work except one detail - I can’t tap on any entries in the
tableviews in the OF Dashboard. Essentially things like friends list,
leaderboard lists, chat room lists etc don’t register clicks. I can move the
position in the tables just fine.

Has anyone else tried to integrate OpenFeint (or alternative, any
tableview) with SDL on the iPhone and if so, did you manage to get it to
work?

Great, I’m glad you got it working! :)On Mon, Jan 11, 2010 at 11:12 PM, David Hedbor wrote:

And to answer my own email, again, I did get it working. In my main event
loop, I call the following method:

void RunOpenFeintLoopIfNeeded() {
??? while(dashboardVisible) {
??? ??? CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, TRUE);
??? };
}

The dashboardVisible boolean is set from the OpenFeintDelegate when the
dashboard is shown/hidden. Works perfectly.

On Mon, Jan 11, 2010 at 22:33, David Hedbor wrote:

Some more research using a simple example shows that even a basic
TableView doesn’t work - essentially no clicks are registered. If after
creating the tableview I run my own loop such as this:

while(true) {
?? ??? CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, FALSE);
};

I can actually get clicks to register.? This work around doesn’t work with
OpenFeint however - it just makes it worse. Weird. I suppose most people
avoid using native iPhone UI combined with SDL.

On Sun, Jan 10, 2010 at 01:00, David Hedbor wrote:

I’m trying to integrate OpenFeint with SDL for an iPhone game. It mostly
appears to work except one detail - I can’t tap on any entries in the
tableviews in the OF Dashboard. Essentially things like friends list,
leaderboard lists, chat room lists etc don’t register clicks. I can move the
position in the tables just fine.

Has anyone else tried to integrate OpenFeint (or alternative, any
tableview) with SDL on the iPhone and if so, did you manage to get it to
work?


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


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

good job on getting this framework to work!
do you think you could post a little tutorial on how to merge sdl and
openfeint in an iphone project?
VittorioOn Tue, Jan 12, 2010 at 8:12 AM, David Hedbor wrote:

And to answer my own email, again, I did get it working. In my main event
loop, I call the following method:

void RunOpenFeintLoopIfNeeded() {
while(dashboardVisible) {
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, TRUE);
};
}

The dashboardVisible boolean is set from the OpenFeintDelegate when the
dashboard is shown/hidden. Works perfectly.

On Mon, Jan 11, 2010 at 22:33, David Hedbor wrote:

Some more research using a simple example shows that even a basic
TableView doesn’t work - essentially no clicks are registered. If after
creating the tableview I run my own loop such as this:

while(true) {
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, FALSE);
};

I can actually get clicks to register. This work around doesn’t work with
OpenFeint however - it just makes it worse. Weird. I suppose most people
avoid using native iPhone UI combined with SDL.

On Sun, Jan 10, 2010 at 01:00, David Hedbor wrote:

I’m trying to integrate OpenFeint with SDL for an iPhone game. It mostly
appears to work except one detail - I can’t tap on any entries in the
tableviews in the OF Dashboard. Essentially things like friends list,
leaderboard lists, chat room lists etc don’t register clicks. I can move the
position in the tables just fine.

Has anyone else tried to integrate OpenFeint (or alternative, any
tableview) with SDL on the iPhone and if so, did you manage to get it to
work?


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

Joan Crawfordhttp://www.brainyquote.com/quotes/authors/j/joan_crawford.html

  • “I, Joan Crawford, I believe in the dollar. Everything I earn, I
    spend.”

Certainly. It’s pretty straight-forward so I could post the “stubfile” I use
to connect the two as well. I still have an issue where after opening
OpenFeint and closing it (the dashboard that is), CPU use outside of my game
logic goes up and keeps going up the more I open/close it. It appears most
likely to be some OF bug though - some timer or something is running that
shouldn’t be. After a few open/closes it makes the game unplayable.On Wed, Jan 13, 2010 at 09:28, Vittorio G. <vitto.giova at yahoo.it> wrote:

good job on getting this framework to work!
do you think you could post a little tutorial on how to merge sdl and
openfeint in an iphone project?
Vittorio

On Tue, Jan 12, 2010 at 8:12 AM, David Hedbor <@David_Hedbor> wrote:

And to answer my own email, again, I did get it working. In my main event
loop, I call the following method:

void RunOpenFeintLoopIfNeeded() {
while(dashboardVisible) {
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, TRUE);
};
}

The dashboardVisible boolean is set from the OpenFeintDelegate when the
dashboard is shown/hidden. Works perfectly.

On Mon, Jan 11, 2010 at 22:33, David Hedbor wrote:

Some more research using a simple example shows that even a basic
TableView doesn’t work - essentially no clicks are registered. If after
creating the tableview I run my own loop such as this:

while(true) {
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, FALSE);
};

I can actually get clicks to register. This work around doesn’t work
with OpenFeint however - it just makes it worse. Weird. I suppose most
people avoid using native iPhone UI combined with SDL.

On Sun, Jan 10, 2010 at 01:00, David Hedbor <@David_Hedbor> wrote:

I’m trying to integrate OpenFeint with SDL for an iPhone game. It mostly
appears to work except one detail - I can’t tap on any entries in the
tableviews in the OF Dashboard. Essentially things like friends list,
leaderboard lists, chat room lists etc don’t register clicks. I can move the
position in the tables just fine.

Has anyone else tried to integrate OpenFeint (or alternative, any
tableview) with SDL on the iPhone and if so, did you manage to get it to
work?


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

Joan Crawfordhttp://www.brainyquote.com/quotes/authors/j/joan_crawford.html - “I, Joan Crawford, I believe in the dollar. Everything I earn, I spend.”


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

If all you want is a tableView, why not just use UITableview from the sdk.

Navigate to your sdl code via didSelectRowAtIndex and that should be all you need for a tableview.

Openfient does however have a lot of socialnetworking built into it.

David Hedbor wrote:> Certainly. It’s pretty straight-forward so I could post the “stubfile” I use to connect the two as well. I still have an issue where after opening OpenFeint and closing it (the dashboard that is), CPU use outside of my game logic goes up and keeps going up the more I open/close it. It appears most likely to be some OF bug though - some timer or something is running that shouldn’t be. After a few open/closes it makes the game unplayable.

On Wed, Jan 13, 2010 at 09:28, Vittorio G. <vitto.giova at yahoo.it (vitto.giova at yahoo.it)> wrote:

good job on getting this framework to work!
do you think you could post a little tutorial on how to merge sdl and openfeint in an iphone project?
Vittorio

On Tue, Jan 12, 2010 at 8:12 AM, David Hedbor <neotron at gmail.com (neotron at gmail.com)> wrote:

And to answer my own email, again, I did get it working. In my main event loop, I call the following method:

void RunOpenFeintLoopIfNeeded() {???
??? while(dashboardVisible) {
??? ??? CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, TRUE);
??? };
}

The dashboardVisible boolean is set from the OpenFeintDelegate when the dashboard is shown/hidden. Works perfectly.

On Mon, Jan 11, 2010 at 22:33, David Hedbor <david at hedbor.org (david at hedbor.org)> wrote:

Some more research using a simple example shows that even a basic TableView doesn’t work - essentially no clicks are registered. If after creating the tableview I run my own loop such as this:

while(true) {
?? ??? CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, FALSE);
};

I can actually get clicks to register.? This work around doesn’t work with OpenFeint however - it just makes it worse. Weird. I suppose most people avoid using native iPhone UI combined with SDL.

On Sun, Jan 10, 2010 at 01:00, David Hedbor <neotron at gmail.com (neotron at gmail.com)> wrote:

I’m trying to integrate OpenFeint with SDL for an iPhone game. It mostly appears to work except one detail - I can’t tap on any entries in the tableviews in the OF Dashboard. Essentially things like friends list, leaderboard lists, chat room lists etc don’t register clicks. I can move the position in the tables just fine.

Has anyone else tried to integrate OpenFeint (or alternative, any tableview) with SDL on the iPhone and if so, did you manage to get it to work?


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

Joan Crawford (http://www.brainyquote.com/quotes/authors/j/joan_crawford.html) ?- “I, Joan Crawford, I believe in the dollar. Everything I earn, I spend.”


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

You’re essentially missing the point of the problem. The problem is that
even a basic tableview doesn’t work correctly with SDL without specifically
calling the event loop as I noted below, outside of SDL calling it.
Naturally I’m using OpenFeint because I want the functionality from
OpenFeint.On Mon, Feb 15, 2010 at 05:51, michelleC wrote:

If all you want is a tableView, why not just use UITableview from the
sdk.

Navigate to your sdl code via didSelectRowAtIndex and that should be all
you need for a tableview.

Openfient does however have a lot of socialnetworking built into it.

David Hedbor wrote:

Certainly. It’s pretty straight-forward so I could post the “stubfile” I
use to connect the two as well. I still have an issue where after opening
OpenFeint and closing it (the dashboard that is), CPU use outside of my game
logic goes up and keeps going up the more I open/close it. It appears most
likely to be some OF bug though - some timer or something is running that
shouldn’t be. After a few open/closes it makes the game unplayable.

On Wed, Jan 13, 2010 at 09:28, Vittorio G. <> wrote:

Quote:

good job on getting this framework to work!
do you think you could post a little tutorial on how to merge sdl and
openfeint in an iphone project?
Vittorio

On Tue, Jan 12, 2010 at 8:12 AM, David Hedbor <> wrote:

Quote:

And to answer my own email, again, I did get it working. In my main event
loop, I call the following method:

void RunOpenFeintLoopIfNeeded() {
while(dashboardVisible) {
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, TRUE);
};
}

The dashboardVisible boolean is set from the OpenFeintDelegate when the
dashboard is shown/hidden. Works perfectly.

On Mon, Jan 11, 2010 at 22:33, David Hedbor <> wrote:

Quote:

Some more research using a simple example shows that even a basic TableView
doesn’t work - essentially no clicks are registered. If after creating the
tableview I run my own loop such as this:

while(true) {
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, FALSE);
};

I can actually get clicks to register. This work around doesn’t work with
OpenFeint however - it just makes it worse. Weird. I suppose most people
avoid using native iPhone UI combined with SDL.

On Sun, Jan 10, 2010 at 01:00, David Hedbor <> wrote:

Quote:

I’m trying to integrate OpenFeint with SDL for an iPhone game. It mostly
appears to work except one detail - I can’t tap on any entries in the
tableviews in the OF Dashboard. Essentially things like friends list,
leaderboard lists, chat room lists etc don’t register clicks. I can move the
position in the tables just fine.

Has anyone else tried to integrate OpenFeint (or alternative, any
tableview) with SDL on the iPhone and if so, did you manage to get it to
work?


SDL mailing list

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

Joan Crawfordhttp://www.brainyquote.com/quotes/authors/j/joan_crawford.html - “I, Joan Crawford, I believe in the dollar. Everything I earn, I spend.”


SDL mailing list

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


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

I guess I don’t understand what you are trying to do.

I treat my sdl code as I would a eaglview , I can’t have a tableview within an eaglview unless I create some kind of overlay, and I would imagine you could do the same with sdl.

Although I admit I know nothing about openfient.

David Hedbor wrote:> You’re essentially missing the point of the problem. The problem is that even a basic tableview doesn’t work correctly with SDL without specifically calling the event loop as I noted below, outside of SDL calling it. Naturally I’m using OpenFeint because I want the functionality from OpenFeint.

On Mon, Feb 15, 2010 at 05:51, michelleC <@michelleC (@michelleC)> wrote:

  If all you want is a tableView, why not just use UITableview from the sdk.

Navigate to your sdl code via didSelectRowAtIndex and that should be all you need for a tableview.

Openfient does however have a lot of socialnetworking built into it.

David Hedbor wrote:


Certainly. It's pretty straight-forward so I could post the "stubfile" I use to connect the two as well. I still have an issue where after opening OpenFeint and closing it (the dashboard that is), CPU use outside of my game logic goes up and keeps going up the more I open/close it. It appears most likely to be some OF bug though - some timer or something is running that shouldn't be. After a few open/closes it makes the game unplayable.

On Wed, Jan 13, 2010 at 09:28, Vittorio G. <> wrote:

Quote:


good job on getting this framework to work!

do you think you could post a little tutorial on how to merge sdl and openfeint in an iphone project?
Vittorio

On Tue, Jan 12, 2010 at 8:12 AM, David Hedbor <> wrote:

Quote:

And to answer my own email, again, I did get it working. In my main event loop, I call the following method:

void RunOpenFeintLoopIfNeeded() {???
??? while(dashboardVisible) {
??? ??? CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, TRUE);
??? };
}

The dashboardVisible boolean is set from the OpenFeintDelegate when the dashboard is shown/hidden. Works perfectly.

On Mon, Jan 11, 2010 at 22:33, David Hedbor <> wrote:

Quote:


Some more research using a simple example shows that even a basic TableView doesn't work - essentially no clicks are registered. If after creating the tableview I run my own loop such as this:

while(true) {
?? ??? CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, FALSE);
};

I can actually get clicks to register.? This work around doesn’t work with OpenFeint however - it just makes it worse. Weird. I suppose most people avoid using native iPhone UI combined with SDL.

On Sun, Jan 10, 2010 at 01:00, David Hedbor <> wrote:

Quote:


I'm trying to integrate OpenFeint with SDL for an iPhone game. It mostly appears to work except one detail - I can't tap on any entries in the tableviews in the OF Dashboard. Essentially things like friends list, leaderboard lists, chat room lists etc don't register clicks. I can move the position in the tables just fine.

Has anyone else tried to integrate OpenFeint (or alternative, any tableview) with SDL on the iPhone and if so, did you manage to get it to work?


SDL mailing list

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

Joan Crawford (http://www.brainyquote.com/quotes/authors/j/joan_crawford.html) ?- “I, Joan Crawford, I believe in the dollar. Everything I earn, I spend.”


SDL mailing list

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


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

I guess I don’t understand what you are trying to do.

Use native iPhone GUI code combined with SDL.

I treat my sdl code as I would a eaglview , I can’t have a tableview within
an eaglview unless I create some kind of overlay, and I would imagine you
could do the same with sdl.

Displaying the widget (be it a tableview or openfeint gui) is not an issue.
Problem is that the SDL event handling interferes with the event handling
for the native iPhone UI. SDL already takes control of the event loop in the
glue layer.

Although I admit I know nothing about openfient.

Which is reasonably irrelevant for the issue at hand, it turns out.On Tue, Feb 16, 2010 at 12:45, michelleC wrote:

[[/quote]

Displaying the widget (be it a tableview or openfeint gui) is not an issue. Problem is that the SDL event handling interferes with the event handling for the native iPhone UI. SDL already takes control of the event loop in the glue layer.

?

[quote]

I haven’t seen that behavoir yet in my project but by the time I go back to the tableview (a natve uitableview not openfient) I’m out of the event loop as such.

It is a little tricky to get all this to work together though. it took a little research to figure out the best place to run the postFinishProcess selector.

Kind of interesting , in my situation anyway I found that I had to call SDL_Destroy_window before terminating the eventLoop, and than once back in the native ui clean up the resources.

Calling SDL_Quit anywhere from within the loop quit the entire app not just SDL.

From that other post you made, it sounds like your app is primarily native
UI based, but uses SDL for graphics rendering? In my case, it’s all
SDL-based but with the desire to use native iPhone UI elements. Note that a
lot of the UI works without any special hacks, but I couldn’t get
UITableView (as a basic example) or most of OpenFeint working. It works now
except for when I exit the OpenFeint dashboard, something is using a lot of
CPU. Others with this issue, that use OpenGL ES without SDL fixed this issue
by exiting the “game loop” when the dashboard was open, and restarting it on
close. However I have no clue how to possibly do that using SDL since
exiting my event loop will exit SDL.

Are you saying that, possibly, destroying the SDL Window and recreating it
has the same effect? Seems somewhat expensive (and also poses an issue since
right now my stuff uses the SDL 1.2 compatibility layer).On Wed, Feb 17, 2010 at 09:41, michelleC wrote:

[[/quote]

Displaying the widget (be it a tableview or openfeint gui) is not an issue.
Problem is that the SDL event handling interferes with the event handling
for the native iPhone UI. SDL already takes control of the event loop in the
glue layer.

[quote]

I haven’t seen that behavoir yet in my project but by the time I go back to
the tableview (a natve uitableview not openfient) I’m out of the event loop
as such.

It is a little tricky to get all this to work together though. it took a
little research to figure out the best place to run the postFinishProcess
selector.

Kind of interesting , in my situation anyway I found that I had to call
SDL_Destroy_window before terminating the eventLoop, and than once back in
the native ui clean up the resources.

Calling SDL_Quit anywhere from within the loop quit the entire app not just
SDL.


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

After investigating it some more, it turns out that the issue with CPU +
OpenFeint is in fact a bug in OpenFeint. Seems like one of their objects
retains a reference and thus never gets released when the dashboard closes.
For more information, see this post:

http://openfeint.com/developers/forum/showthread.php?26-Huge-performance-impact-after-dashboard-close&p=74&viewfull=1#post74On Sat, Feb 20, 2010 at 00:01, David Hedbor <@David_Hedbor> wrote:

From that other post you made, it sounds like your app is primarily native
UI based, but uses SDL for graphics rendering? In my case, it’s all
SDL-based but with the desire to use native iPhone UI elements. Note that a
lot of the UI works without any special hacks, but I couldn’t get
UITableView (as a basic example) or most of OpenFeint working. It works now
except for when I exit the OpenFeint dashboard, something is using a lot of
CPU. Others with this issue, that use OpenGL ES without SDL fixed this issue
by exiting the “game loop” when the dashboard was open, and restarting it on
close. However I have no clue how to possibly do that using SDL since
exiting my event loop will exit SDL.

Are you saying that, possibly, destroying the SDL Window and recreating it
has the same effect? Seems somewhat expensive (and also poses an issue since
right now my stuff uses the SDL 1.2 compatibility layer).

On Wed, Feb 17, 2010 at 09:41, michelleC wrote:

[[/quote]

Displaying the widget (be it a tableview or openfeint gui) is not an
issue. Problem is that the SDL event handling interferes with the event
handling for the native iPhone UI. SDL already takes control of the event
loop in the glue layer.

[quote]

I haven’t seen that behavoir yet in my project but by the time I go back
to the tableview (a natve uitableview not openfient) I’m out of the event
loop as such.

It is a little tricky to get all this to work together though. it took a
little research to figure out the best place to run the postFinishProcess
selector.

Kind of interesting , in my situation anyway I found that I had to call
SDL_Destroy_window before terminating the eventLoop, and than once back in
the native ui clean up the resources.

Calling SDL_Quit anywhere from within the loop quit the entire app not
just SDL.


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