Flixel Forums

development => iOS => Topic started by: bpercevic on Sun, Jul 24, 2011

Title: flixel-iOS for native mac games?
Post by: bpercevic on Sun, Jul 24, 2011
just curious, can the flixel-iOS library be used to make native mac games or is it iOS device exclusive?  I've never coded anything in obj-c but the recently released Mode source code looks pretty self explanatory. 

if it is possible to use f-iOS to make a Cocoa app, how would you set that up?  just import and use the source, or would you have to make some changes to the source?

it would open up a whole world of possibilities.
Title: Re: flixel-iOS for native mac games?
Post by: initials on Sun, Jul 24, 2011
My first reaction is yes, Flixel should work for Obj-C games.

Now for the fine print. I haven't tried it. I haven't compiled a game that works on iOS for Mac.

It should be pretty easy for me to test it. In the meantime if you want to try it the best way to go about it would be to grab the Flixel iOS hello world and try to compile it as a native mac app.

And if you have any questions about Mode post them in this forum. The iOS section is usually pretty quiet. I hope that starts to change!
Title: Re: flixel-iOS for native mac games?
Post by: bpercevic on Mon, Jul 25, 2011
unfortunately I get a lot of errors.  most of the errors are because of the way I imported the source, by copying the whole flixel-ios folder into my project, so it couldn't locate the headers.  I changed the each file to specify the correct location of each header, but then after that was done I had about 20 of these:

Code: [Select]
Parse Issue: Expected a type
those are in FlixelAPTBindings.h under the interface declarations for FlxQuake, FlxSprite, and FlxEmitter.

I'm an obj-c newb so this completely trumps me :(
 


Title: Re: flixel-iOS for native mac games?
Post by: initials on Mon, Jul 25, 2011
Importing the Flixel library is a pain because you have to set the Header folder as a pre-compile thing. (Sorry for the lack of technical terms, I don't exactly understand it myself and I'm not on a Mac).

Your best bet is to grab Canabalt and try to compile that for Mac, or grab the Flixel Hello World template and try that. Then you won't need to do any importing, you can open the Xcode project and go for it.
Title: Re: flixel-iOS for native mac games?
Post by: Dids on Sun, Apr 1, 2012
I just had a go at porting Flixel from a custom iOS version to OS X, but the main problem is that iOS uses OpenGL ES while OS X uses pure OpenGL, so a lot of OpenGL knowledge is required for a succesfull port.
Title: Re: flixel-iOS for native mac games?
Post by: initials on Mon, Apr 2, 2012
I have tried this too, and can't get it to work.

I have read that OpenGLes is a subset of OpenGL, so most calls should work, however, in practise it throws errors. A lot of errors.

I've tried replacing all of the imports to OpenGL but still it doesn't work.

If you're super keen the best place might be an OpenGL forum?
Title: Re: flixel-iOS for native mac games?
Post by: tokyotron on Wed, May 16, 2012
At the same time games work great in the simulator...
So should be possible.
Title: Re: flixel-iOS for native mac games?
Post by: initials on Wed, May 16, 2012
At the same time games work great in the simulator...
So should be possible.

If you figure it out, you should post how you did it.
Title: Re: flixel-iOS for native mac games?
Post by: bpercevic on Wed, May 16, 2012
I have been working at my new job for a few months now, all I do is iOS development.  So I will try to look at flixel this summer, now that I have a much better understanding of Objective-C.  I already ported much of flixel to C# for Microsoft's XNA dev platform, I can't imagine it being any more difficult in iOS. My best guess as to why we all had trouble compiling flixel in iOS is lack of knowledge behind how Objective-C works, so as soon as I have some time I'll look at flixel-iOS and I'll update you guys on it.

 :) 
Title: Re: flixel-iOS for native mac games?
Post by: initials on Wed, May 16, 2012
I have been working at my new job for a few months now, all I do is iOS development.  So I will try to look at flixel this summer, now that I have a much better understanding of Objective-C.  I already ported much of flixel to C# for Microsoft's XNA dev platform, I can't imagine it being any more difficult in iOS. My best guess as to why we all had trouble compiling flixel in iOS is lack of knowledge behind how Objective-C works, so as soon as I have some time I'll look at flixel-iOS and I'll update you guys on it.

 :)

That's awesome.
This community (for iOS) is starting to pick up some steam.

My specific problem was a lack of OpenGLes understanding, but yes, Objective C also.
I am under the impression that to get Flixel compiling for a Mac, we'd need to:

1. Change all imports of OpenGLes to OpenGL.
2. Change linked libraries to OpenGL
3. Find any calls to OpenGLes commands that aren't in OpenGL.
4. Compile.

This is based off what I've read, not experience.
Title: Re: flixel-iOS for native mac games?
Post by: tokyotron on Wed, May 16, 2012
If you figure it out, you should post how you did it.

For the simulator, I just built the original Canabalt source. Didn't try anything else yet.