Minor Updates

I have just released a few minor updates to nme + hxcpp, which you can find on haxelib. These are relatively small \- just pushing out a few fixes for some bugs that have been reported. In most cases the bug reports we accompanied by a fix \- you’ve gotta love open source. The iPhone/Xcode template has also been updated, you may need to follow the instructions in the post below.

There is one significant change though – the “nekoapi.dll” file that is used for compatibility between hxcpp binaries (ie, NME) and neko has changed its extension to “ndll” so that neko can communicate directly with it. This allows the String instances created externally to be “blessed” as haxe strings without having to call nekoToHaxe on them, and therefore methods such as substr will work.

The other change of note is that I removed the libfreetype code from the iPhone target, and used native font rendering instead. Let me know if this breaks anything. One side effect is that the default font will now be system dependent, with the iPhone getting its usual font. I will also have to have a good look at the font render quality – freetype may have a little bit better sub-pixel sharpness.

There was a bug in the 2.06 haxe distribution when writing files. I have fixed this by putting an override in hxcpp, which you can access with the command line options: “-lib hxcpp”. I have also folded this change into haxe svn, so you will not need to do this in 2.07.

15 Replies to “Minor Updates”

  1. Hi.

    This template worked great for me. Thank you. This project is brilliant. I do have a question about it.

    I would like to create a project where the Haxe/FlashAPI is loaded up as a child of another UIView, so that I can put some UI elements next to it. I was wondering the best way to go about this. I took the template and added back in my own delegates and MainWindow.xib. I also checked out the SVN and noticed a lot of the code I need to get to seems to be in UIStageView.mm

    Is there any way I can override the app delegate in this view to that I can tell it not to call the UIStageViewController and call it later instead.

    Can you suggest a better way to go about this?

    1. Hi,
      This iphone target is a bit interesting because it is static-linked, which means that would should be able to mod it a bit easier.
      I would recommend the following:
      Compile NME from source, but remove the StageView class from the build .xml
      Move this class into your own project – you may need to add some “include” paths to point to the NME header files.
      At this stage, the project should essentially be unchanged (ie compile, link + run then same), however you should now have source-code access to the UIStageView object.
      Now if you use a xib file to create you StageView, you will need to modify IPhoneGetStage to return your new object. The code in applicationDidFinishLaunching may not be required if the nib creates the file. You may also want your own AppDelegate.

      This is off the top of my head, so I’m not sure how hard it will be.

      I may think about re-architecting this to be a bit easier. The Android is more separated (because of the java API).

      Good Luck,

  2. Scratch that. It works. I was trying to build without navigating to the build directory first.

    I still get an error on windows were it errors after building Utils.h. File not found – I think for Geom.h – which is in the same directory.

    It builds on my Mac though. I read a post that said it wouldn’t work on mac, so I hope that it does now.

    I’m just about to make the changes, so I’ll let you know how I get on.


  3. Hugh.

    Do you carry out freelance work and if so are you currently available? I am making some progress with it but I don’t really know enough about what is happening to be confident that I can find the solution. (Feel free to email me on the address provided). Thanks.


  4. Hi, I’m trying to get this to compile, but am getting this error every time when I am doing -D iphone:
    C:Program FilesMotion-Twinhaxelibnme/2,0,1/nme/Loader.hx:14: characters 4-10 : Not implemented for current platform

    When I do -D cpp I get this error:
    C:Program FilesMotion-Twinhaxelibnme/2,0,1/nme/Loader.hx:10: characters 13-
    25 : You can’t access the cpp package with current compilation flags (for cpp.Li
    C:Program FilesMotion-Twinhaxe/std/haxe/Int32.hx:28: characters 0-13 : You ca
    n’t access the cpp package with current compilation flags (for cpp.CppInt32__)
    C:Program FilesMotion-Twinhaxe/std/haxe/io/Input.hx:259: characters 30-42 : Y
    ou can’t access the cpp package with current compilation flags (for cpp.Lib)
    C:Program FilesMotion-Twinhaxe/std/haxe/io/Input.hx:141: lines 141-153 : Floa
    t should be Void
    C:Program FilesMotion-Twinhaxe/std/haxe/io/Input.hx:260: characters 31-43 : Y
    ou can’t access the cpp package with current compilation flags (for cpp.Lib)
    C:Program FilesMotion-Twinhaxe/std/haxe/io/Input.hx:155: lines 155-167 : Floa
    t should be Void

    My hxml file looks like this:
    -main Main
    -cp src
    -lib nme
    -D cpp
    –remap flash:nme

    1. Hi,
      You need the “-cpp some_dir” hxml option, rather than “-D cpp” eg:
      -main Main
      -cp src
      -lib nme
      -cpp cpp
      –-remap flash:nme


  5. The error I get now is below. I checked and made sure there is a BuildCommon.xml file in the specified folder. My only thoughts are that it’s inserting a ‘;’ at the end of the folder name, which may throw the filesystem off. I tried looking how to change that, but was unsuccessful. Any thoughts? I appreciate your help tons!

    haxelib run hxcpp Build.xml haxe -Dcpp -Dhaxe_206 -Dnme -Dtrue
    Called from ? line 1
    Called from BuildTool.hx line 899
    Called from BuildTool.hx line 451
    Called from BuildTool.hx line 472
    Called from BuildTool.hx line 522
    Uncaught exception – Could not find include file C:Program FilesMotion-Twinha
    Error : Build failed

  6. I just found HaXe today, and I think it’s amazing. And I like NME so much. Congratulations.
    I’ll definitively use it.
    I was wondering if do you plan to add OpenGL(|ES) 2.0 Shaders.
    I know that it’s not possible to load PixelBender shaders directly on GL, but loading plain OGL shaders would be really appreciated.

    Keep up the good work!

  7. Hi,
    your template worked great for simple tests. Thank you so much for this great start.
    I’m very new to HaXe, and I’m trying to bind the aswing libraries to use them both on Flash and iOS targets. I tried both copying the aswing.swf on my working directory and using -swf-lib aswing.swf in the .hxml file, as well as using haXe libraries converted with –gen-haxe-libs.
    When I compile for Flash everything runs smooth.
    When I build on Xcode, I get an error “UInt is not defined”.
    I figured out that is a Flash only typedef, so I changed all UInt to Int in my libraries.
    Then I get a “Class not found: flash.display.SimpleButton”. That is really weird because the import line (in the Main file) comes right after importing flash.display.Sprite. Why does the compiler complain only about SimpleButton?
    Am I all wrong?? I’m completely blind in C++ and Neko and I don’t even know if what I’m doing is possible…

  8. Hey,
    Downloaded the template and created a new project, which I’m trying to get to build against SDK 4.3, but no matter what I do it’s stuck on SDK 4.2. Is there anyway this is related to the project template somehow? Or any ideas to get it to change (other than the obvious: Project Settings, Target Settings, opening project.pbxproj and looking for SDKROOT or any strings with 4.2)?

    Everything builds and runs fine for Simulator SDK 4.2, but I don’t seem to have the Device SDK 4.2 (only 4.3). I could try and get Device SDK 4.2 on my machine, but as a matter of principle (and in case of updating to a future SDK), I wanted to try and get it to work “correctly”.

    Thanks for any tips,

  9. Hi Huge,

    First and foremost: great work!

    I’m having an issue when trying to make Xcode 4.1 recognize the Haxe iOS’ project template. I’ve copied-pasted your latest project in the correct folder, restarted Xcode… and nothing.
    Then I realized it seems to miss a tiny configuration file named TemplateChooser.plist into the project template’s root. I copied and pasted that one from another template, replaced it with the relevant values, put the project template’s files into a subfolder and restarted Xcode… and still nothing.

    What am I doing wrong?


Leave a Reply

Your email address will not be published. Required fields are marked *