The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Trouble with SDL + OpenFeint on iPhone
David Hedbor
Guest

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
Trouble with SDL + OpenFeint on iPhone
David Hedbor
Guest

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?
Trouble with SDL + OpenFeint on iPhone
David Hedbor
Guest

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?




Trouble with SDL + OpenFeint on iPhone
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
Great, I'm glad you got it working! :)

On Mon, Jan 11, 2010 at 11:12 PM, 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





--
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Trouble with SDL + OpenFeint on iPhone
Vittorio G.
Guest

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 Crawford  - "I, Joan Crawford, I believe in the dollar. Everything I earn, I spend."
Trouble with SDL + OpenFeint on iPhone
David Hedbor
Guest

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 Crawford  - "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

Re: Trouble with SDL + OpenFeint on iPhone
michelleC


Joined: 08 Feb 2010
Posts: 108
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 Crawford  - "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

Trouble with SDL + OpenFeint on iPhone
David Hedbor
Guest

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:
Quote:
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 Crawford  - "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

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

Re: Trouble with SDL + OpenFeint on iPhone
michelleC


Joined: 08 Feb 2010
Posts: 108
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 wrote:
Quote:
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 Crawford  - "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

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

Trouble with SDL + OpenFeint on iPhone
David Hedbor
Guest

On Tue, Feb 16, 2010 at 12:45, michelleC wrote:
Quote:
I guess I don't understand what you are trying to do.




Use native iPhone GUI code combined with SDL.
 
Quote:
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.

 
Quote:

Although I admit I know nothing about openfient.




Which is reasonably irrelevant for the issue at hand, it turns out.
Re: Trouble with SDL + OpenFeint on iPhone
michelleC


Joined: 08 Feb 2010
Posts: 108
[[/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.

So what I do is significatly different than what you do.

I use the native ui to collect user input
Drop into the sdl Engine
Than go back to the native ui.





I've haven't used openfient but it sounds interesting.
Trouble with SDL + OpenFeint on iPhone
David Hedbor
Guest

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

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

Trouble with SDL + OpenFeint on iPhone
David Hedbor
Guest

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#post74

On Sat, Feb 20, 2010 at 00:01, David Hedbor wrote:
Quote:
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


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