mirror of https://github.com/axmolengine/axmol.git
Merge pull request #13437 from fusijie/fix_lua_testcase_setPointer_error
Fixed setVertexAttribPointer luabinding and Test case.
This commit is contained in:
commit
1f735b4f0e
|
@ -7213,67 +7213,6 @@ static int lua_cocos2dx_GLProgramState_setVertexAttribPointer(lua_State* tolua_S
|
||||||
lua_settop(tolua_S, 1);
|
lua_settop(tolua_S, 1);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (argc == 7)
|
|
||||||
{
|
|
||||||
std::string arg0;
|
|
||||||
int arg1;
|
|
||||||
unsigned int arg2;
|
|
||||||
bool arg3;
|
|
||||||
int arg4;
|
|
||||||
GLfloat* arg5;
|
|
||||||
int arg6;
|
|
||||||
|
|
||||||
|
|
||||||
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setVertexAttribPointer");
|
|
||||||
|
|
||||||
ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.GLProgramState:setVertexAttribPointer");
|
|
||||||
|
|
||||||
ok &= luaval_to_uint32(tolua_S, 4,&arg2, "cc.GLProgramState:setVertexAttribPointer");
|
|
||||||
|
|
||||||
ok &= luaval_to_boolean(tolua_S, 5, &arg3, "cc.GLProgramState:setVertexAttribPointer");
|
|
||||||
|
|
||||||
ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4, "cc.GLProgramState:setVertexAttribPointer");
|
|
||||||
|
|
||||||
ok &= luaval_to_int32(tolua_S, 8, (int *)&arg6, "cc.GLProgramState:setVertexAttribPointer");
|
|
||||||
|
|
||||||
size_t len = lua_objlen(tolua_S, 7);
|
|
||||||
|
|
||||||
if (len != arg6)
|
|
||||||
{
|
|
||||||
luaL_error(tolua_S, "table size is %zu,but input size is %d \n", len, arg6);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
arg5 = new (std::nothrow) GLfloat[len];
|
|
||||||
for (int i = 0; i < len; i++)
|
|
||||||
{
|
|
||||||
lua_pushnumber(tolua_S,i + 1);
|
|
||||||
lua_gettable(tolua_S,7);
|
|
||||||
bool isnum = true;
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
if (!tolua_isnumber(tolua_S, -1, 0, &tolua_err))
|
|
||||||
{
|
|
||||||
isnum = false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (isnum)
|
|
||||||
{
|
|
||||||
arg5[i] = tolua_tonumber(tolua_S, -1, 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
arg5[i] = 0;
|
|
||||||
}
|
|
||||||
lua_pop(tolua_S, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
cobj->setVertexAttribPointer(arg0, arg1, arg2, arg3, arg4, (void*)arg5);
|
|
||||||
|
|
||||||
CC_SAFE_DELETE(arg5);
|
|
||||||
|
|
||||||
lua_settop(tolua_S, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setVertexAttribPointer",argc, 6);
|
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setVertexAttribPointer",argc, 6);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -190,268 +190,111 @@ local function OpenGLTestMainLayer()
|
||||||
return RetroEffectlayer
|
return RetroEffectlayer
|
||||||
end
|
end
|
||||||
|
|
||||||
local function createShaderMajoriTest()
|
local function createShaderNodeLayer(vSource, fSource)
|
||||||
local majorLayer = cc.Layer:create()
|
local shaderNodeLayer = cc.Layer:create()
|
||||||
|
|
||||||
InitTitle(majorLayer)
|
InitTitle(shaderNodeLayer)
|
||||||
|
|
||||||
local fileUtiles = cc.FileUtils:getInstance()
|
local vertSource = vSource
|
||||||
|
local fragSource = fSource
|
||||||
local vertSource = vertDefaultSource
|
local glProgram = cc.GLProgram:createWithByteArrays(vertSource, fragSource)
|
||||||
local fragSource = fileUtiles:getStringFromFile("Shaders/example_Monjori.fsh")
|
glProgram:retain()
|
||||||
local glProgam = cc.GLProgram:createWithByteArrays(vertSource, fragSource)
|
|
||||||
local glprogramstate = cc.GLProgramState:getOrCreateWithGLProgram(glProgam)
|
|
||||||
local resolution = cc.p(256, 256)
|
|
||||||
|
|
||||||
local glNode = gl.glNodeCreate()
|
local glNode = gl.glNodeCreate()
|
||||||
glNode:setContentSize(cc.size(256, 256))
|
|
||||||
glNode:setAnchorPoint(cc.p(0.5, 0.5))
|
|
||||||
glNode:setGLProgramState(glprogramstate)
|
|
||||||
glNode:getGLProgramState():setUniformVec2("resolution", resolution)
|
|
||||||
|
|
||||||
local function updateMajori(fTime)
|
local resolution = cc.p(256, 256)
|
||||||
|
local director = cc.Director:getInstance()
|
||||||
|
local frameSize = director:getOpenGLView():getFrameSize()
|
||||||
|
local visibleSize = director:getVisibleSize()
|
||||||
|
local retinaFactor = director:getOpenGLView():getRetinaFactor()
|
||||||
|
local center = cc.p( size.width / 2 * frameSize.width / visibleSize.width * retinaFactor, size.height / 2 * frameSize.height / visibleSize.height * retinaFactor)
|
||||||
|
|
||||||
|
local function initBuffers()
|
||||||
|
local w = 256
|
||||||
|
local h = 256
|
||||||
|
local x = size.width / 2 - w / 2
|
||||||
|
local y = size.height / 2 -h / 2
|
||||||
|
local vertices ={ x,y, x+w,y, x+w,y+h, x,y, x,y+h, x+w,y+h }
|
||||||
|
local vbo = gl.createBuffer()
|
||||||
|
gl.bindBuffer(gl.ARRAY_BUFFER, vbo)
|
||||||
|
gl.bufferData(gl.ARRAY_BUFFER, table.getn(vertices), vertices, gl.STATIC_DRAW)
|
||||||
|
gl.bindBuffer(gl.ARRAY_BUFFER, 0)
|
||||||
|
return vbo
|
||||||
|
end
|
||||||
|
|
||||||
|
local vbo = initBuffers()
|
||||||
|
|
||||||
|
local function update(fTime)
|
||||||
time = time + fTime
|
time = time + fTime
|
||||||
end
|
end
|
||||||
|
|
||||||
local function majoriDraw(transform, transformUpdated)
|
local function draw(transform, transformUpdated)
|
||||||
local w = 256
|
glProgram:use()
|
||||||
local h = 256
|
glProgram:setUniformsForBuiltins()
|
||||||
|
|
||||||
local vertices ={ 0,0, w,0, w,h, 0,0, 0,h, w,h }
|
local uniformCenter = gl.getUniformLocation(glProgram:getProgram(), "center")
|
||||||
local glProgramState = glNode:getGLProgramState()
|
glProgram:setUniformLocationF32(uniformCenter, center.x, center.y)
|
||||||
glProgramState:setVertexAttribPointer("a_position", 2, gl.FLOAT, false, 0, vertices, #vertices)
|
local uniformResolution = gl.getUniformLocation(glProgram:getProgram(), "resolution")
|
||||||
glProgramState:apply(transform)
|
glProgram:setUniformLocationF32(uniformResolution, resolution.x, resolution.y)
|
||||||
|
|
||||||
|
gl.glEnableVertexAttribs(cc.VERTEX_ATTRIB_FLAG_POSITION)
|
||||||
|
gl.bindBuffer(gl.ARRAY_BUFFER, vbo)
|
||||||
|
gl.vertexAttribPointer(cc.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0);
|
||||||
gl.drawArrays(gl.TRIANGLES, 0, 6)
|
gl.drawArrays(gl.TRIANGLES, 0, 6)
|
||||||
|
gl.bindBuffer(gl.ARRAY_BUFFER, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
majorLayer:scheduleUpdateWithPriorityLua(updateMajori,0)
|
shaderNodeLayer:scheduleUpdateWithPriorityLua(update,0)
|
||||||
glNode:registerScriptDrawHandler(majoriDraw)
|
glNode:registerScriptDrawHandler(draw)
|
||||||
time = 0
|
time = 0
|
||||||
majorLayer:addChild(glNode,-10)
|
shaderNodeLayer:addChild(glNode,-10)
|
||||||
glNode:setPosition( size.width/2, size.height/2)
|
glNode:setPosition( size.width/2, size.height/2)
|
||||||
local center = cc.p( size.width / 2 * scaleFactor, size.height / 2 * scaleFactor)
|
|
||||||
glNode:getGLProgramState():setUniformVec2("center", center)
|
local function onNodeEvent(event)
|
||||||
return majorLayer
|
if "exit" == event then
|
||||||
|
glProgram:release()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
shaderNodeLayer:registerScriptHandler(onNodeEvent)
|
||||||
|
|
||||||
|
return shaderNodeLayer
|
||||||
|
end
|
||||||
|
|
||||||
|
local function createShaderMajoriTest()
|
||||||
|
local vSource = vertDefaultSource
|
||||||
|
local fSource = cc.FileUtils:getInstance():getStringFromFile("Shaders/example_Monjori.fsh")
|
||||||
|
return createShaderNodeLayer(vSource, fSource)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function createShaderMandelbrotTest()
|
local function createShaderMandelbrotTest()
|
||||||
local mandelbrotLayer = cc.Layer:create()
|
local vSource = vertDefaultSource
|
||||||
|
local fSource = cc.FileUtils:getInstance():getStringFromFile("Shaders/example_Mandelbrot.fsh")
|
||||||
InitTitle(mandelbrotLayer)
|
return createShaderNodeLayer(vSource, fSource)
|
||||||
|
|
||||||
local fileUtiles = cc.FileUtils:getInstance()
|
|
||||||
local vertSource = vertDefaultSource
|
|
||||||
local fragSource = fileUtiles:getStringFromFile("Shaders/example_Mandelbrot.fsh")
|
|
||||||
local glProgam = cc.GLProgram:createWithByteArrays(vertSource, fragSource)
|
|
||||||
local glprogramstate = cc.GLProgramState:getOrCreateWithGLProgram(glProgam)
|
|
||||||
local resolution = cc.p(256, 256)
|
|
||||||
|
|
||||||
local glNode = gl.glNodeCreate()
|
|
||||||
glNode:setContentSize(cc.size(256, 256))
|
|
||||||
glNode:setAnchorPoint(cc.p(0.5, 0.5))
|
|
||||||
glNode:setGLProgramState(glprogramstate)
|
|
||||||
glNode:getGLProgramState():setUniformVec2("resolution", resolution)
|
|
||||||
|
|
||||||
local function updateMandelbrot(fTime)
|
|
||||||
time = time + fTime
|
|
||||||
end
|
|
||||||
|
|
||||||
local function mandelbrotDraw(transform, transformUpdated)
|
|
||||||
local w = 256
|
|
||||||
local h = 256
|
|
||||||
|
|
||||||
local vertices ={ 0,0, w,0, w,h, 0,0, 0,h, w,h }
|
|
||||||
local glProgramState = glNode:getGLProgramState()
|
|
||||||
glProgramState:setVertexAttribPointer("a_position", 2, gl.FLOAT, false, 0, vertices, #vertices)
|
|
||||||
glProgramState:apply(transform)
|
|
||||||
gl.drawArrays(gl.TRIANGLES, 0, 6)
|
|
||||||
end
|
|
||||||
|
|
||||||
mandelbrotLayer:scheduleUpdateWithPriorityLua(updateMandelbrot,0)
|
|
||||||
glNode:registerScriptDrawHandler(mandelbrotDraw)
|
|
||||||
time = 0
|
|
||||||
mandelbrotLayer:addChild(glNode,-10)
|
|
||||||
glNode:setPosition( size.width/2, size.height/2)
|
|
||||||
local center = cc.p( size.width / 2 * scaleFactor, size.height / 2 * scaleFactor)
|
|
||||||
glNode:getGLProgramState():setUniformVec2("center", center)
|
|
||||||
return mandelbrotLayer
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function createShaderHeartTest()
|
local function createShaderHeartTest()
|
||||||
|
local vSource = vertDefaultSource
|
||||||
local heartLayer = cc.Layer:create()
|
local fSource = cc.FileUtils:getInstance():getStringFromFile("Shaders/example_Heart.fsh")
|
||||||
|
return createShaderNodeLayer(vSource, fSource)
|
||||||
InitTitle(heartLayer)
|
|
||||||
|
|
||||||
local fileUtiles = cc.FileUtils:getInstance()
|
|
||||||
local vertSource = vertDefaultSource
|
|
||||||
local fragSource = fileUtiles:getStringFromFile("Shaders/example_Heart.fsh")
|
|
||||||
local glProgam = cc.GLProgram:createWithByteArrays(vertSource, fragSource)
|
|
||||||
local glprogramstate = cc.GLProgramState:getOrCreateWithGLProgram(glProgam)
|
|
||||||
local resolution = cc.p(256, 256)
|
|
||||||
|
|
||||||
local glNode = gl.glNodeCreate()
|
|
||||||
glNode:setContentSize(cc.size(256, 256))
|
|
||||||
glNode:setAnchorPoint(cc.p(0.5, 0.5))
|
|
||||||
glNode:setGLProgramState(glprogramstate)
|
|
||||||
glNode:getGLProgramState():setUniformVec2("resolution", resolution)
|
|
||||||
|
|
||||||
local function updateHeart(fTime)
|
|
||||||
time = time + fTime
|
|
||||||
end
|
|
||||||
|
|
||||||
local function heartDraw(transform, transformUpdated)
|
|
||||||
local w = 256
|
|
||||||
local h = 256
|
|
||||||
|
|
||||||
local vertices ={ 0,0, w,0, w,h, 0,0, 0,h, w,h }
|
|
||||||
local glProgramState = glNode:getGLProgramState()
|
|
||||||
glProgramState:setVertexAttribPointer("a_position", 2, gl.FLOAT, false, 0, vertices, #vertices)
|
|
||||||
glProgramState:apply(transform)
|
|
||||||
gl.drawArrays(gl.TRIANGLES, 0, 6)
|
|
||||||
end
|
|
||||||
|
|
||||||
heartLayer:scheduleUpdateWithPriorityLua(updateHeart,0)
|
|
||||||
glNode:registerScriptDrawHandler(heartDraw)
|
|
||||||
time = 0
|
|
||||||
heartLayer:addChild(glNode,-10)
|
|
||||||
glNode:setPosition( size.width/2, size.height/2)
|
|
||||||
local center = cc.p( size.width / 2 * scaleFactor, size.height / 2 * scaleFactor)
|
|
||||||
glNode:getGLProgramState():setUniformVec2("center", center)
|
|
||||||
return heartLayer
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function createShaderPlasmaTest()
|
local function createShaderPlasmaTest()
|
||||||
|
local vSource = vertDefaultSource
|
||||||
local plasmaLayer = cc.Layer:create()
|
local fSource = cc.FileUtils:getInstance():getStringFromFile("Shaders/example_Plasma.fsh")
|
||||||
|
return createShaderNodeLayer(vSource, fSource)
|
||||||
InitTitle(plasmaLayer)
|
|
||||||
|
|
||||||
local fileUtiles = cc.FileUtils:getInstance()
|
|
||||||
local vertSource = vertDefaultSource
|
|
||||||
local fragSource = fileUtiles:getStringFromFile("Shaders/example_Plasma.fsh")
|
|
||||||
local glProgam = cc.GLProgram:createWithByteArrays(vertSource, fragSource)
|
|
||||||
local glprogramstate = cc.GLProgramState:getOrCreateWithGLProgram(glProgam)
|
|
||||||
local resolution = cc.p(256, 256)
|
|
||||||
|
|
||||||
local glNode = gl.glNodeCreate()
|
|
||||||
glNode:setContentSize(cc.size(256, 256))
|
|
||||||
glNode:setAnchorPoint(cc.p(0.5, 0.5))
|
|
||||||
glNode:setGLProgramState(glprogramstate)
|
|
||||||
glNode:getGLProgramState():setUniformVec2("resolution", resolution)
|
|
||||||
|
|
||||||
|
|
||||||
local function updatePlasma(fTime)
|
|
||||||
time = time + fTime
|
|
||||||
end
|
|
||||||
|
|
||||||
local function plasmaDraw(transform, transformUpdated)
|
|
||||||
local w = 256
|
|
||||||
local h = 256
|
|
||||||
|
|
||||||
local vertices ={ 0,0, w,0, w,h, 0,0, 0,h, w,h }
|
|
||||||
local glProgramState = glNode:getGLProgramState()
|
|
||||||
glProgramState:setVertexAttribPointer("a_position", 2, gl.FLOAT, false, 0, vertices, #vertices)
|
|
||||||
glProgramState:apply(transform)
|
|
||||||
gl.drawArrays(gl.TRIANGLES, 0, 6)
|
|
||||||
end
|
|
||||||
|
|
||||||
plasmaLayer:scheduleUpdateWithPriorityLua(updatePlasma,0)
|
|
||||||
glNode:registerScriptDrawHandler(plasmaDraw)
|
|
||||||
time = 0
|
|
||||||
plasmaLayer:addChild(glNode,-10)
|
|
||||||
glNode:setPosition( size.width/2, size.height/2)
|
|
||||||
local center = cc.p( size.width / 2 * scaleFactor, size.height / 2 * scaleFactor)
|
|
||||||
glNode:getGLProgramState():setUniformVec2("center", center)
|
|
||||||
return plasmaLayer
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function createShaderFlowerTest()
|
local function createShaderFlowerTest()
|
||||||
|
local vSource = vertDefaultSource
|
||||||
local flowerLayer = cc.Layer:create()
|
local fSource = cc.FileUtils:getInstance():getStringFromFile("Shaders/example_Flower.fsh")
|
||||||
|
return createShaderNodeLayer(vSource, fSource)
|
||||||
InitTitle(flowerLayer)
|
|
||||||
|
|
||||||
local fileUtiles = cc.FileUtils:getInstance()
|
|
||||||
local vertSource = vertDefaultSource
|
|
||||||
local fragSource = fileUtiles:getStringFromFile("Shaders/example_Flower.fsh")
|
|
||||||
local glProgam = cc.GLProgram:createWithByteArrays(vertSource, fragSource)
|
|
||||||
local glprogramstate = cc.GLProgramState:getOrCreateWithGLProgram(glProgam)
|
|
||||||
local resolution = cc.p(256, 256)
|
|
||||||
|
|
||||||
local glNode = gl.glNodeCreate()
|
|
||||||
glNode:setContentSize(cc.size(256, 256))
|
|
||||||
glNode:setAnchorPoint(cc.p(0.5, 0.5))
|
|
||||||
glNode:setGLProgramState(glprogramstate)
|
|
||||||
glNode:getGLProgramState():setUniformVec2("resolution", resolution)
|
|
||||||
|
|
||||||
local function updateFlower(fTime)
|
|
||||||
time = time + fTime
|
|
||||||
end
|
|
||||||
|
|
||||||
local function flowerDraw(transform, transformUpdated)
|
|
||||||
local w = 256
|
|
||||||
local h = 256
|
|
||||||
|
|
||||||
local vertices ={ 0,0, w,0, w,h, 0,0, 0,h, w,h }
|
|
||||||
local glProgramState = glNode:getGLProgramState()
|
|
||||||
glProgramState:setVertexAttribPointer("a_position", 2, gl.FLOAT, false, 0, vertices, #vertices)
|
|
||||||
glProgramState:apply(transform)
|
|
||||||
gl.drawArrays(gl.TRIANGLES, 0, 6)
|
|
||||||
end
|
|
||||||
|
|
||||||
flowerLayer:scheduleUpdateWithPriorityLua(updateFlower,0)
|
|
||||||
glNode:registerScriptDrawHandler(flowerDraw)
|
|
||||||
time = 0
|
|
||||||
flowerLayer:addChild(glNode,-10)
|
|
||||||
glNode:setPosition( size.width/2, size.height/2)
|
|
||||||
local center = cc.p( size.width / 2 * scaleFactor, size.height / 2 * scaleFactor)
|
|
||||||
glNode:getGLProgramState():setUniformVec2("center", center)
|
|
||||||
return flowerLayer
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function createShaderJuliaTest()
|
local function createShaderJuliaTest()
|
||||||
|
local vSource = vertDefaultSource
|
||||||
local juliaLayer = cc.Layer:create()
|
local fSource = cc.FileUtils:getInstance():getStringFromFile("Shaders/example_Julia.fsh")
|
||||||
|
return createShaderNodeLayer(vSource, fSource)
|
||||||
InitTitle(juliaLayer)
|
|
||||||
|
|
||||||
local fileUtiles = cc.FileUtils:getInstance()
|
|
||||||
local vertSource = vertDefaultSource
|
|
||||||
local fragSource = fileUtiles:getStringFromFile("Shaders/example_Julia.fsh")
|
|
||||||
local glProgam = cc.GLProgram:createWithByteArrays(vertSource, fragSource)
|
|
||||||
local glprogramstate = cc.GLProgramState:getOrCreateWithGLProgram(glProgam)
|
|
||||||
local resolution = cc.p(256, 256)
|
|
||||||
|
|
||||||
local glNode = gl.glNodeCreate()
|
|
||||||
glNode:setContentSize(cc.size(256, 256))
|
|
||||||
glNode:setAnchorPoint(cc.p(0.5, 0.5))
|
|
||||||
glNode:setGLProgramState(glprogramstate)
|
|
||||||
glNode:getGLProgramState():setUniformVec2("resolution", resolution)
|
|
||||||
|
|
||||||
local function updateJulia(fTime)
|
|
||||||
time = time + fTime
|
|
||||||
end
|
|
||||||
|
|
||||||
local function juliaDraw(transform, transformUpdated)
|
|
||||||
local w = 256
|
|
||||||
local h = 256
|
|
||||||
|
|
||||||
local vertices ={ 0,0, w,0, w,h, 0,0, 0,h, w,h }
|
|
||||||
local glProgramState = glNode:getGLProgramState()
|
|
||||||
glProgramState:setVertexAttribPointer("a_position", 2, gl.FLOAT, false, 0, vertices, #vertices)
|
|
||||||
glProgramState:apply(transform)
|
|
||||||
gl.drawArrays(gl.TRIANGLES, 0, 6)
|
|
||||||
end
|
|
||||||
|
|
||||||
juliaLayer:scheduleUpdateWithPriorityLua(updateJulia,0)
|
|
||||||
glNode:registerScriptDrawHandler(juliaDraw)
|
|
||||||
time = 0
|
|
||||||
juliaLayer:addChild(glNode,-10)
|
|
||||||
glNode:setPosition( size.width/2, size.height/2)
|
|
||||||
local center = cc.p( size.width / 2 * scaleFactor, size.height / 2 * scaleFactor)
|
|
||||||
glNode:getGLProgramState():setUniformVec2("center", center)
|
|
||||||
return juliaLayer
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function createGLGetActiveTest()
|
local function createGLGetActiveTest()
|
||||||
|
@ -466,9 +309,9 @@ local function OpenGLTestMainLayer()
|
||||||
|
|
||||||
local function getCurrentResult()
|
local function getCurrentResult()
|
||||||
local var = {}
|
local var = {}
|
||||||
local glProgam = sprite:getGLProgram()
|
local glProgram = sprite:getGLProgram()
|
||||||
if nil ~= glProgam then
|
if nil ~= glProgram then
|
||||||
local p = glProgam:getProgram()
|
local p = glProgram:getProgram()
|
||||||
local aaSize,aaType,aaName = gl.getActiveAttrib(p,0)
|
local aaSize,aaType,aaName = gl.getActiveAttrib(p,0)
|
||||||
local strFmt = "size:"..aaSize.." type:"..aaType.." name:"..aaName
|
local strFmt = "size:"..aaSize.." type:"..aaType.." name:"..aaName
|
||||||
print(strFmt)
|
print(strFmt)
|
||||||
|
|
Loading…
Reference in New Issue