SDL for iPhone有多成熟?

时间:2021-12-08 03:07:18

For a while I've been thinking of trying to do a port of one of my favorite classic PC games, The Ur-Quan Masters (aka Star Control 2) to the iPhone. UQM uses SDL for all its graphics, sound, input and other gamey stuff and there does seem to be a port of SDL to iPhone but it doesn't look very mature at this point.

有一段时间我一直在考虑尝试将我最喜欢的经典PC游戏之一,The Ur-Quan Masters(又名Star Control 2)移植到iPhone上。 UQM将SDL用于其所有图形,声音,输入和其他游戏内容,似乎有一个SDL到iPhone的端口,但此时它看起来并不十分成熟。

Has anyone put the iPhone SDL port through its paces? How well does it work? What kinds of issues can I expect taking this project, which is already cross platform code to iPhone?

有没有人把iPhone SDL端口放进去?它的效果如何?我可以期待这个项目有哪些问题,这已经是iPhone的跨平台代码?

If SDL isn't an option can anyone reccomend an alternative framework to look at that will bridge the gap between SDL and the native libraries like OpenGL ES and Core Audio? Or is coding to those frameworks the best option?

如果SDL不是一个选项,那么任何人都可以推荐一个替代框架来解决SDL与OpenGL ES和Core Audio等本机库之间的差距吗?或者编码那些框架是最好的选择?

Edit to add: Here's a link to a forum thread on the UQM forum about doing an iPhone port.

编辑添加:这是UQM论坛上有关执行iPhone端口的论坛帖子的链接。

2 个解决方案

#1


21  

UPDATE
This answer is really out of date, so you can stop up voting it!

更新这个答案真的已经过时了,所以你可以停止投票吧!

I no longer use SDL for iPhone development because it doesn't fit the iPhone model. e.g. SDL insists on owning main(), the audio subsystem doesn't know about AudioSessions, it's hard to pick up on view orientation changes, etc. It was nice to see a familiar face but in the end SDL introduced more problems than it solved.

我不再使用SDL进行iPhone开发,因为它不适合iPhone型号。例如SDL坚持拥有main(),音频子系统不了解AudioSessions,很难了解视图方向的变化等等。很高兴看到一个熟悉的面孔但最终SDL引入的问题比它解决的更多。

2009 answer
The svn version's working well for me.

2009回答svn版本对我很有用。

I had one problem and that was a crash in atexit(SDL_Quit).

我有一个问题,那就是atexit崩溃(SDL_Quit)。

So I disabled cleanup.

所以我禁用了清理工作。

Plus the library names are not sensible, but you can change that.

加上图书馆名称不明智,但你可以改变它。

The hardest part for me was porting my SDL code to SDL-1.3, and porting my OpenGL code to OpenGLES.

对我来说最困难的部分是将我的SDL代码移植到SDL-1.3,并将我的OpenGL代码移植到OpenGLES。

OpenGLES works as you'd expect, the accelerometer shows up as a 3 axis joystick, and sound is solid.

OpenGLES按照您的预期工作,加速度计显示为3轴操纵杆,声音稳固。

I give iPhone SDL 4.5 out of a possible 5 stars.

我给出了可能的5星级iPhone SDL 4.5。

#2


2  

The iPhone port works as expected, and it does have a bit of an unfinshed feel to it. As delivered it's not that easy to integrate with the SDK, that may be OK for some games, but I think most users expect more out of games today, like social network connections.

iPhone端口按预期工作,它确实有一点没有感觉。虽然提供它并不容易与SDK集成,这可能适用于某些游戏,但我认为大多数用户期望今天更多的游戏,如社交网络连接。

Fortunately with a little effort you can use most of the iPhone SDK with SDL.

幸运的是,只需稍加努力就可以将大部分iPhone SDK与SDL结合使用。

See my tutorial here, Bridging the Gap.

请参阅我的教程,弥补差距。

and blogs on the Simple DirectMedia Layer Forums.

和Simple DirectMedia Layer Forums上的博客。

SDL tends to mess up touch events in tableviews, but you can fix that by run in with a separate cfrunloop.

SDL往往会破坏tableviews中的触摸事件,但您可以通过单独的cfrunloop运行来解决这个问题。

Performance is close to working with just plain vanilla OpenGL.

性能接近于使用普通的OpenGL OpenGL。

#1


21  

UPDATE
This answer is really out of date, so you can stop up voting it!

更新这个答案真的已经过时了,所以你可以停止投票吧!

I no longer use SDL for iPhone development because it doesn't fit the iPhone model. e.g. SDL insists on owning main(), the audio subsystem doesn't know about AudioSessions, it's hard to pick up on view orientation changes, etc. It was nice to see a familiar face but in the end SDL introduced more problems than it solved.

我不再使用SDL进行iPhone开发,因为它不适合iPhone型号。例如SDL坚持拥有main(),音频子系统不了解AudioSessions,很难了解视图方向的变化等等。很高兴看到一个熟悉的面孔但最终SDL引入的问题比它解决的更多。

2009 answer
The svn version's working well for me.

2009回答svn版本对我很有用。

I had one problem and that was a crash in atexit(SDL_Quit).

我有一个问题,那就是atexit崩溃(SDL_Quit)。

So I disabled cleanup.

所以我禁用了清理工作。

Plus the library names are not sensible, but you can change that.

加上图书馆名称不明智,但你可以改变它。

The hardest part for me was porting my SDL code to SDL-1.3, and porting my OpenGL code to OpenGLES.

对我来说最困难的部分是将我的SDL代码移植到SDL-1.3,并将我的OpenGL代码移植到OpenGLES。

OpenGLES works as you'd expect, the accelerometer shows up as a 3 axis joystick, and sound is solid.

OpenGLES按照您的预期工作,加速度计显示为3轴操纵杆,声音稳固。

I give iPhone SDL 4.5 out of a possible 5 stars.

我给出了可能的5星级iPhone SDL 4.5。

#2


2  

The iPhone port works as expected, and it does have a bit of an unfinshed feel to it. As delivered it's not that easy to integrate with the SDK, that may be OK for some games, but I think most users expect more out of games today, like social network connections.

iPhone端口按预期工作,它确实有一点没有感觉。虽然提供它并不容易与SDK集成,这可能适用于某些游戏,但我认为大多数用户期望今天更多的游戏,如社交网络连接。

Fortunately with a little effort you can use most of the iPhone SDK with SDL.

幸运的是,只需稍加努力就可以将大部分iPhone SDK与SDL结合使用。

See my tutorial here, Bridging the Gap.

请参阅我的教程,弥补差距。

and blogs on the Simple DirectMedia Layer Forums.

和Simple DirectMedia Layer Forums上的博客。

SDL tends to mess up touch events in tableviews, but you can fix that by run in with a separate cfrunloop.

SDL往往会破坏tableviews中的触摸事件,但您可以通过单独的cfrunloop运行来解决这个问题。

Performance is close to working with just plain vanilla OpenGL.

性能接近于使用普通的OpenGL OpenGL。