iPhone support?


#47

Packp3d and runp3d worked well, but first I couldn’t get my models to load. I just found out I just had to omit the ‘.egg’ when loading models in my game, and runp3d would change the default model extension. Clever!
Maybe there should be a config var to force models to be loaded as .bam, even if .egg was explicitly requested, so any game given to packp3d would work. Then again, this would be a bit hacky.

Also, I think there should be a commandline option to specify custom extensions to be included (xml, etc) instead of just .egg and images.

First, I had to alter it to add the include and link directories of Python to the compile/link commands and “-lpython2.6”. (Is it a good idea to link to Python at link-time this way, or should we link to pystub or so.)
Also, it didn’t chew names with dashes (like Tut-Roaming-Ralph) because it would convert that into a C variable name. Maybe we should hash that or make pfreeze remove special symbols.


#48

Hmm, this is not a bad idea. It is hacky, but probably not so bad.

Also a good suggestion. I think eventually we’ll need some kind of spec file for fully customized builds, something akin to Python’s disttools, since many games will have highly customized needs.

We actually do need to link to Python here, since we are building a Python runtime. Linking with pystub would break things horribly. Eventually, pfreeze will have to be a lot more like makepanda, and do a better job of automatically figuring out the appropriate compile and link lines.

Ah, a good point. Of course, these filenames are not legitimate Python module names anyway, for a similar reason (because they’re not valid as Python symbol names). They can only be loaded from the command line, where their name gets changed to “main” anyway. Unless Python has a trick here I’m not aware of.

David


#49

Hi all,

Just curious, how hard would it be to build panda with EGL/X11/OpenGL ES 2.0 and GLSL shaders? I can’t seem to see their entries in the makepanda python script but would it just require adapting this file to point to those parts?

Thanks!


#50

Although makepanda builds with GLSL support out of the box, it does not support building the EGL/GLES(2) part of Panda. You’ll need to use the ppremake build system for that, or add the proper instructions to makepanda.

Beware that I haven’t tested the OpenGL ES support in while, so you may encounter build issues. I’d be happy to help you through those, though.


#51

Thanks for the reply rdb, my plan was to compile it for the nokia n900 platform seeing as I’ve got a scratchbox system set up and the actual device. I’ll compile the dependencies missing first and then tackle panda, like ODE & openal-soft which haven’t been ported to Maemo yet. maemo.org/ essentially it is nokia’s debian-based linux for internet tablets and smartphones.

The hardware is identical to the beagle board (OMAP3/PowerVR SGX) so I’m hoping it shouldn’t be too difficult to port. Thanks again rdb.


#52

Ah, okay. If the hardware is similar indeed it shouldn’t be too much effort. I cross-compile Panda3D myself with the codesourcery toolchain. I started without much thirdparty packages, and when I got it working, added those other libraries. If you want, email me and I’ll send you my Config.pp file that I used for cross-compilation.


#53

I’m considering using Panda3D for iPhone development, but I’m not clear on how difficult that will be. What is the general process required to create an iPhone app using Panda? I would prefer to take the straight-and-narrow (non-jailbroken) path.

If possible, I’m planning to load Collada files, use OpenGLES 2.0, and develop in C++.

Thanks for any help,
Cory


#54

We haven’t actually made a lot of forward progress on the fully-productized iPhone app development process yet. That is to say, we’re in the same state today that we were when this was discussed in this thread: the code is there, and I do have a Panda app running on my (non-jailbroken) iPod touch, but it’s not easy to develop for yet.

We hope to get this finished within the next few months.

David


#55

What needs to be done before you can officially release the iPhone version?


#56

There’s been a delay due to Apple’s new iPhone Developer License, which explicitly forbids the use of any language other than C, C++, or Objective-C (which presumably includes Python).

Feel free to write a nasty letter to Steve Jobs.

David


#57

Do you have confirmation on that? Because I thought Apple simply did not want other languages to be compiled into native iPhone code. Since the Panda3D engine is written in C++ and the Python is interpreted it should be fine.

I don’t know, I’m no expert on Apple’s user agreements.


#58

There’s a lot of speculation on the net as to what Apple really and truly has in mind, but this phrase is hard to get around:

“Applications must be originally written in Objective-C, C, C++”

There are no clarifications forthcoming from Apple, so I guess any doubts will be resolved when the new license goes into effect and we can see what they actually do forbid and what they don’t.

David


#59

I agree that the new Apple license is very strict. But the truth is that it’s so strict that they can’t possibly enforce it as written–or nearly half of the top games on iPhone would need to be kicked out of the store.

Also, since C++ is a permitted language, could you potentially release Panda3d as a C+±only engine? Or is it too tightly integrated with Python to be able to disable that integration?

Technically even that would be against the rules (“no compatibility layer”). But that part of the rules is simply insane, and frankly impossible to enforce entirely.

Yes you could pick a particular engine and exclude it (using “anti-virus”-like signature techniques, for example), but you’re not going to get every developer to completely rewrite every game for iPhone that exists on other platforms. So everyone will have a compatibility layer for their own games.

But if the Python integration is too tightly bound in with the rest, then I guess you’re right–in that I personally wouldn’t want the extra overhead of a Python interpreter in my iPhone game (or on Android).

Too bad Panda 3d doesn’t use Lua instead. Much lower overhead, and faster to boot.


#60

There’s no marriage of Panda3D and Python. It should be possible to write a C++ iPhone app using Panda3D. It’s not entirely clear to me whether this falls under the definition of using a “compatibility layer” (since Panda is open source, you can copy the entire library into your application source code folder–and then it becomes part of your application itself, not a separate layer).

That said, I’ve used Python to develop experimental apps for the iPhone, and it works fine, from a technical standpoint. But this has been hashed to death: Apple’s license is not about technical restrictions, it’s about market share.

Whether it’s realistic for Apple to eliminate nearly half of the top games in the App store is also kind of beside the point. It appears that Apple thinks this is a worthwhile sacrifice for their own business needs, and they might well be right.

Whether this new agreement is enforceable in practice or not is irrelevant for the purposes of declaring Panda3D’s iPhone support. If developing for iPhone using Panda3D would violate Apple’s developer agreement, then Panda3D cannot provide (legitimate) iPhone support.

Of course, we can continue to provide illegitimate iPhone support. That’s less exciting to developers, of course.

David


#61

That’s excellent.

Sorry, yes, I have to agree on all counts. No need to rehash.

As I mentioned, a C+±only game based on Panda 3d would be hard for them to detect, and as you mentioned, it may not even be in violation of their agreement.

Yes, but…a lot of this is beside the point for me, since I want to write Android games, and I don’t want to use Python, so I’m looking at potentially using your OpenGL ES support and parts of your 3d pipeline. The ability to rebuild my game(s) for iPhone would be a bonus, but not strictly necessary.

Is all of the OpenGL ES support you mentioned above available in the current source package, and/or CVS? And the iPhone support that does exist–is that already checked in as well, or is that only on your system?


#62

Everything is in CVS.

If you get a working Android port going, we’d love to know about it, and share it with the world. :slight_smile:

David


#63

http://www.macrumors.com/2010/06/11/apple-eases-up-on-restrictions-on-interpreted-code-in-iphone-developer-agreement

Looks like Panda3D for the iPhone is possible again.


#64

Hmm, that’s good news, though maybe not good enough: “an Application may use embedded interpreted code . . . if such use is solely for providing minor features or functionality.”

Certainly writing the application entirely in Python would constitute more than “minor features or functionality.”

This change seems to be directed at apps that use internal embedded interpreters to drive a small part of the game logic, and is meant to specifically exclude games that are entirely written in a language such as Python.

Also, it is increasingly clear that the philosophical drive of Apple’s licensing is to forbid the use of multi-platform development tools, such as Panda3D. Apple wants to limit developers to using tools that support only Apple products.

David


#65

The real test is if they continue to allow Unity3D games to be approved. If so there should be no problem allowing Panda3D games. In Unity3D the JavaScript/C# is compiled directly into native ARM code.

Anyway. I’m really a complete newbie when it comes to compiling stuff. Are there any basic steps you can give me that would allow me to compile Panda for the iPhone on my MacBook?

If I can’t use Python I’ll use C++. But I would like to play around with Panda3D on the iPhone. Ideally if I cannot use Python I’d like to interface with Panda3D directly in Objective-C.

I figure it won’t hurt to try :slight_smile:


#66

Hum, well, a lot of the momentum on the Panda3D/iPhone project has been lost recently. You can still build it for iPhone, but it will be an effort, and it might not be the best place to get started if you’re not already experienced with building large C++ projects.

You need to use ppremake to build for iPhone. You could start by getting the Panda3D source and first using ppremake to build it for your local development environment. If that goes well, then try to build it for iPhone.

To do this, install the iPhone Developers SDK from Apple, and add:

#define BUILD_IPHONE iPhoneOS
#define HAVE_GLES 1
#define GLES_LIBS

to your Config.pp. You’ll also need to obtain build any third-party tools you want, like libjpeg or libpng, for iPhone. But you can omit these at first, just to get started. You might need to explicitly turn all of these off with “#define HAVE_JPEG” and so on for each package.

If you want to run Python apps, you’ll also have to compile the Python interpreter for iPhone. This is surprisingly difficult, because the Python codebase isn’t designed for cross-compilation (it wants to build the interpreter and then immediately run it to build some more, but this isn’t possible in a cross-compilation environment).

If you want to run just C++ or Objective-C apps, though, you should be able to do this directly from the Panda build.

David