How to get started in graphics?

Discussion in 'iOS Programming' started by maplestar, Mar 20, 2010.

  1. maplestar macrumors member

    Joined:
    Oct 16, 2008
    #1
    So I've always wanted to try to jump into the iPhone (and now iPad) developing bandwagon. I was wondering if the community could just help me get started.

    I have plenty of coding experience in C++ and Objective C, though mainly with controlling robots and manipulating real objects. In all of these experiences, I was given an API with objects that represented real objects with various functions to control the object (motor drivers, pneumatics, etc.).

    I have looked up extensively on basically how the iPhone and Mac OS X works in general in terms of application development, such as the MVC development style and have gone through a few books of creating interfaces in Xcode and such.

    However, I am still very confused. One of the main reasons, I believe, is that I don't really understand how OS X is organized. For example, I have a great idea about a 2D game that I would like to make. However, when looking up iPhone OS frameworks, I really don't understand which framework of the 6 types to use. When I try to look into each one, they all seem to overlap in some way or another. The Core Animation framework animates things, but exactly what can it animate? Quartz 2D draws paths and shades images on the screen? But doesn't UIKit or Core Graphics do something similar?

    I'm aware that there must be some sort of organization but I really can't find a site or a tutorial that clearly explained what the frameworks are and how to know which one to use. Making an application is much different from my robotics experience because it was easy to understand that the Jaguar class controlled the Jaguar motor drivers. Now, there's no dedicated "graphics" framework that allows me to manipulate graphics.

    Could someone explain to me how the graphics situation works on the iPhone and how to determine what you need to use?
     
  2. oneeach macrumors member

    Joined:
    Feb 12, 2010
    #2
    They are layers built on top of each other. Core Graphics / Quartz 2D (I'm not sure which one) is used to draw the textures that represent the UI elements then Open GL puts them on the screen. Core Animation adds a layer to make moving things around much easier and the UI Kit then adds the concept of Controls.

    Core Animation is very flexible, however I'm going to over simplify it. It allows you to animate 2D rectangles in 3D space. You can move, resize and change color/opacity. This is how things like Cover Flow works as well as all of the transitions you see in the iPhone OS.

    Yes, that's it exactly. However, it is also considered the slowest way to do things. For speed sensitive applications you will typically use Open GL ES even for a 2D application/game.

    UIKit will call Quartz 2D / Core Graphics to do the drawing. I'll be honest here, I haven't dug into the differences between Core Graphics and Quartz 2D on the iPhone. However, it is my understanding that only the classes that support Core Animation are present in Core Graphics.
     
  3. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #3
    Have you read through here? The first few paragraphs explain what the frameworks do.
    http://developer.apple.com/iphone/l...de/GraphicsandDrawing/GraphicsandDrawing.html

    Also look here:
    http://developer.apple.com/mac/library/referencelibrary/GettingStarted/GS_GraphicsImaging/index.html

    Don't underestimate the speed of Quartz. If you optimize your drawing you can make it go quite fast.

    http://developer.apple.com/mac/libr...ngwithquartz2d/Introduction/Introduction.html

    Quartz is part of the Core Graphics framework. But then there's a QuartzCore framework :). Quartz isn't used for any actual code, it's all prefixed with CG when using the C API. Basically, Quartz is Apple's marketing name and CoreGraphics is the name of the framework and code prefix. For the most part they're used interchangeably.
     
  4. maplestar thread starter macrumors member

    Joined:
    Oct 16, 2008
    #4
    Thanks

    Thanks for the help.

    So as I understand it the many different "Core technologies" are basically higher level frameworks that Apple has designed to speed the coding.

    For graphics specifically, all the technologies utilizes the underlying pinnings of OpenGL, which essentially bridges the Graphics Hardware of the device to the drawings on the screen.

    While this does clear up on the organization of Apple frameworks in general, I'm still slightly confused on animating 2D. The reason for this is because within Core Animation, UIKit, Core Graphics/Quartz 2D, they all have differences but similarities. I guess my question is, is there a general guideline to what developers use to do certain things? As in, if I were to tell you that I need to have little planes that move around depending on user input, would you immediately direct me to UIKit or Quartz2D to accomplish the task? If I were to ask to build a custom User Interface for a game (That animates menus when you click them) would you also have an immediate answer for what to use?

    Or is it just play by experience or use whatever suits you the best?
     

Share This Page