Impossible call 'patch' inside onkeydown handler?
Status: Alpha
Brought to you by:
cwalther
From: Andrea V. <and...@gm...> - 2008-01-28 14:01:11
|
Hello! I got a strange behavior with build 179 and this simple code: -------------------------------------------------------------- cubic { "skyFront.jpg", --front "skyRight.jpg", --right "skyBack.jpg", --back "skyLeft.jpg", --left "skyTop.jpg", --top "skyBottom.jpg" --bottom } onkeydown ( function(key) p_ref=patch{nx=1,ny=1,nz=0,nw=1,nh=1,angley=90,image="left.png"} return false end ) -------------------------------------------------------------- When you press a key, you will get the message: Error running local keydown handler: 1/node.lua:13: attempt to call global 'patch' (a nil value) if I substitute patch with pipmak_internal.patch, it seems to work fine, for this simple example, but using a more complex code, Pipmak crash in that point... With the debug I have seen that the error occur in images.c ---------------------------------------------------------------------- void releaseImageFromGL(Image *img) { img->texrefcount--; /// <--error occur in this point if (img->texrefcount <= 0) { glDeleteTextures(1, &(img->textureID)); img->textureID = 0; } ---------------------------------------------------------------------- What do you thinking about? Is it a problem of my build, or really I cannot define a new patch inside a keydown handler? Bye. Andrea |