73519

How does GLPaint work

Question:

Ok completely OpenGL-ES noob question. If anyone could explain how apple does GLPaint or better yet the VERY BASIC code of how they accomplished that, I would be thrilled. I am honestly not trying to ask for you to write my program, but trying to understand the basics of how apple accomplished the GLPaint drawing feature.

P.S: I don't need the color conversion, just the drawing (obviously)<br /> Please help

Answer1:

I don't know why someone would produce simpler code than <a href="http://developer.apple.com/iphone/library/samplecode/GLPaint/index.html" rel="nofollow">that which already exists</a> for the Apple GLPaint example, yet does the same thing. <a href="http://www.visualnewt.com/OpenGL/learning_iphones_opengl_es/part_i_-_glpaint_dissected_.html" rel="nofollow">The analysis</a> that Kenny points to is interesting, if a little odd. I don't know if a line-by-line analysis of this example is the best way to learn what it does.

When working with OpenGL ES on the iPhone, you need to do your drawing in a particular type of Core Animation layer, a CAEAGLLayer, which is hosted inside of a UIView. The EAGLView class in that example contains boilerplate code for setting up such a layer-hosting view.

The view where the actual drawing is performed is the PaintingView, a subclass of EAGLView. The PaintingView handles touch events, and incrementally draws a brush texture every so many pixels along the line drawn by your finger. When the screen needs to be erased, the OpenGL ES context is cleared.

If it's the basic OpenGL ES setup that has you stumped, I'd recommend creating a new project based on the OpenGL ES Application template in Xcode and seeing how that very simple starting application works.

Recommend

  • Google Places Autocomplete along with google maps - load issue
  • How to check if stdin is readable in TCL?
  • synchronizing SDK with Windows 10 update and using WinRT with Standard C++
  • Groovy install HTTPBuilder now that Codehaus shutdown?
  • Objective-C: When to know that you are abusing the SIngleton method of Global Variables
  • How to fix this floating point square root algorithm
  • C++ calling the default constructor with parens vs without parens [duplicate]
  • TFS edit build log using custom activity
  • Best Datagrid for Bootstrap/jQuery?
  • Enable Bootstrap Intellisense using Angular 4 in WebStorm
  • Cassandra: What is a subcolumn
  • WebApp in AppServices vs CloudService
  • Open an application in a space using applescripts
  • RavenDB indexing errors
  • Create function that can pass a parameter without making a new component
  • how to populate a SQLite database and use that database in phonegap?
  • how to solve invalid conversion specifier warning in iphone app
  • Request response issues in biztalk
  • Plotting densities in R
  • abstracting over a collection
  • Getting media player state in windows phone 7
  • Multiple producers single consumer locking schema
  • UIAlertController button function not working
  • Android Studio Can't Find tools.jar
  • How to detect interior vertices in groups of 2d polygons? (E.g. ZIP Codes to determine a territory)
  • SAXReader not re-ecape characters
  • Position: fixed nav does not stay fixed
  • Access Android Market through SSH tunnel
  • How to add git credentials to the build so it would be able to be used within a shell code?
  • Groovy: Unexpected token “:”
  • Can you perform a UNION without a subquery in SQLAlchemy?
  • D3 nodes and links from JSON with nested arrays of children
  • How to create a file in java without a extension
  • Get data from AJAX - How to
  • ImageMagick, replace semi-transparent white with opaque white
  • How reduce the height of an mschart by breaking up the y-axis
  • MySQL WHERE-condition in procedure ignored
  • Traverse Array and Display in markup
  • MATLAB: Piecewise function in curve fitting toolbox using fittype
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass