开发者

GLUI problem when using cocos2d OpenGL

开发者 https://www.devze.com 2022-12-16 00:33 出处:网络
Has anyone come across this problem when building with cocos2d (OpenGL library for iPhone 2D games)? \"glui/GL/glui.h\" file is not found

Has anyone come across this problem when building with cocos2d (OpenGL library for iPhone 2D games)?

"glui/GL/glui.h" file is not found
gluOrtho2D was not declared
GL_COLOR_BUFFER_BIT was not declared.

There seems to be very little info on GLUI for iPhone on t开发者_Go百科he web. I am new to OpenGL, so appreciate the help! I have included OpenGLES CoreGraphics libraries, even tried adding linker flag "-framework GLUI" but to no avail.

Thanks!


I solved this problem by

  • removing cocos2d's external/Box2d/Testbed directory
  • adding GLUI.framework from /Library/Frameworks/GLUI.framework (and setting the framework search path)

It compiles successfully, but dies on launching in simulator with this error, which seems unrelated to the question above.

dyld: Symbol not found: _CFXMLNodeGetInfoPtr
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.2.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security


I was finally able to get this working by following a different tutorial. The Monocles tutorial is outdated since it uses cocos2d v.0.7.2.

There has been significant change to cocos2d v.0.8, which comes pre-packaged with an easy to use XCode Project Template, and in v.0.9, libraries filenames have been further improved with the CC prefix to avoid namespace collision. I would recommend this tutorial instead:

http://iphonedev.net/2009/07/12/cocos2d-example-box2d/

Also found this to be useful. http://www.mycodestudio.com/blog/2009/12/06/cocos2dpt1/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号