Unable to draw polygons in a Mac application


I just downloaded and set up OpenFL, and for my first project I thought I’d try this Pong tutorial. So far I’ve only attempted the code on the first page, which sets the stage and draws three polygons. When I build and run this on my Mac (OS X 10.9.2) none of the polygons show up. If I compile to HTML5 it works as expected.

I’m a little lost as far as how to go about debugging something like this. My code is nearly identical to that on the linked page, except that instances of “flash” are replaced with “openfl”, and in any case since it works as an HTML5 project I suspect the code isn’t to blame.

What if you compile for Neko?

Also, try adding trace("Hello world") somewhere. Does that show up in the console?

Well, that solved it. This tutorial has the setup code set to execute only when the window is resized. I just sort of trusted that that was an idiomatic thing to do. Do you have any idea why they might have done it that way?

Bad template code that’s propagated due to an IDE that uses that by default. All you need is “new()” and you’re ready to go, no init, no added to stage, no resize even :slight_smile: