开发者

Adding procedural C openGL functions to an iPhone project

I want to add a few drawing functions to an iPhone project for drawing things. Something like drawTile(x,y,len,wid); which would call openGL to draw a box somewhere. I should just be able to write a procedural C file to do 开发者_运维百科this but the openGL libraries are objective C and I'm getting weird errors. Do I have to make a class for all of my drawing commands and call class methods?


no, you should be able to define your own C functions and call them from Objective-C. Be sure that you are not defining them within @implementation or @interface blocks. Also, do you have your includes / imports set up properly?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜