开发者

Adding procedural C openGL functions to an iPhone project

开发者 https://www.devze.com 2022-12-25 23:33 出处:网络
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 p

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

精彩评论

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