Shared Variables in different source files

I started learning openGL and also started splitting my project in multiple source files for the first time too. As such I'm still a bit confused and sometimes I feel my variables are scattered around especially since openGL requires extensive use of global variables. At the moment I got about 15 files. My major problem is that some variables are for example shared by some modules and some other variables are shared only by a few of those and some other modules. If I put all these variables in a common.h file will there be any problems (performance-wise) since not all variables will be used by all modules? Using the above method I also have the problem that if I use types defined in other header files I have to include those too. I could also use '#if (defined' macros, but that doesn't seem the most appropriate method.

以上就是Shared Variables in different source files的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏