10 2014 档案

摘要:1.uniform变量uniform变量是外部application程序传递给(vertex和fragment)shader的变量。因此它是application通过函数glUniform**()函数赋值的。在(vertex和fragment)shader程序内部,uniform变量就像是C语言里面... 阅读全文
posted @ 2014-10-27 16:05 haroel 阅读(2035) 评论(0) 推荐(0)
摘要:Lua本身是不能像C++那样直接实现继承,但我们可以用万能的table表来实现。以下我总结了三种方式的类以及继承的实现第一、官方的做法,使用元表实现 原理参照《Programming in lua》 Object.lua Object = {class_id = 0}function Objec... 阅读全文
posted @ 2014-10-24 14:18 haroel 阅读(20903) 评论(0) 推荐(0)
摘要:网上有很多cocos2d-x lua绑定c++类的接口教程,这篇文章也是总结他们的经验。其中重点参考了 http://cn.cocos2d-x.org/tutorial/show?id=1295,整个过程步骤很详细,会比较傻瓜式,希望对新手读者入门有用。教程基本环境:1.使用引擎是v3.3 beta... 阅读全文
posted @ 2014-10-22 17:34 haroel 阅读(2701) 评论(0) 推荐(0)
摘要:转自http://www.cnblogs.com/stephen-liu74/archive/2012/06/25/2417894.html在Lua中实现队列的简单方法是使用table库函数insert和remove。但是由于这种方法会导致后续元素的移动,因此当队列的数据量较大时,不建议使用该方法... 阅读全文
posted @ 2014-10-14 10:38 haroel 阅读(5572) 评论(0) 推荐(0)