Skip to content
Permalink
Browse files

initial commit

  • Loading branch information...
Krzysztof Zabłocki
Krzysztof Zabłocki committed Apr 23, 2012
1 parent 45a8fc2 commit 8069f9e66b827481b250b61a58294bd3452a102e
Showing with 57,564 additions and 3 deletions.
  1. +24 −0 LICENCE.txt
  2. +12 −3 README.md
  3. +1,115 −0 Smooth Drawing.xcodeproj/project.pbxproj
  4. +24 −0 Smooth Drawing/AppDelegate.h
  5. +141 −0 Smooth Drawing/AppDelegate.m
  6. +30 −0 Smooth Drawing/LineDrawer.h
  7. +517 −0 Smooth Drawing/LineDrawer.m
  8. +14 −0 Smooth Drawing/Prefix.pch
  9. BIN Smooth Drawing/Resources/Default.png
  10. BIN Smooth Drawing/Resources/Icon-72.png
  11. BIN Smooth Drawing/Resources/Icon-Small-50.png
  12. BIN Smooth Drawing/Resources/Icon-Small.png
  13. BIN Smooth Drawing/Resources/Icon-Small@2x.png
  14. BIN Smooth Drawing/Resources/Icon.png
  15. BIN Smooth Drawing/Resources/Icon@2x.png
  16. +62 −0 Smooth Drawing/Resources/Info.plist
  17. BIN Smooth Drawing/Resources/fps_images-hd.png
  18. BIN Smooth Drawing/Resources/fps_images-ipadhd.png
  19. BIN Smooth Drawing/Resources/fps_images.png
  20. BIN Smooth Drawing/Resources/iTunesArtwork
  21. +76 −0 Smooth Drawing/libs/CCNode+SFGestureRecognizers/CCNode+SFGestureRecognizers.h
  22. +501 −0 Smooth Drawing/libs/CCNode+SFGestureRecognizers/CCNode+SFGestureRecognizers.m
  23. +243 −0 Smooth Drawing/libs/CocosDenshion/CDAudioManager.h
  24. +888 −0 Smooth Drawing/libs/CocosDenshion/CDAudioManager.m
  25. +60 −0 Smooth Drawing/libs/CocosDenshion/CDConfig.h
  26. +77 −0 Smooth Drawing/libs/CocosDenshion/CDOpenALSupport.h
  27. +250 −0 Smooth Drawing/libs/CocosDenshion/CDOpenALSupport.m
  28. +440 −0 Smooth Drawing/libs/CocosDenshion/CocosDenshion.h
  29. +1,601 −0 Smooth Drawing/libs/CocosDenshion/CocosDenshion.m
  30. +90 −0 Smooth Drawing/libs/CocosDenshion/SimpleAudioEngine.h
  31. +220 −0 Smooth Drawing/libs/CocosDenshion/SimpleAudioEngine.m
  32. +21 −0 Smooth Drawing/libs/LICENSE_CocosDenshion.txt
  33. +33 −0 Smooth Drawing/libs/LICENSE_Kazmath.txt
  34. +23 −0 Smooth Drawing/libs/LICENSE_cocos2d.txt
  35. +195 −0 Smooth Drawing/libs/cocos2d/CCAction.h
  36. +357 −0 Smooth Drawing/libs/cocos2d/CCAction.m
  37. +73 −0 Smooth Drawing/libs/cocos2d/CCActionCamera.h
  38. +147 −0 Smooth Drawing/libs/cocos2d/CCActionCamera.m
  39. +159 −0 Smooth Drawing/libs/cocos2d/CCActionEase.h
  40. +532 −0 Smooth Drawing/libs/cocos2d/CCActionEase.m
  41. +165 −0 Smooth Drawing/libs/cocos2d/CCActionGrid.h
  42. +386 −0 Smooth Drawing/libs/cocos2d/CCActionGrid.m
  43. +205 −0 Smooth Drawing/libs/cocos2d/CCActionGrid3D.h
  44. +652 −0 Smooth Drawing/libs/cocos2d/CCActionGrid3D.m
  45. +227 −0 Smooth Drawing/libs/cocos2d/CCActionInstant.h
  46. +510 −0 Smooth Drawing/libs/cocos2d/CCActionInstant.m
  47. +431 −0 Smooth Drawing/libs/cocos2d/CCActionInterval.h
  48. +1,442 −0 Smooth Drawing/libs/cocos2d/CCActionInterval.m
  49. +107 −0 Smooth Drawing/libs/cocos2d/CCActionManager.h
  50. +319 −0 Smooth Drawing/libs/cocos2d/CCActionManager.m
  51. +42 −0 Smooth Drawing/libs/cocos2d/CCActionPageTurn3D.h
  52. +86 −0 Smooth Drawing/libs/cocos2d/CCActionPageTurn3D.m
  53. +59 −0 Smooth Drawing/libs/cocos2d/CCActionProgressTimer.h
  54. +103 −0 Smooth Drawing/libs/cocos2d/CCActionProgressTimer.m
  55. +211 −0 Smooth Drawing/libs/cocos2d/CCActionTiledGrid.h
  56. +768 −0 Smooth Drawing/libs/cocos2d/CCActionTiledGrid.m
  57. +62 −0 Smooth Drawing/libs/cocos2d/CCActionTween.h
  58. +72 −0 Smooth Drawing/libs/cocos2d/CCActionTween.m
  59. +150 −0 Smooth Drawing/libs/cocos2d/CCAnimation.h
  60. +200 −0 Smooth Drawing/libs/cocos2d/CCAnimation.m
  61. +74 −0 Smooth Drawing/libs/cocos2d/CCAnimationCache.h
  62. +250 −0 Smooth Drawing/libs/cocos2d/CCAnimationCache.m
  63. +96 −0 Smooth Drawing/libs/cocos2d/CCAtlasNode.h
  64. +209 −0 Smooth Drawing/libs/cocos2d/CCAtlasNode.m
  65. +98 −0 Smooth Drawing/libs/cocos2d/CCCamera.h
  66. +148 −0 Smooth Drawing/libs/cocos2d/CCCamera.m
  67. +118 −0 Smooth Drawing/libs/cocos2d/CCConfiguration.h
  68. +179 −0 Smooth Drawing/libs/cocos2d/CCConfiguration.m
  69. +332 −0 Smooth Drawing/libs/cocos2d/CCDirector.h
  70. +606 −0 Smooth Drawing/libs/cocos2d/CCDirector.m
  71. +114 −0 Smooth Drawing/libs/cocos2d/CCDrawingPrimitives.h
  72. +311 −0 Smooth Drawing/libs/cocos2d/CCDrawingPrimitives.m
  73. +156 −0 Smooth Drawing/libs/cocos2d/CCGLProgram.h
  74. +395 −0 Smooth Drawing/libs/cocos2d/CCGLProgram.m
  75. +44 −0 Smooth Drawing/libs/cocos2d/CCGrabber.h
  76. +99 −0 Smooth Drawing/libs/cocos2d/CCGrabber.m
  77. +130 −0 Smooth Drawing/libs/cocos2d/CCGrid.h
  78. +572 −0 Smooth Drawing/libs/cocos2d/CCGrid.m
  79. +57 −0 Smooth Drawing/libs/cocos2d/CCLabelAtlas.h
  80. +181 −0 Smooth Drawing/libs/cocos2d/CCLabelAtlas.m
  81. +213 −0 Smooth Drawing/libs/cocos2d/CCLabelBMFont.h
  82. +930 −0 Smooth Drawing/libs/cocos2d/CCLabelBMFont.m
  83. +87 −0 Smooth Drawing/libs/cocos2d/CCLabelTTF.h
  84. +216 −0 Smooth Drawing/libs/cocos2d/CCLabelTTF.m
  85. +280 −0 Smooth Drawing/libs/cocos2d/CCLayer.h
  86. +628 −0 Smooth Drawing/libs/cocos2d/CCLayer.m
  87. +100 −0 Smooth Drawing/libs/cocos2d/CCMenu.h
  88. +554 −0 Smooth Drawing/libs/cocos2d/CCMenu.m
  89. +423 −0 Smooth Drawing/libs/cocos2d/CCMenuItem.h
  90. +854 −0 Smooth Drawing/libs/cocos2d/CCMenuItem.m
  91. +84 −0 Smooth Drawing/libs/cocos2d/CCMotionStreak.h
  92. +272 −0 Smooth Drawing/libs/cocos2d/CCMotionStreak.m
  93. +571 −0 Smooth Drawing/libs/cocos2d/CCNode.h
  94. +885 −0 Smooth Drawing/libs/cocos2d/CCNode.m
  95. +50 −0 Smooth Drawing/libs/cocos2d/CCParallaxNode.h
  96. +161 −0 Smooth Drawing/libs/cocos2d/CCParallaxNode.m
  97. +99 −0 Smooth Drawing/libs/cocos2d/CCParticleBatchNode.h
  98. +473 −0 Smooth Drawing/libs/cocos2d/CCParticleBatchNode.m
  99. +109 −0 Smooth Drawing/libs/cocos2d/CCParticleExamples.h
  100. +926 −0 Smooth Drawing/libs/cocos2d/CCParticleExamples.m
  101. +449 −0 Smooth Drawing/libs/cocos2d/CCParticleSystem.h
  102. +872 −0 Smooth Drawing/libs/cocos2d/CCParticleSystem.m
  103. +75 −0 Smooth Drawing/libs/cocos2d/CCParticleSystemQuad.h
  104. +502 −0 Smooth Drawing/libs/cocos2d/CCParticleSystemQuad.m
  105. +94 −0 Smooth Drawing/libs/cocos2d/CCProgressTimer.h
  106. +540 −0 Smooth Drawing/libs/cocos2d/CCProgressTimer.m
  107. +132 −0 Smooth Drawing/libs/cocos2d/CCProtocols.h
  108. +117 −0 Smooth Drawing/libs/cocos2d/CCRenderTexture.h
  109. +356 −0 Smooth Drawing/libs/cocos2d/CCRenderTexture.m
  110. +43 −0 Smooth Drawing/libs/cocos2d/CCScene.h
  111. +45 −0 Smooth Drawing/libs/cocos2d/CCScene.m
  112. +200 −0 Smooth Drawing/libs/cocos2d/CCScheduler.h
  113. +688 −0 Smooth Drawing/libs/cocos2d/CCScheduler.m
  114. +60 −0 Smooth Drawing/libs/cocos2d/CCShaderCache.h
  115. +214 −0 Smooth Drawing/libs/cocos2d/CCShaderCache.m
  116. +288 −0 Smooth Drawing/libs/cocos2d/CCSprite.h
  117. +951 −0 Smooth Drawing/libs/cocos2d/CCSprite.m
  118. +138 −0 Smooth Drawing/libs/cocos2d/CCSpriteBatchNode.h
  119. +663 −0 Smooth Drawing/libs/cocos2d/CCSpriteBatchNode.m
  120. +126 −0 Smooth Drawing/libs/cocos2d/CCSpriteFrame.h
  121. +183 −0 Smooth Drawing/libs/cocos2d/CCSpriteFrame.m
  122. +133 −0 Smooth Drawing/libs/cocos2d/CCSpriteFrameCache.h
  123. +375 −0 Smooth Drawing/libs/cocos2d/CCSpriteFrameCache.m
  124. +164 −0 Smooth Drawing/libs/cocos2d/CCTMXLayer.h
  125. +658 −0 Smooth Drawing/libs/cocos2d/CCTMXLayer.m
  126. +67 −0 Smooth Drawing/libs/cocos2d/CCTMXObjectGroup.h
  127. +86 −0 Smooth Drawing/libs/cocos2d/CCTMXObjectGroup.m
  128. +145 −0 Smooth Drawing/libs/cocos2d/CCTMXTiledMap.h
  129. +217 −0 Smooth Drawing/libs/cocos2d/CCTMXTiledMap.m
  130. +226 −0 Smooth Drawing/libs/cocos2d/CCTMXXMLParser.h
  131. +523 −0 Smooth Drawing/libs/cocos2d/CCTMXXMLParser.m
  132. +338 −0 Smooth Drawing/libs/cocos2d/CCTexture2D.h
  133. +827 −0 Smooth Drawing/libs/cocos2d/CCTexture2D.m
  134. +188 −0 Smooth Drawing/libs/cocos2d/CCTextureAtlas.h
  135. +545 −0 Smooth Drawing/libs/cocos2d/CCTextureAtlas.m
  136. +146 −0 Smooth Drawing/libs/cocos2d/CCTextureCache.h
  137. +505 −0 Smooth Drawing/libs/cocos2d/CCTextureCache.m
  138. +127 −0 Smooth Drawing/libs/cocos2d/CCTexturePVR.h
  139. +429 −0 Smooth Drawing/libs/cocos2d/CCTexturePVR.m
  140. +83 −0 Smooth Drawing/libs/cocos2d/CCTileMapAtlas.h
  141. +245 −0 Smooth Drawing/libs/cocos2d/CCTileMapAtlas.m
  142. +296 −0 Smooth Drawing/libs/cocos2d/CCTransition.h
  143. +1,067 −0 Smooth Drawing/libs/cocos2d/CCTransition.m
  144. +60 −0 Smooth Drawing/libs/cocos2d/CCTransitionPageTurn.h
  145. +117 −0 Smooth Drawing/libs/cocos2d/CCTransitionPageTurn.m
  146. +62 −0 Smooth Drawing/libs/cocos2d/CCTransitionProgress.h
  147. +276 −0 Smooth Drawing/libs/cocos2d/CCTransitionProgress.m
  148. +59 −0 Smooth Drawing/libs/cocos2d/Platforms/CCGL.h
  149. +78 −0 Smooth Drawing/libs/cocos2d/Platforms/CCNS.h
  150. +110 −0 Smooth Drawing/libs/cocos2d/Platforms/Mac/CCDirectorMac.h
  151. +555 −0 Smooth Drawing/libs/cocos2d/Platforms/Mac/CCDirectorMac.m
  152. +283 −0 Smooth Drawing/libs/cocos2d/Platforms/Mac/CCEventDispatcher.h
  153. +694 −0 Smooth Drawing/libs/cocos2d/Platforms/Mac/CCEventDispatcher.m
  154. +92 −0 Smooth Drawing/libs/cocos2d/Platforms/Mac/CCGLView.h
  155. +287 −0 Smooth Drawing/libs/cocos2d/Platforms/Mac/CCGLView.m
  156. +41 −0 Smooth Drawing/libs/cocos2d/Platforms/Mac/CCWindow.h
  157. +69 −0 Smooth Drawing/libs/cocos2d/Platforms/Mac/CCWindow.m
  158. +104 −0 Smooth Drawing/libs/cocos2d/Platforms/iOS/CCDirectorIOS.h
  159. +552 −0 Smooth Drawing/libs/cocos2d/Platforms/iOS/CCDirectorIOS.m
  160. +83 −0 Smooth Drawing/libs/cocos2d/Platforms/iOS/CCES2Renderer.h
  161. +248 −0 Smooth Drawing/libs/cocos2d/Platforms/iOS/CCES2Renderer.m
  162. +54 −0 Smooth Drawing/libs/cocos2d/Platforms/iOS/CCESRenderer.h
  163. +160 −0 Smooth Drawing/libs/cocos2d/Platforms/iOS/CCGLView.h
  164. +360 −0 Smooth Drawing/libs/cocos2d/Platforms/iOS/CCGLView.m
  165. +75 −0 Smooth Drawing/libs/cocos2d/Platforms/iOS/CCTouchDelegateProtocol.h
  166. +120 −0 Smooth Drawing/libs/cocos2d/Platforms/iOS/CCTouchDispatcher.h
  167. +341 −0 Smooth Drawing/libs/cocos2d/Platforms/iOS/CCTouchDispatcher.m
  168. +93 −0 Smooth Drawing/libs/cocos2d/Platforms/iOS/CCTouchHandler.h
  169. +135 −0 Smooth Drawing/libs/cocos2d/Platforms/iOS/CCTouchHandler.m
  170. +106 −0 Smooth Drawing/libs/cocos2d/Support/CCArray.h
  171. +304 −0 Smooth Drawing/libs/cocos2d/Support/CCArray.m
  172. +132 −0 Smooth Drawing/libs/cocos2d/Support/CCFileUtils.h
  173. +319 −0 Smooth Drawing/libs/cocos2d/Support/CCFileUtils.m
  174. +89 −0 Smooth Drawing/libs/cocos2d/Support/CCProfiling.h
  175. +186 −0 Smooth Drawing/libs/cocos2d/Support/CCProfiling.m
  176. +36 −0 Smooth Drawing/libs/cocos2d/Support/CCVertex.h
  177. +138 −0 Smooth Drawing/libs/cocos2d/Support/CCVertex.m
  178. +344 −0 Smooth Drawing/libs/cocos2d/Support/CGPointExtension.h
  179. +196 −0 Smooth Drawing/libs/cocos2d/Support/CGPointExtension.m
  180. +22 −0 Smooth Drawing/libs/cocos2d/Support/NSThread+performBlock.h
  181. +76 −0 Smooth Drawing/libs/cocos2d/Support/NSThread+performBlock.m
  182. +86 −0 Smooth Drawing/libs/cocos2d/Support/OpenGL_Internal.h
  183. +55 −0 Smooth Drawing/libs/cocos2d/Support/TGAlib.h
  184. +274 −0 Smooth Drawing/libs/cocos2d/Support/TGAlib.m
  185. +37 −0 Smooth Drawing/libs/cocos2d/Support/TransformUtils.h
  186. +47 −0 Smooth Drawing/libs/cocos2d/Support/TransformUtils.m
  187. +91 −0 Smooth Drawing/libs/cocos2d/Support/ZipUtils.h
  188. +250 −0 Smooth Drawing/libs/cocos2d/Support/ZipUtils.m
  189. +93 −0 Smooth Drawing/libs/cocos2d/Support/base64.c
  190. +33 −0 Smooth Drawing/libs/cocos2d/Support/base64.h
  191. +460 −0 Smooth Drawing/libs/cocos2d/Support/ccCArray.h
  192. +20 −0 Smooth Drawing/libs/cocos2d/Support/ccUtils.c
  193. +36 −0 Smooth Drawing/libs/cocos2d/Support/ccUtils.h
  194. +972 −0 Smooth Drawing/libs/cocos2d/Support/uthash.h
  195. +490 −0 Smooth Drawing/libs/cocos2d/Support/utlist.h
  196. +245 −0 Smooth Drawing/libs/cocos2d/ccConfig.h
  197. +219 −0 Smooth Drawing/libs/cocos2d/ccDeprecated.h
  198. +328 −0 Smooth Drawing/libs/cocos2d/ccDeprecated.m
  199. +143 −0 Smooth Drawing/libs/cocos2d/ccGLStateCache.h
  200. +226 −0 Smooth Drawing/libs/cocos2d/ccGLStateCache.m
  201. +342 −0 Smooth Drawing/libs/cocos2d/ccMacros.h
  202. +12 −0 Smooth Drawing/libs/cocos2d/ccShader_PositionColor_frag.h
  203. +17 −0 Smooth Drawing/libs/cocos2d/ccShader_PositionColor_vert.h
  204. +16 −0 Smooth Drawing/libs/cocos2d/ccShader_PositionTextureA8Color_frag.h
  205. +21 −0 Smooth Drawing/libs/cocos2d/ccShader_PositionTextureA8Color_vert.h
  206. +23 −0 Smooth Drawing/libs/cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h
  207. +14 −0 Smooth Drawing/libs/cocos2d/ccShader_PositionTextureColor_frag.h
  208. +22 −0 Smooth Drawing/libs/cocos2d/ccShader_PositionTextureColor_vert.h
  209. +13 −0 Smooth Drawing/libs/cocos2d/ccShader_PositionTexture_frag.h
  210. +16 −0 Smooth Drawing/libs/cocos2d/ccShader_PositionTexture_uColor_frag.h
  211. +18 −0 Smooth Drawing/libs/cocos2d/ccShader_PositionTexture_uColor_vert.h
  212. +17 −0 Smooth Drawing/libs/cocos2d/ccShader_PositionTexture_vert.h
  213. +12 −0 Smooth Drawing/libs/cocos2d/ccShader_Position_uColor_frag.h
  214. +19 −0 Smooth Drawing/libs/cocos2d/ccShader_Position_uColor_vert.h
  215. +45 −0 Smooth Drawing/libs/cocos2d/ccShaders.h
  216. +65 −0 Smooth Drawing/libs/cocos2d/ccShaders.m
  217. +335 −0 Smooth Drawing/libs/cocos2d/ccTypes.h
  218. +176 −0 Smooth Drawing/libs/cocos2d/cocos2d.h
  219. +34 −0 Smooth Drawing/libs/cocos2d/cocos2d.m
  220. +51 −0 Smooth Drawing/libs/kazmath/include/kazmath/GL/mat4stack.h
  221. +58 −0 Smooth Drawing/libs/kazmath/include/kazmath/GL/matrix.h
  222. +53 −0 Smooth Drawing/libs/kazmath/include/kazmath/aabb.h
  223. +39 −0 Smooth Drawing/libs/kazmath/include/kazmath/kazmath.h
  224. +75 −0 Smooth Drawing/libs/kazmath/include/kazmath/mat3.h
  225. +93 −0 Smooth Drawing/libs/kazmath/include/kazmath/mat4.h
  226. +41 −0 Smooth Drawing/libs/kazmath/include/kazmath/neon_matrix_impl.h
  227. +70 −0 Smooth Drawing/libs/kazmath/include/kazmath/plane.h
  228. +113 −0 Smooth Drawing/libs/kazmath/include/kazmath/quaternion.h
  229. +50 −0 Smooth Drawing/libs/kazmath/include/kazmath/ray2.h
  230. +74 −0 Smooth Drawing/libs/kazmath/include/kazmath/utility.h
  231. +64 −0 Smooth Drawing/libs/kazmath/include/kazmath/vec2.h
  232. +68 −0 Smooth Drawing/libs/kazmath/include/kazmath/vec3.h
  233. +68 −0 Smooth Drawing/libs/kazmath/include/kazmath/vec4.h
  234. +14 −0 Smooth Drawing/libs/kazmath/src/CMakeLists.txt
  235. +738 −0 Smooth Drawing/libs/kazmath/src/ChangeLog
  236. +74 −0 Smooth Drawing/libs/kazmath/src/GL/mat4stack.c
  237. +191 −0 Smooth Drawing/libs/kazmath/src/GL/matrix.c
  238. +63 −0 Smooth Drawing/libs/kazmath/src/aabb.c
  239. +372 −0 Smooth Drawing/libs/kazmath/src/mat3.c
  240. +789 −0 Smooth Drawing/libs/kazmath/src/mat4.c
  241. +97 −0 Smooth Drawing/libs/kazmath/src/neon_matrix_impl.c
  242. +175 −0 Smooth Drawing/libs/kazmath/src/plane.c
  243. +582 −0 Smooth Drawing/libs/kazmath/src/quaternion.c
  244. +184 −0 Smooth Drawing/libs/kazmath/src/ray2.c
  245. +59 −0 Smooth Drawing/libs/kazmath/src/utility.c
  246. +118 −0 Smooth Drawing/libs/kazmath/src/vec2.c
  247. +310 −0 Smooth Drawing/libs/kazmath/src/vec3.c
  248. +154 −0 Smooth Drawing/libs/kazmath/src/vec4.c
  249. +17 −0 Smooth Drawing/main.m
@@ -0,0 +1,24 @@
/*
* Smooth drawing: http://merowing.info
*
* Copyright (c) 2012 Krzysztof Zabłocki
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
@@ -1,4 +1,13 @@
smooth-drawing
==============
Purpose
--------------

iOS Project showing how to create a drawing app with really nice and smooth lines...
Smooth drawing is a sample project showing exactly how to create a nice and smooth drawing application, it draws nice anti-aliased lines and the feel is really natural, you can read about it's creation at: http://merowing.info
I decided to create this after finding out that there isn't really a complete solution released and many people try to make something like that but fail at some point. I Hope you like it, spread the word so that more people will be able to learn / use this.


ARC Compatibility
------------------

Project uses ARC, I put all the code inside LineDrawer class ( don't worry it's only ~500 lines ) so that you can just add -fno-objc-arc in non-ARC projects.

Spread the word and read my blog post about this project to learn more.

Large diffs are not rendered by default.

@@ -0,0 +1,24 @@
//
// AppDelegate.h
// Smooth Drawing
//
// Created by roche on 4/23/12.
// Copyright __MyCompanyName__ 2012. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "cocos2d.h"

@interface AppController : NSObject <UIApplicationDelegate, CCDirectorDelegate>
{
UIWindow *window_;
UINavigationController *navController_;

CCDirectorIOS *__unsafe_unretained director_; // weak ref
}

@property (nonatomic) UIWindow *window;
@property (readonly) UINavigationController *navController;
@property (unsafe_unretained, readonly) CCDirectorIOS *director;

@end
@@ -0,0 +1,141 @@
//
// AppDelegate.m
// Smooth Drawing
//
// Created by roche on 4/23/12.
// Copyright __MyCompanyName__ 2012. All rights reserved.
//

#import "cocos2d.h"

#import "AppDelegate.h"
#import "LineDrawer.h"

@implementation AppController

@synthesize window=window_, navController=navController_, director=director_;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Create the main window
window_ = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];


// Create an CCGLView with a RGB565 color buffer, and a depth buffer of 0-bits
CCGLView *glView = [CCGLView viewWithFrame:[window_ bounds]
pixelFormat:kEAGLColorFormatRGB565 //kEAGLColorFormatRGBA8
depthFormat:0 //GL_DEPTH_COMPONENT24_OES
preserveBackbuffer:NO
sharegroup:nil
multiSampling:NO
numberOfSamples:0];

director_ = (CCDirectorIOS*) [CCDirector sharedDirector];

director_.wantsFullScreenLayout = YES;

// Display FSP and SPF
[director_ setDisplayStats:YES];

// set FPS at 60
[director_ setAnimationInterval:1.0/60];

// attach the openglView to the director
[director_ setView:glView];

// for rotation and other messages
[director_ setDelegate:self];

// 2D projection
[director_ setProjection:kCCDirectorProjection2D];
// [director setProjection:kCCDirectorProjection3D];

// Enables High Res mode (Retina Display) on iPhone 4 and maintains low res on all other devices
if( ! [director_ enableRetinaDisplay:YES] )
CCLOG(@"Retina Display Not supported");

// Create a Navigation Controller with the Director
navController_ = [[UINavigationController alloc] initWithRootViewController:director_];
navController_.navigationBarHidden = YES;

// set the Navigation Controller as the root view controller
// [window_ setRootViewController:rootViewController_];
[window_ addSubview:navController_.view];

// make main window visible
[window_ makeKeyAndVisible];

// Default texture format for PNG/BMP/TIFF/JPEG/GIF images
// It can be RGBA8888, RGBA4444, RGB5_A1, RGB565
// You can change anytime.
[CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_RGBA8888];

// When in iPhone RetinaDisplay, iPad, iPad RetinaDisplay mode, CCFileUtils will append the "-hd", "-ipad", "-ipadhd" to all loaded files
// If the -hd, -ipad, -ipadhd files are not found, it will load the non-suffixed version
[CCFileUtils setiPhoneRetinaDisplaySuffix:@"-hd"]; // Default on iPhone RetinaDisplay is "-hd"
[CCFileUtils setiPadSuffix:@"-ipad"]; // Default on iPad is "" (empty string)
[CCFileUtils setiPadRetinaDisplaySuffix:@"-ipadhd"]; // Default on iPad RetinaDisplay is "-ipadhd"

// Assume that PVR images have premultiplied alpha
[CCTexture2D PVRImagesHavePremultipliedAlpha:YES];

// and add the scene to the stack. The director will run it when it automatically when the view is displayed.
CCScene *scene = [CCScene node];
[scene addChild:[LineDrawer node]];
[director_ pushScene: scene];

return YES;
}

// Supported orientations: Landscape. Customize it for your own needs
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}


// getting a call, pause the game
-(void) applicationWillResignActive:(UIApplication *)application
{
if( [navController_ visibleViewController] == director_ )
[director_ pause];
}

// call got rejected
-(void) applicationDidBecomeActive:(UIApplication *)application
{
if( [navController_ visibleViewController] == director_ )
[director_ resume];
}

-(void) applicationDidEnterBackground:(UIApplication*)application
{
if( [navController_ visibleViewController] == director_ )
[director_ stopAnimation];
}

-(void) applicationWillEnterForeground:(UIApplication*)application
{
if( [navController_ visibleViewController] == director_ )
[director_ startAnimation];
}

// application will be killed
- (void)applicationWillTerminate:(UIApplication *)application
{
CC_DIRECTOR_END();
}

// purge memory
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
{
[[CCDirector sharedDirector] purgeCachedData];
}

// next delta time will be zero
-(void) applicationSignificantTimeChange:(UIApplication *)application
{
[[CCDirector sharedDirector] setNextDeltaTimeZero:YES];
}

@end
@@ -0,0 +1,30 @@
/*
* Smooth drawing: http://merowing.info
*
* Copyright (c) 2012 Krzysztof Zabłocki
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/


#import "cocos2d.h"

@interface LineDrawer : CCLayer
@end

0 comments on commit 8069f9e

Please sign in to comment.
You can’t perform that action at this time.