SpringDragon

导航

 

2019年11月19日

摘要: 根据工程需求,自动生成代码工具 阅读全文
posted @ 2019-11-19 16:55 chenquanlong 阅读(228) 评论(0) 推荐(0) 编辑
 

2019年7月4日

摘要: https://www.cnblogs.com/whwy/p/8818020.html 阅读全文
posted @ 2019-07-04 10:30 chenquanlong 阅读(377) 评论(0) 推荐(0) 编辑
 

2019年6月10日

摘要: 在计算机体系结构中,管线定义为数据序列并用于处理元素。其中,某一元素的输出内容将用作下一阶段的输入内容。 相应地,GPU渲染管线接收3D场景的表达内容,并将作为输入数据。随后,将计算2D多边形的像素颜色,并输出场景图像。 渲染管线主要由以下各阶段组成: 顶点处理阶段,光栅化阶段,片元处理阶段和输出合 阅读全文
posted @ 2019-06-10 15:53 chenquanlong 阅读(467) 评论(0) 推荐(0) 编辑
 

2019年5月28日

摘要: --对于一个对象来说,是有属性和方法的 person = {name = "chenquanlong",age=18}; --第一种 --[[ person.eat = function() print(person.name.."在吃饭") end --]] --当使用:定义一个值的时候,我们可以在这个方法里面使用self function person:eat() p... 阅读全文
posted @ 2019-05-28 11:45 chenquanlong 阅读(177) 评论(0) 推荐(0) 编辑
 
摘要: 1.简单模式: -- 以只读方式打开文件 file = io.open("test.lua", "r") -- 设置默认输入文件为 test.lua io.input(file) -- 输出文件第一行 print(io.read()) -- 关闭打开的文件 io.close(file) -- 以附加的方式打开只写文件 file = io.open("t... 阅读全文
posted @ 2019-05-28 11:44 chenquanlong 阅读(163) 评论(0) 推荐(0) 编辑
 
摘要: 什么是协同(coroutine)? 协程是针对函数来说的,本来是一个普通的函数,我们只是让这个函数有协程的功能,可以理解为一个协程函数 Lua 协同程序(coroutine)与线程比较类似:拥有独立的堆栈,独立的局部变量,独立的指令指针,同时又与其它协同程序共享全局变量和其它大部分东西。 协同是非常 阅读全文
posted @ 2019-05-28 11:42 chenquanlong 阅读(668) 评论(0) 推荐(0) 编辑
 
摘要: tableA = {"lua","java","c++"}tableB = {"PHP","lua"}tableA = setmetatable(tableA,tableB);--设置tableB为tableA的元表,返回的为普通表for k,v in pairs(getmetatable(tabl 阅读全文
posted @ 2019-05-28 11:40 chenquanlong 阅读(267) 评论(0) 推荐(0) 编辑
 
摘要: 模块就相当于C#中的命名空间创建模块: module = {}; module.var = "longlong"; module.func1 = function() print("这个是模块里面的函数"); end return module使用模块: require "module";--引用模 阅读全文
posted @ 2019-05-28 11:37 chenquanlong 阅读(108) 评论(0) 推荐(0) 编辑
 
摘要: mytabel = {"lua"}mytabel[1]=nil;--将这个键值对进行销毁,该表的一号位置为nilmytabel = nil;--释放表占用的内存拼接: mytabel = {"lua","C#","java",1}; print(table.concat(mytabel,“ ”,2, 阅读全文
posted @ 2019-05-28 11:36 chenquanlong 阅读(137) 评论(0) 推荐(0) 编辑
 
摘要: While循环:a=1;while(a<20) do if(a%2==1) then print(a); end a=a+1;endfor循环:1、数值for循环for var = start,end,step do --循环体end这里var会从start开始变化到end,每次变化加一个step进 阅读全文
posted @ 2019-05-28 11:35 chenquanlong 阅读(270) 评论(0) 推荐(0) 编辑