Profile

Member Since
October 07, 2011

Search Members

  

Huge

546
@

Badges

This user hasn't earned any badges yet.

Posts

Viewing 61 to 80 (546 Total)

Re: Windows 8 and CPP problem

Hi,
This has been solved in haxe3 because now:

typedef MyInt = {>Int,};

class Test { public static function main() { var nt:MyInt = cast 11; } }

gives "Can only extend classes and structures"

The new "Abstract" syntax is now designed exactly for what you are trying to do.

Hugh

Posted on February 10, 2013 at 9:33 PM

Re: iOS: lookup of 'super' in member access expression is ambiguous

Hi,
I think this will be fixed in the upcoming haxe3 release.

Hugh

Posted on February 10, 2013 at 9:28 PM

Re: What exactly causes "leaking texture" in OpenGLContext.cpp

Hi,
Yes, this is a reminder to me to fix this.
The problem is that the finalizer is being run from the non-main thread (it will be run by whichever thread needed the memory at the time). From the non-main thread, you can't make opengl calls.
I think the easiest fix is to add the texture id to an array, and then delete it on the next BeginRender.
I have added a "blind" change to nme SVN which I hope will fix this problem. I can't really test this, so perhaps you can tell me how it works out.
You could also try an explicit cpp.vm.Gc.run() from the main thread after you have nulled out the objects.

Hugh

Posted on February 06, 2013 at 8:44 PM

Re: Android URLRequest & URLLoader problerms

Hi,
libcurl is statically linked into the nme.ndll

Hugh

Posted on February 05, 2013 at 9:12 PM

Re: AndroidManifest.xml in template

Hi,
Yes, the basic idea is to copy the standard template to your local directory and then use the template path to point to your version instead of the standard version.

Hugh

Posted on February 05, 2013 at 9:10 PM

Re: bug: things are confusing. a request to clean house (issue trackers, source repos)

Hi,

> NME is hosted at GitHub and is mirrored on Google Code.

It is not my understanding that this is at all!. Last time this was discussed, the result was to leave it how it has been for the last 5 years, that is hosted on SVN on google.code. With github being an extra way that people could submit patches for consideration of merging into svn on google.code.
Personally, I do not follow the nme mailing list or watch atlassian.net, so this forum would be the best place to get my attention is you need it.

Hugh

Posted on February 04, 2013 at 9:27 PM

Re: nme.gl.GL.texImage2D() pixels Parameter

Yep, looks like a typo.

Hugh

Posted on February 04, 2013 at 9:18 PM

Re: Stage not working under android

Hi
Lib.current.stage.width

is the width of all elements added to the stage, you probably want:

Lib.current.stage.stageWidth

which is the logical size, not matter what is on it.

You can use "touch" OR "mouse" events, and you can set the mode:


var addMouseListeners = !nme.ui.Multitouch.supportsTouchEvents;

// Non touch screen
if (addMouseListeners)
{
addEventListener(MouseEvent.MOUSE_DOWN,...
}
// Touch screen ...
else
{
nme.ui.Multitouch.inputMode = nme.ui.MultitouchInputMode.TOUCH_POINT;
addEventListener(TouchEvent.TOUCH_BEGIN, ...
}



Hugh

Posted on February 03, 2013 at 9:14 PM

Re: nme.gl.GL.texImage2D() pixels Parameter

Yes it would. You should be able to hack the file to make it work as-is, and I can look at it next time I'm in the code.

Hugh

Posted on February 03, 2013 at 8:59 PM

Re: BitmapData.draw / copyPixels() alpha inconsistency.

Hi,
Compiling with cpp gives the results you are expecting (the same value). Compiling with flash shows what you are see - they differ in the 'copyPixels' not the 'draw' methods.
If I use 0x80ffffff colour (half white), they differ, but if I use
0x80000000 colour (half black), they are the same.

This suggests to me that flash is merging the "premultiplied alpha" values - which is kind of incorrect, and probably what you want - but since the docs are unclear here I guess they can do what they want.
I could change the cpp to match, but that would not help you.

Probably best to use 'draw' on both platforms.

Hugh

Posted on January 31, 2013 at 10:07 PM

Re: Performance issue with color transform and blur filter

Hi,
Yes, the goal is to move these effects to shaders where the hardware supports it.
We have only really integrated ogl2, so it has only just become an option, and I'm finding it hard to find the time.

Hugh

Posted on January 31, 2013 at 9:11 PM

Re: Performance issue with color transform and blur filter

Hi,
Yes, these operations are done in software, and then the resulting texture is uploaded to the device - both of these are expensive.
I'm not sure of the difference between haxe+air and air - they should be pretty much the same.

The 22-OGL samples shows how you can feedback into a texture to get some similar effects, but you will need to write a shader yourself.

Specifically for this effect, you could use draw tiles + additive blend + particle system, eg:
http://code.google.com/p/gm2d/source/browse/#svn%2Ftrunk%2Fsamples%...
You could use the effects once to generate the tilesheet, and then use the tile over and over again

This is much more "hardware friendly" way and should be great on mobile.

Hugh

Posted on January 30, 2013 at 9:52 PM

Re: Supporting NME

Hi,
Nicolas has started this more generally for haxe - although NME is covered by this.

Check out the "haxe foundation"

http://haxe-foundation.org/

Hugh

Posted on January 30, 2013 at 9:43 PM

Re: Screen Tearing Issue in Flash

Hi,
There might be right-click setting in the flash player settings.
There might also be a setting in your graphics driver control panel.

Hugh

Posted on January 24, 2013 at 10:56 PM

Re: trace in NME

A String plus an int should be a string - I use this all the time. What platform/(haxe)compiler version were you seeing this on?

Maybe there is a bug in the svn version of the haxe compiler at the moment.

Hugh

Posted on January 24, 2013 at 10:54 PM

Re: Can't run windows target .exe in windows xp, works fine in vista, windows 7, and windows 8

Hi,
I think this problem is arising because one of the ndll binaries has been compiled with visual studio 2012.
Not sure which one, though.
You should be able to do "dumpbin -imports filename.ndll" and one of the will show flsFree.
If you can report this, we can look at making sure this does not happen again.

You could also recompile the ndlls yourself and this should fix the problem too.

Hugh

Posted on January 21, 2013 at 9:33 PM

Re: CPP Target, Windows: Alt+F4 (close program) and Alt+Enter (toggle fullscreen) not working

Hi,
I think alt-f4 should probably close by default.
Not sure sure about alt-enter - but perhaps so in the window RESIZE param is specified.

I have implemented this myself in my library (toggleFullScreen)
http://code.google.com/p/gm2d/source/browse/trunk/gm2d/Game.hx...

And then you could perhaps cancel the event if you did not want this behaviour.
The would make life better for devs I think.

Hugh

Posted on January 20, 2013 at 9:52 PM

Re: Performance rendering vectorial graphics?

Hi,
We would love to be able to support this type of workflow, but unfortunately it would be quite a bit of work to get this going. That said, I think it is possible, but I will describe the issues.

NME supports both hardware and software rendering.
The software renderer is high quality, and supports anti-aliasing etc., however is is probably a bit slower that the adobe software renderer. You certainly can just turn on the software renderer and call it done, because it would be too slow.
The hardware renderer is fast to render, but it takes a bit of time to setup for vector renders. Thin, curving lines are one of the hardest things to render because it has to tessellate the line into lots of tiny triangles. These triangles are then renderer by the device, and generally require device anti-aliasing to look good. Even then, there might be some sub-pixel accuracy jittler issues. Fonts renderer using tiny triangles don't look as good as a 'proper' 2D render. That said, once the tessellation is created, it can be rotated-translated quite quickly. And I am not sure how fast a AA render will be on the various gens of iOS devices.

I would generally recommend a hybrid method, where vector images are renderer to bitmaps using the software renderer, and then rendered as bitmaps. This would keep your download size small, while keeping maximum quality.

So for starters, I would suggest rendering the background into bitmap using a grid of 64x64 tiles (if you can scroll in 2 directions) or strips of 32xheight (if you can only scroll horizontally) or just one big bitmap if you can't scroll. Then, in a background thread or a little-bit-at-a-time, make sure you have the next background tiles ready for rendering using some kind of circular buffer.

Then, I guess it depends on how many animated things there are on the screen. You may be able to use normal Sprites and turn on 'cacheAsBitmap' to force software renderer and you may then have enough performance, job done. Otherwise, you may need a more intelligent caching system

I could not really tell, but it depends on what type of animation you are using. For example, it may be possible to render the legs at, say, 20 different angles and the body at 10 different angles etc, and then compose the character at render time as a sequence of bitmaps. Since you have the vectors, if something changes, the a characters hat, you could still re-render the sprite sheet at runtime at the target resolution.

If you went down the hardware route, other optimisations could help, like caching the tessellations in 'Shape' objects and then 'addChild' and transform them as required. Or in software, using the 'GraphicsData' to store your vectors once they are loaded, so they can be reused efficiently.

I should also mention that most of these techniques can also be used in flash/AIR without NME.

There are a few pixel-shader techniques I would like to try achieve smooth lines with AA without using surface-based AA and tessellations, but it could be a while before I get around to this. Also, I will be exploring more multi-threading options for software-rendering, which should give a nice performance boost.

Hugh

Posted on January 15, 2013 at 10:04 PM

Re: High CPU usage in Windows even with an empty Sprite

Hi,
On windows you can use the excellent profiler "very sleepy" to see what is going on.

http://www.codersnotes.com/sleepy...

For a simple program, you should be able to use "-debug" compiler flag to get a good view of what is going on.

If you are using some integrated graphics (intel) at full HD, then there might be some problems there.

Hugh

Posted on January 15, 2013 at 9:14 PM

Re: How to add values to Other Linker Flags in Xcode from CLI / nmml ?

Hi,
You will need to edit the project template file, and refer to the edited version with a template path.

One way to do this is to load the project in xcode, change the setting and then save. Copy the project to a backup file, and then reverse your change and save again.
By comparing the backup and latest version, you can work out what needs to be changed.
Then apply this change to the template.

We should look at supplying "extra link flags" in the nmml for extensions (if it is not there already?) for ios.

For other systems, you can actually inject the extra flags using meta-data.

Hugh

Posted on January 15, 2013 at 9:11 PM