Mapsforge analog for iphone - iphone

I need some framework for my iPhone app, which is using maps. Now these maps are raster images and I'd like to optimize my app by doing vector maps instead. I know that my colleagues from Android development had used Mapsforge framework for this purposes. Is there any analog of this library for iPhone? I need framework that could quickly render vector maps using hardware acceleration, caching maps, offline rendering and (optinal) be cross-platform. Any suggestions? Thanks!

ok, I've moved over my laziness and decided to move to github my forgotten almost year-ago work. This is Mapsforge for iOS, dirty code, but it should work without any additional setup. It can read .map files and asynchronously render tiles with vector objects to mapView. You can find it here: https://github.com/medvedNick/Mapsforge_iOS

Have a look at the following post: https://groups.google.com/forum/?fromgroups=#!topic/route-me-map/wbBa4h0R_iw
There is … libosmscout that do vector maps drawing (unix, windows,
QT, iOS, Android, …), routing, searching:
https://sourceforge.net/projects/libosmscout/
I did the iOS/OSX drawing code, it's not finished but works quite
well.

Related

Cross-platform development with GLKit?

I've just installed the current Xcode 4 release and realized the new "GLKit" API thats also used in the OpenGL Template for iOS. So, I want to develop an cross-plattform game for iOS, Mac & Windows. GLKit seems like a step backwards in terms of portability, but the GLKit Features (specially like asynchronous texture loading) are great benefits...
How can I develop a cross-plattform game with GLKit? I would need to write any grapics code twice, right? Or is there something like an GLKit implementation for windows?
Any idea, workaround, code-design advice (how to divide the GLKit Code from other components?) is welcome - thanks!
I can't think of anything that GLKit does which cannot be replaced by non-GLKit code. It can make some OpenGL ES 2.0 tasks simpler by abstracting them away from you, but it doesn't do anything unique. The closest it comes to having something you can't replicate elsewhere (from what I've tinkered with) is the accelerated matrix and vector math functions it provides, but even those could be replaced with a little Accelerate or NEON code.
While I'd like to use GLKit within my applications, I'm still supporting iOS 4.2 with them, which doesn't have GLKit available. There's nothing that I'm currently prevented from doing because I can't use GLKit, I just have to write a little more code to handle things like view updates, texture uploads, matrix math, etc. There's plenty of documentation and examples out there for these operations, so you don't need to worry about being on your own when it comes to implementing them.
You're going to have much larger problems than GLKit when trying to make your code be cross-platform with the Mac, and expecially so with Windows. Desktop OpenGL and OpenGL ES have some differences in their implementations, and you'll need to be aware of the places to substitute one function or built-in variable for another. CAOpenGLLayer and NSOpenGLView on the Mac are also different from the CAEAGLLayer on iOS, and AppKit overall is a different animal than UIKit.
Windows will be even more of a challenge to support, because you won't be able to use any of the Cocoa frameworks, and most likely no Objective-C as well. This will take a lot more of your time than any OpenGL / OpenGL ES differences.

CoreGraphics Alternative?

I'm looking for a 2D rendering library as an alternative to CoreGraphics on iPhone. Everything in my app is pretty dynamic, which makes splitting things up into layers and animations rather hard.
I'm quite familiar with OpenGL, and that is how rendering is implemented right now. Everything would be so much easier to expand and development would go so much faster if I didn't have to worry about the low-level stuff in OpenGL, though (And my code would look so much neater :D).
I prefer C++ over Objective-C, so if you know any C++ libraries for rendering, that would be great. I can work with C too. Path-based rendering, like in CoreGraphics or the JavaScript Canvas API, would be beneficial. Would Cairo work on iPhone?
I've actually been working on my own 2D renderer, which I'll probably release even if I don't end up using in my app, because I enjoy working on it. Does the iPhone support the stencil buffer? I can do polygon triangulation, or use GLU's tesselation library, but the stencil buffer would safe a load of work in the long run.
Edit: Also, I've implemented rendering in this app with CoreGraphics before, and it didn't get as good of a frame rate as I'd like. I did some research, and people have suggested not using CoreGraphics for things that are constantly redrawing the screen. Some said CoreGraphics doesn't use the GPU, others said it was some caching mechanism. I've avoided it ever since.
MonkVG is an OpenVG 1.1 like vector graphics API implementation currently using an OpenGL ES backend that should be compatible with any HW that supports OpenGL ES 2.0 which includes most iOS and Android devices.
This is an open source BSD licensed project that is in active development. At the time of this writing it is in a very early pre-release state (very minimal features implemented). Contributors and sponsors welcome.
It can be found at GitHub http://github.com/micahpearlman/MonkVG
Also, there is a SVG and SWF (flash) renderers built on top of MonkVG:
MonkSVG
MonkSWF

Engine for use with PC and Iphone?

Are there any engines that allow me to develop for pc and iphone at the same time? My preferred language would be c#, but that probably won't happen, so I probably will learn c++ or java.
I want a 2d engine, by the way.
No experience with it but...
http://www.torquepowered.com/products/torque-2D/
C# and Java aren't allowed on the iPhone, so a C or C++ engine would be your best bet. I'm guessing you're doing a game--if so, you'll probably want to use OpenGL. I don't know any specifically, but here's a full list.
Working with pure Core Animation layers can yield cross-platform 2-D drawing and animation between iPhone, iPad, and Mac. As an example of this, the Core Plot framework runs on Mac and iPhone from the same codebase. Core Animation lets you do some pretty complex animations and layout in 2-D.
It is against the rules in OS 4 to write an iPhone app in something other than Apple's dev tools. However, IANAL but I'd expect that it is in theory ok to take the app you made there and then try to run it on an emulation layer etc.. on the /other/ platform(s). Not sure about direct solutions, but check out the GNU Objective-C runtime / GNUStep, they might be a helpful starting point.

image filters for iphone sdk development

I am planning to develop an iphone app which makes use of image filters like blurring, sharpening,etc. I noticed that there are few approaches for this one,
Use openGL ES. I even found an example code on apple iphone dev site. How easy is openGL for somebody who has never used it? Can the image filters be implemented using the openGL framework?
There is a Quartz demo as well posted on apple iphone dev site. Has anybody used this framework for doing image processing? How is this approach compared to openGL framework?
Don't use openGL and Quartz framework. Basically access the raw pixels from the image and do the manipulation myself.
Make use of any custom built image processing libraries like this one. Do you know of any other libraries like this one?
Can anybody provide insights/suggestions on which option is the best? Your opinions are highly appreciated. Thanks!
Here is another alternative for image filtering. They provide lots of filters using core image framework.
http://www.binpress.com/app/photo-effects-sdk-for-ios/801
Quartz doesn't have access to Core Image yet on the iPhoneOS so you can't use the Core Image filters like you do on MacOS.
I would go with a dedicated library. There's a lot of overhead in OpenGL ES you don't want to miss with if you're not using it for anything else.
If your App has a support of iOS6 the use CoreGraphics and CoreImage. It contains many filters and some other approaches through which yo get other composite filters.
If you r not on iOS6 the you can use GPUImage framwork or ImageMagick.
and the last option is to manipulating pixels values, but it needs an filter algorithm to add filters on Image

How do you make maps in Flash CS4 and then use them in iPhone games?

I was watching a video showing an ngmoco rolando2 level designer.
He seemed to be using flash CS4 to make the maps.
Would anyone know how I would go about doing this?
Just in case you need to know, I am an intermediate programmer, I know both Java and Objective-C pretty well.
I don't know if any of what I'm about to say is true or not, but hopefully my input will be helpful:
It could be simply that the level used in Rolando are simply vector graphic images and the designer you saw in the video simply preferred Flash CS4 as his vector editor?
Again, I could be wrong here.
It's also possible that the game has some code that decodes flash files into usable levels somehow - assuming this would be permitted by Apple in regards to their "no interpreters" rules.
My final thought, which in my opinion would be the least likely, is that the game may be a flash game compiled to run on the iPhone using Adobe's beta flash-iphone SDK. I say this would be the least likely as I believe ngmoco haven't used this method in any of their previous games and I don't see why they would suddenly resort to this method of developing iPhone apps.
In my game Hudriks I also used flash to design levels and even make some animations.
There is no any tool to do this, so you need to develop it yourself with requirements for your game.
First of all, it depends on your game and what exactly you need to design in flash - just putting images, defining their parameters (bonus values), ground path, etc.
After that it is important to define structure of your flash file - how you store different levels (in symbols or scenes), what layers for each level you have (boundaries, objects, obstacles, etc).
If you need to have some extra information for you objects in flash, most probably, you will need to develop custom panel in flash to setup all parameters. I used setPersistentData for storing information for flash objects.
After that you need to develop script that goes through all objects in your symbols and extracts basic information, like transformation, and your custom data. I faced some problems with getting correct transformation values, especially for rotation. Had to do extra heuristics.
For animations I just used motion tween data. In my animation framework did simple implementation supporting basic parameters (transformation and alpha) and only linear curves. Fortunately, in Flash CS4 there is function copyMotion that gives you XML for the animation. You just need to parse it or convert to your own format.