xcode view-based iphone template

edited November 2010 in Projects - Tools
Nowadays, I modified the iphone version.

Mainly in the way to initialize the orx application in iphone.Instead of generating the appdelegate by orx itself, it can start from your own appdelegate and generating a view controller. Thus it enable to build view flexiablely, for instance, you can establish orx env after playing a video, although, it sacrifice some convenience to transfer from other platform to iphone version.

Besides, I build a xcode project template for it. saving some rename time to have a cup of coffee.

the template is in attachment. Put it on /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Project Templates, and the project created by the template is able to work.

it is my first time to build template, maybe in other machine, it unable to work. please apologize for my limited knowledge and I will try my best to fix it.

thank you.

Comments

  • edited November 2010
    Excellent idea for the template!

    As for modifying orx application, you should be able to extend orxAppDelegate from outside orx.h/orxiPhone.m (which is a neat feature of objective-C).

    However I should probably provide a hook in the applicationDidFinishLaunching() to give the user controls or even just move its code to orx.h so it can be easily modified.

    What do you think would be better?

    I'd like to have things as most automated as possible but still keeping them customizable. Also the less differences there are between all platforms from a orx-user point of view, the better.
  • edited November 2010
    I totally agree with your point the less difference and more automated, the better.

    But I can't catch your meaning of
    providing a hook in the applicationDidFinishLaunching() to give the user controls or even just move its code to orx.h so it can be easily modified.

    sorry for my bad understanding, could you give me a brief structure to implement these two ways to realize users control? thank you .
  • edited November 2010
    the project template is too big to upload, so here I only upload it without orx lib. you can compile by yourselves and copy them into lib in the project template. https://forum.orx-project.org/uploads/legacy/fbfiles/files/orxView_Based_Application.zip
  • edited November 2010
    laschweinski wrote:
    But I can't catch your meaning of
    providing a hook in the applicationDidFinishLaunching() to give the user controls or even just move its code to orx.h so it can be easily modified.

    sorry for my bad understanding, could you give me a brief structure to implement these two ways to realize users control? thank you .

    No worries, it wasn't very clear. Right now orxView is created and executed from the ApplicationDidFinishLaunching() selector which is in orxiPhone.m.

    I can make this code public in orx.h so that people can modify it like they want, or I can add a hook: instead of going straight for the orxView, I can create a new thread that will wait till it receives a signal if the hook selector has been implemented, which gives the time to the user to do whatever he wants before orx runs. If the hook selector is not implemented things will work like right now.

    This would be one option, but at first I thought that any other view could be added on top of orx and just ask orx not to render its own (by listening to the render event for orxRENDER_EVENT_START and returning orxSTATUS_FAILURE, which prevents rendering to happen completely). In this case there's nothing to change in orx, simple extends orxAppDelegate in the user's own private file, add its view and in the init() callback do whatever he wants with the other views.
    I haven't tried myself though, but it sounds like it should work in theory.
  • edited November 2010
    I wanted the template a long time before, Great JOB!
  • edited May 2011
    Any updates on this? Because I can't get it working with latest ORX from SVN :(
  • edited May 2011
    it needs to put the orx lib(compiled for device or for ARM) into the lib folder while put the sim orx libs which rename to libsim+orx*.a (for i386) into simLib.

    and choose the lib according to what's the mode and where you want to run

    for example:
    the simulator debug mode, you should choose the libsimorxd.a in the simlib folder. and do not choose other lib in lib and simlib
    while in the device release, you should choose the liborx.a .

    hope you could understand what I mean

    ps: the include folder in the template also need to be modified. cause the include folder in template is out of data.
  • edited May 2011
    Of course I did this changes :) problem is in AppDelegate. sSurce codes won't compile because of errors mainly in orxIPHONE_EVENT_PAYLOAD around 130th line
  • edited May 2011
    the game I am developing on the iphone also use this structure, but no any problem and errors. it may lies in the header search, do you sync with the include folder with the svn or 1.3?
  • edited May 2011
    Well, could you send me projet template with some basic source codes which is working for you? I would really appreciate it :)
Sign In or Register to comment.