ejoy / ejoy2d Goto Github PK
View Code? Open in Web Editor NEWA 2D Graphics Engine for Mobile Game
License: MIT License
A 2D Graphics Engine for Mobile Game
License: MIT License
环境什么的都配置好了,出现下面错误呢
enjoy/lib/shader.c :60:undefined reference to '_imp____glewGenBuffer'
enjoy/lib/shader.c :61:undefined reference to '_imp____glewBindBuffer'
enjoy/lib/shader.c :76:undefined reference to '_imp____glewGenBuffer'
......
求助一下哈~
希望能够在shader中提供一些绘制点、线、多边形、圆形等接口,虽然这些功能对于游戏来说很少用到,不过既然是一套图形引擎,那提供这些方法应该也是合理的,另外这些接口对于应用开发来说很重要。
_gen_glyph 出错 w,h 为 NULL
UpdateWindow之后是不是应该用如下代码刷新:
MSG msg;
while (1)
{
if (! PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
ejoy2d_win_update();
InvalidateRect(wnd, NULL , FALSE);
if (WM_QUIT == msg.message)
{
break;
}
continue;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
在我的机器上(Win7, Intel i3)上动画不能正常播放。
群号119121319
环境:deepinlinux
编译报错:
gcc -g -Wall -Ilib -I/usr/include -I/usr/local/include -I/usr/include/freetype2 -o ej2d lib/shader.c lib/lshader.c lib/ejoy2dgame.c lib/fault.c lib/screen.c lib/texture.c lib/ppm.c lib/spritepack.c lib/sprite.c lib/lsprite.c lib/matrix.c lib/lmatrix.c lib/dfont.c lib/label.c lib/particle.c linux/window.c linux/winfw.c linux/winfont.c -lGLEW -lGL -lX11 -lfreetype -llua -lm -lrt
/usr/bin/ld: /usr/local/lib/liblua.a(loadlib.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/bin/ld: note: 'dlclose@@GLIBC_2.2.5' is defined in DSO /lib/x86_64-linux-gnu/libdl.so.2 so try adding it to the linker command line
/lib/x86_64-linux-gnu/libdl.so.2: could not read symbols: 无效的操作
collect2: 错误: ld 返回 1
make: *** [ej2d] 错误 1
然后从网上找到解决办法:添加-ldl.
gcc -g -Wall -Ilib -I/usr/include -I/usr/local/include -I/usr/include/freetype2 -o ej2d lib/shader.c lib/lshader.c lib/ejoy2dgame.c lib/fault.c lib/screen.c lib/texture.c lib/ppm.c lib/spritepack.c lib/sprite.c lib/lsprite.c lib/matrix.c lib/lmatrix.c lib/dfont.c lib/label.c lib/particle.c linux/window.c linux/winfw.c linux/winfont.c -lGLEW -lGL -lX11 -lfreetype -llua -lm -ldl
编译成功,但是运行黑色的。。。
ctrl+C关闭后,报错。
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
after 1109 requests (1109 known processed) with 0 events remaining.
MinGW下运行后闪退 (win7 x64)
$ ej2d.exe examples/ex01.lua
LUA_ERRERR : error in error handling
发现一个问题,链接时有几个函数找不到:
/tmp/ccGBYpaA.o:在函数‘os_tmpname’中:
/home/sxf/data/workspace/Game/ejoy2d/lua/loslib.c:140: 警告: the use of tmpnam' is dangerous, better use
mkstemp'
/tmp/ccfHosBu.o:在函数‘render_buffer_update’中:
/home/sxf/data/workspace/Game/ejoy2d/lib/render/render.c:175:对‘glBindVertexArrayOES’未定义的引用
/tmp/ccfHosBu.o:在函数‘render_shader_create’中:
/home/sxf/data/workspace/Game/ejoy2d/lib/render/render.c:329:对‘glGenVertexArraysOES’未定义的引用
/tmp/ccfHosBu.o:在函数‘close_shader’中:
/home/sxf/data/workspace/Game/ejoy2d/lib/render/render.c:346:对‘glDeleteVertexArraysOES’未定义的引用
/tmp/ccfHosBu.o:在函数‘apply_va’中:
/home/sxf/data/workspace/Game/ejoy2d/lib/render/render.c:549:对‘glBindVertexArrayOES’未定义的引用
好像跟OpenGL 1和2的不同实现有关, 我找到了许多类似错误的修正提示但依旧没有效果, 希望能获得帮助,谢谢!
系统环境: ubuntu13.10
在编译的时候,报错
/usr/bin/ld: /usr/local/lib/liblua.a(loadlib.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
然后,在makefile中加入了 -ldl 这句话,就好使了。
似乎只是一个未链接库的问题。
https://github.com/ejoy/ejoy2d/blob/master/lib/lsprite.c#L69-L73
label.space_w = (int)lua_tointeger(L, 5);
const char * align = lua_tostring(L,5);
先确认一点哈,假设有矩阵:
| a b c |
| d e f |
那么他们对应的数组下标是:
a: 0, d: 1, b: 2, e: 3, c: 4, f: 5
如果上面的假设是正确的,那么:
https://github.com/cloudwu/ejoy2d/blob/8667d3edb86e7787d159ee545441c82254694f9a/lib/matrix.h#L8
中矩阵的乘法计算的貌似是 mm2 * mm1,而不是 mm1 * mm2。
err(1): set your own vector font resource path, error occured in file posix/winfont.c, line 72
have a look at fterrdef.h
When I try to run ex01.lua,this error happens!!!I hope this problem can be solve soon!!
编译成功,已生成ej2d.exe,但是测试自带脚本时没有任何反应。。。原因不明。。能不能加个console,提示哪里出了问题。。 系统winxp~~mingw编译
mbp:ejoy2d jintiao$ make
gcc -g -Wall -Ilib -Ilib/render -Ilua -D EJOY2D_OS=MACOSX -I/usr/X11R6/include -I/usr/include -I/opt/X11/include/freetype2 -D MACOSX -o ej2d lib/shader.c lib/lshader.c lib/ejoy2dgame.c lib/fault.c lib/screen.c lib/texture.c lib/ppm.c lib/spritepack.c lib/sprite.c lib/lsprite.c lib/matrix.c lib/lmatrix.c lib/dfont.c lib/label.c lib/particle.c lib/lparticle.c lib/scissor.c lib/renderbuffer.c lib/lrenderbuffer.c lib/lgeometry.c lib/render/render.c lib/render/carray.c lib/render/log.c posix/window.c posix/winfw.c posix/winfont.c lua/lapi.c lua/lauxlib.c lua/lbaselib.c lua/lbitlib.c lua/lcode.c lua/lcorolib.c lua/lctype.c lua/ldblib.c lua/ldebug.c lua/ldo.c lua/ldump.c lua/lfunc.c lua/lgc.c lua/linit.c lua/liolib.c lua/llex.c lua/lmathlib.c lua/lmem.c lua/loadlib.c lua/lobject.c lua/lopcodes.c lua/loslib.c lua/lparser.c lua/lstate.c lua/lstring.c lua/lstrlib.c lua/ltable.c lua/ltablib.c lua/ltm.c lua/lundump.c lua/lutf8lib.c lua/lvm.c lua/lzio.c -L/usr/X11R6/lib -lGLEW -lGL -lX11 -lfreetype -lm -ldl
lib/lgeometry.c:55:6: warning: using integer absolute value function 'abs' when
argument is of floating point type [-Wabsolute-value]
if (abs(x1-x2) > abs(y1-y2)) {
^
lib/lgeometry.c:55:6: note: use function 'fabsf' instead
if (abs(x1-x2) > abs(y1-y2)) {
^~~
fabsf
lib/lgeometry.c:55:19: warning: using integer absolute value function 'abs' when
argument is of floating point type [-Wabsolute-value]
if (abs(x1-x2) > abs(y1-y2)) {
^
lib/lgeometry.c:55:19: note: use function 'fabsf' instead
if (abs(x1-x2) > abs(y1-y2)) {
^~~
fabsf
2 warnings generated.
lib/render/render.c:947:14: warning: comparison of constant 2 with expression of type
'enum DRAW_MODE' is always true [-Wtautological-constant-out-of-range-compare]
assert(mode < sizeof(draw_mode)/sizeof(int));
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func, FILE, LINE, #e...
^
1 warning generated.
mbp:ejoy2d jintiao$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.4.0
Thread model: posix
链接官方的glew32.dll报格式不匹配
链接自己用vs2012编译的glew32.dll报下面这个错误
F:\Download\ejoy2d-master>make mingw
process_begin: CreateProcess(NULL, uname, ...) failed.
process_begin: CreateProcess(NULL, uname, ...) failed.
process_begin: CreateProcess(NULL, uname, ...) failed.
gcc -g -Wall -Ilib -D EJOY2D_OS=WINDOWS -IF:/Download/glew-1.10.0/include -IF:/D
ownload/lua-5.2.3/src -o ej2d.exe lib/shader.c lib/lshader.c lib/ejoy2dgame.c li
b/fault.c lib/screen.c lib/texture.c lib/ppm.c lib/spritepack.c lib/sprite.c lib
/lsprite.c lib/matrix.c lib/lmatrix.c lib/dfont.c lib/label.c lib/particle.c lib
/lparticle.c lib/scissor.c mingw/window.c mingw/winfw.c mingw/winfont.c -L"C:/Pr
ogram Files (x86)/Windows Kits/8.0/Lib/win8/um/x86" -lgdi32 -LF:/Download/glew-1
.10.0/bin/Release/Win32 -lglew32 -L"C:/Program Files (x86)/Windows Kits/8.0/Lib/
win8/um/x86" -lopengl32 -LF:/Download/lua-5.2.3/src -llua52
C:\Users\ADMINI~1\AppData\Local\Temp\ccqFl6OH.o: In function init_window': F:\Download\ejoy2d-master/mingw/window.c:49: undefined reference to
_imp__glewI
nit@0'
collect2.exe: error: ld returned 1 exit status
Makefile:64: recipe for target 'ej2d' failed
make: *** [ej2d] Error 1
id 的管理工作交给使用者,如果使用 simplepackage 模块的话,它会简单的为所有加载的包分配贴图 id 。所以 不建议 联合使用 simplepackage 和 ppm.texture ,除非你知道如何确切的管理贴图 id 。
按我的理解,这里应该是 建议 ?
我希望显示字体的时候加上背景色,现有的代码似乎是不支持的,想到的办法,是创建一个空的sprite,把label作为子节点,能包含的应该只有ani类型,貌似不合适的,有什么办法吗,另外TYPE_PANNEL类型是怎么用的?
gcc -g -Wall -Ilib -D EJOY2D_OS=MACOSX -I/usr/X11R6/include -I/usr/include -I/usr/local/include -I/usr/local/Cellar/freetype/2.5.2/include/freetype2 -D __MACOSX -o ej2d lib/shader.c lib/lshader.c lib/ejoy2dgame.c lib/fault.c lib/screen.c lib/texture.c lib/ppm.c lib/spritepack.c lib/sprite.c lib/lsprite.c lib/matrix.c lib/lmatrix.c lib/dfont.c lib/label.c lib/particle.c lib/lparticle.c lib/scissor.c posix/window.c posix/winfw.c posix/winfont.c -L/usr/X11R6/lib -lGLEW -lGL -lX11 -lfreetype -llua -lm -Wl,-E -ldl
In file included from posix/winfont.c:7:
/usr/X11R6/include/ft2build.h:56:10: fatal error: 'freetype/config/ftheader.h' file not found
#include <freetype/config/ftheader.h>
^
1 error generated.
make: *** [ej2d] Error 1
需要添加一个软链接: ln -s /usr/local/include/freetype2 /usr/local/include/freetype
argv[0]不一定是完整路径,建议通过GetModuleFileName获取
正在搭环境...
对于我这种基本写什么项目都在windows上用c++ & vs的人来说...面对云老板的这种linux正统范儿的项目,搭环境是一件困难的事,不过还是要搭~毕竟是云老板的2d engine呀.
对于上层开发人员,lua真的能像c++那样得心应手吗?
since we embed the Lua lib, we should include the header files like this:
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
把examples\ex01.lua
的第22行改为
local screencoord = { x = 512, y = 384, scale = 1.2, rot = 450 }
错误信息如下:
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
after 6922 requests (6909 known processed) with 0 events remaining.
看上去不是一个很要紧的问题,我提问的目的是想确定是我的系统问题还是ej2d的问题。谢谢。
确定了glew1.9版本,也确定了lib的位置
make的时候还总报
好郁闷。
J:\Project\ejoy2d/lib/shader.c:58: undefined reference to __glewGenBuffers' J:\Project\ejoy2d/lib/shader.c:59: undefined reference to
__glewBindBuffer'
J:\Project\ejoy2d/lib/shader.c:72: undefined reference to __glewBufferData' J:\Project\ejoy2d/lib/shader.c:74: undefined reference to
__glewGenBuffers'
J:\Project\ejoy2d/lib/shader.c:75: undefined reference to __glewBindBuffer' c:\Users\xhacker\AppData\Local\Temp\ccabdE7p.o: In function
compile':
J:\Project\ejoy2d/lib/shader.c:86: undefined reference to __glewCreateShader' J:\Project\ejoy2d/lib/shader.c:87: undefined reference to
__glewShaderSource'
J:\Project\ejoy2d/lib/shader.c:88: undefined reference to __glewCompileShader' J:\Project\ejoy2d/lib/shader.c:90: undefined reference to
__glewGetShaderiv'
J:\Project\ejoy2d/lib/shader.c:95: undefined reference to __glewGetShaderInfoLog' J:\Project\ejoy2d/lib/shader.c:100: undefined reference to
__glewDeleteShader'
c:\Users\xhacker\AppData\Local\Temp\ccabdE7p.o: In function `link':
我是双显示器,在WIN7(64位) 执行实例1,例子一下占了2个屏,黑乎乎一片,刷新下桌面才恢复。
我用命令./ej2d examples/ex01.lua运行,会失败
失败时显示cannot find glyph 10
调试进去,ex01.lua有行脚本为
obj2.label.text = string.format("AABB\n%d x %d", x2-x1, y2-y1)
这行脚本需要绘画字符串,绘画时候会调用label.c文件的label_draw函数,最终会调用winfont.c文件下的font_size函数,当字符为\n,也就是unicode为10的时候,
FT_Get_Char_Index返回0,之后,就打印出错误信息然后退出了。
类似Unity和cocos2dx中,对一个节点做变换,子节点也会跟着变,这样做UI和tween动画比较方便。
资源文件中animation是写死的,如果想在程序中动态生成应该怎么做呢,能否提供一些实现思路,谢谢。
第一个错误在simplepackage.lua:40
我想这里需要指定完整路径,或者统一修改下当前目录?
mac 能否布置环境 风云大哥
posix/winfw.c:78:10: warning: unused variable 'buf' [-Wunused-variable]
char buf[BUFSIZE];
^
1 warning generated.
ld: unknown option: -E
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [ej2d] Error 1
我的解决方法是,去掉macosx下的链接选项,-E, 也去掉了选项-Wl,
-Wl 选项保留的话,会有警告。
warning: unknown warning option '-Wl' [-Wunknown-warning-option]
也就是将,macosx: LDFLAGS修改成
macosx : LDFLAGS += -L/usr/X11R6/lib -lGLEW -lGL -lX11 -lfreetype -llua -lm -ldl
ios未设置系统默认字体
换了系统,以前的12.04能编过了,但是系统坏了,又开始配置,但是glu.h 找不到,下了一个放在 include 了
/usr/include/GL/glu.h:263:87: error: expected ‘)’ before ‘’ token
/usr/include/GL/glu.h:274:91: error: expected ‘)’ before ‘’ token
/usr/include/GL/glu.h:283:91: error: expected ‘)’ before ‘*’ token
就是几个函数申明:
263:extern void APIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, GLvoid (CALLBACK CallBackFunc)());
274:extern void APIENTRY gluQuadricCallback (GLUquadric quad, GLenum which, GLvoid (CALLBACK CallBackFunc)());
283:extern void APIENTRY gluTessCallback (GLUtesselator tess, GLenum which, GLvoid (CALLBACK *CallBackFunc)());
有碰见过的吗?我不是太看的出来问题在哪里。。
步骤:
posix/winfw.c:78:10: warning: unused variable 'buf' [-Wunused-variable]
char buf[BUFSIZE];
^
1 warning generated.
In file included from posix/winfont.c:7:
/usr/X11R6/include/ft2build.h:56:10: fatal error: 'freetype/config/ftheader.h' file not foundinclude <freetype/config/ftheader.h>
1 error generated.
Is there any plan to support Android?
gcc -g -Wall -Ilib -D EJOY2D_OS=LINUX -I/usr/include -I/usr/local/include -I/usr/include/freetype2 -o ej2d lib/shader.c lib/lshader.c lib/ejoy2dgame.c lib/fault.c lib/screen.c lib/texture.c lib/ppm.c lib/spritepack.c lib/sprite.c lib/lsprite.c lib/matrix.c lib/lmatrix.c lib/dfont.c lib/label.c lib/particle.c lib/lparticle.c lib/scissor.c posix/window.c posix/winfw.c posix/winfont.c -lGLEW -lGL -lX11 -lfreetype -llua -lm -Wl,-E
/tmp/ccTymNxz.o: In function ldraw': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lshader.c:41: undefined reference to
lua_tounsignedx'
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lshader.c:43: undefined reference to luaL_optunsigned' /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lshader.c:46: undefined reference to
lua_rawlen'
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lshader.c:58: undefined reference to lua_tonumberx' /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lshader.c:59: undefined reference to
lua_tonumberx'
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lshader.c:60: undefined reference to lua_tonumberx' /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lshader.c:61: undefined reference to
lua_tonumberx'
/tmp/ccTymNxz.o: In function ejoy2d_shader': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lshader.c:106: undefined reference to
luaL_setfuncs'
/tmp/cc7FJCRH.o: In function ejoy2d_framework': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/ejoy2dgame.c:72: undefined reference to
luaL_setfuncs'
/tmp/cc7FJCRH.o: In function checkluaversion': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/ejoy2dgame.c:78: undefined reference to
lua_version'
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/ejoy2dgame.c:79: undefined reference to lua_version' /tmp/cc7FJCRH.o: In function
ejoy2d_game':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/ejoy2dgame.c:97: undefined reference to lua_setglobal' /home/aispeech/test/c_lua/ejoy2d/trunk/lib/ejoy2dgame.c:104: undefined reference to
luaL_requiref'
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/ejoy2dgame.c:105: undefined reference to luaL_requiref' /home/aispeech/test/c_lua/ejoy2d/trunk/lib/ejoy2dgame.c:106: undefined reference to
luaL_requiref'
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/ejoy2dgame.c:107: undefined reference to luaL_requiref' /home/aispeech/test/c_lua/ejoy2d/trunk/lib/ejoy2dgame.c:108: undefined reference to
luaL_requiref'
/tmp/cc7FJCRH.o:/home/aispeech/test/c_lua/ejoy2d/trunk/lib/ejoy2dgame.c:109: more undefined references to luaL_requiref' follow /tmp/cc7FJCRH.o: In function
traceback':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/ejoy2dgame.c:138: undefined reference to luaL_traceback' /tmp/cc7FJCRH.o: In function
ejoy2d_game_start':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/ejoy2dgame.c:150: undefined reference to lua_callk' /tmp/cc7FJCRH.o: In function
call':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/ejoy2dgame.c:159: undefined reference to lua_pcallk' /tmp/ccgVdHtg.o: In function
save_rgb':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/ppm.c:372: undefined reference to lua_tointegerx' /home/aispeech/test/c_lua/ejoy2d/trunk/lib/ppm.c:373: undefined reference to
lua_tointegerx'
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/ppm.c:390: undefined reference to lua_tointegerx' /home/aispeech/test/c_lua/ejoy2d/trunk/lib/ppm.c:391: undefined reference to
lua_tointegerx'
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/ppm.c:392: undefined reference to lua_tointegerx' /tmp/ccgVdHtg.o:/home/aispeech/test/c_lua/ejoy2d/trunk/lib/ppm.c:408: more undefined references to
lua_tointegerx' follow
/tmp/ccgVdHtg.o: In function saveppm': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/ppm.c:443: undefined reference to
lua_rawlen'
/tmp/ccgVdHtg.o: In function ejoy2d_ppm': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/ppm.c:470: undefined reference to
luaL_setfuncs'
/tmp/cczIpTHp.o: In function limport': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/spritepack.c:311: undefined reference to
lua_rawlen'
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/spritepack.c:335: undefined reference to lua_tointegerx' /tmp/cczIpTHp.o: In function
lpackcolor':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/spritepack.c:392: undefined reference to luaL_checkunsigned' /tmp/cczIpTHp.o: In function
ejoy2d_spritepack':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/spritepack.c:598: undefined reference to luaL_setfuncs' /tmp/cczxPY6I.o: In function
lnewlabel':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:56: undefined reference to luaL_optunsigned' /tmp/cczxPY6I.o: In function
newsprite':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:125: undefined reference to lua_setuservalue' /tmp/cczxPY6I.o: In function
lsettext':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:304: undefined reference to lua_setuservalue' /tmp/cczxPY6I.o: In function
lgettext':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:315: undefined reference to lua_getuservalue' /tmp/cczxPY6I.o: In function
lgetcolor':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:322: undefined reference to lua_pushunsigned' /tmp/cczxPY6I.o: In function
lsetcolor':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:329: undefined reference to luaL_checkunsigned' /tmp/cczxPY6I.o: In function
lgetadditive':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:337: undefined reference to lua_pushunsigned' /tmp/cczxPY6I.o: In function
lsetadditive':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:344: undefined reference to luaL_checkunsigned' /tmp/cczxPY6I.o: In function
lgetter':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:363: undefined reference to luaL_setfuncs' /tmp/cczxPY6I.o: In function
lsetter':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:381: undefined reference to luaL_setfuncs' /tmp/cczxPY6I.o: In function
lfetch':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:391: undefined reference to lua_getuservalue' /tmp/cczxPY6I.o: In function
lmount':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:405: undefined reference to lua_getuservalue' /tmp/cczxPY6I.o: In function
lmulti_draw':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:474: undefined reference to lua_rawlen' /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:487: undefined reference to
lua_tounsignedx'
/tmp/cczxPY6I.o: In function lookup': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:502: undefined reference to
lua_getuservalue'
/tmp/cczxPY6I.o: In function lmethod': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:649: undefined reference to
luaL_setfuncs'
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:664: undefined reference to luaL_setfuncs' /tmp/cczxPY6I.o: In function
ejoy2d_sprite':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lsprite.c:674: undefined reference to luaL_setfuncs' /tmp/cc7Bib02.o: In function
lnew':
/home/aispeech/test/c_lua/ejoy2d/trunk/lib/lmatrix.c:12: undefined reference to lua_rawlen' /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lmatrix.c:16: undefined reference to
lua_tointegerx'
/tmp/cc7Bib02.o: In function ejoy2d_matrix': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lmatrix.c:145: undefined reference to
luaL_setfuncs'
/tmp/ccZgeI3I.o: In function dict_float': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lparticle.c:12: undefined reference to
lua_tonumberx'
/tmp/ccZgeI3I.o: In function dict_int': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lparticle.c:20: undefined reference to
lua_tointegerx'
/tmp/ccZgeI3I.o: In function ldata': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lparticle.c:179: undefined reference to
lua_pushunsigned'
/tmp/ccZgeI3I.o: In function ejoy2d_particle': /home/aispeech/test/c_lua/ejoy2d/trunk/lib/lparticle.c:197: undefined reference to
luaL_setfuncs'
/tmp/cc8IUseh.o: In function traceback': /home/aispeech/test/c_lua/ejoy2d/trunk/posix/winfw.c:43: undefined reference to
luaL_traceback'
/tmp/cc8IUseh.o: In function ejoy2d_win_init': /home/aispeech/test/c_lua/ejoy2d/trunk/posix/winfw.c:95: undefined reference to
lua_pcallk'
collect2: ld returned 1 exit status
make: *** [ej2d] Error 1
lua安装的是5.2.3版本,其他依赖组建也已安装。
不知道有没有人像我这样平时工作用vs,但不怎么用mingw,下面是在vs下编译ejoy2d的方法,有需要的可以看看:
前面的步骤就不说了,建工程(console程序),导入代码,下载必要的库文件,设置include路径之类的。下面的部分是解决编译连接的一些问题。
};
PS:ejoy2d.exe执行要在代码根目录,因为运行需要加载ejoy2d目录下的脚本
lib/shader.c: In function ‘shader_init’:
lib/shader.c:23:27: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
^
lib/shader.c:102:38: note: in expansion of macro ‘BUFFER_OFFSET’
{ "position", 0, 2, sizeof(float), BUFFER_OFFSET(vp.vx) },
My gcc verion is gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
最近加入的geometry能否绘制的时候加入srt参数,因为我用在绘制战棋的地表阴影,需要有和sprite一样的变换
C:\ejoy2d>ej2d.exe examples/ex01.lua
[string "local path, script = ......"]:4: attempt to concatenate local 'path' (
nil value)
stack traceback:
[string "local path, script = ......"]:4: in main chunk
window 7 64
thanks
提示如下
...WE Workspaes\Github\ejoy2d\msvc..\ejoy2d\spritepack.lua:291: Invalid stream(19): frame part need an id
stack traceback:
[C]: in function 'import'
...WE Workspaes\Github\ejoy2d\msvc..\ejoy2d\spritepack.lua:291: in function 'init'
...Workspaes\Github\ejoy2d\msvc..\ejoy2d\simplepackage.lua:46: in function 'preload'
...Workspaes\Github\ejoy2d\msvc..\ejoy2d\simplepackage.lua:81: in function 'load'
examples/ex01.lua:5: in function 'f'
[string "local path, script = ......"]:7: in main chunk
如果去掉 4861aaf,就正常了
控制台输出如下:
compile failed:0:1(1): error: syntax error, unexpected NEW_IDENTIFIER
source:
precision lowp float;
varying vec2 v_texcoord;
varying vec4 v_color;
uniform sampler2D texture0;
uniform vec3 additive;
void main() {
vec4 tmp = texture2D(texture0, v_texcoord);
gl_FragColor.xyz = tmp.xyz * v_color.xyz;
gl_FragColor.w = tmp.w;
gl_FragColor *= v_color.w;
gl_FragColor.xyz += additive.xyz * tmp.w;
}
求助.谢谢.
在考虑2.5d情况下,场景中多个层级(地下,地面,空中)间的的单位以及同层级间的单位遮挡问题,如果引入layer概念感觉有些麻烦,只用sprite的y坐标做比较貌似不能解决多层级概念,这里是否有必要为sprite加入z_position呢?或者有其他的什么办法。
本人新手,问题比较小白一点,还望见谅
Would you like to replace more defines for constant values by enumerations to stress their relationships?
主要需要进行两点修改
1.不使用void_的隐式转换
例如char_ p = malloc(xxx);改为char* p = (char*)malloc(xxx);
2.不使用new作为标识符(因为它是c++的关键字)
windows下通过WM_TIMER和WM_PAINT控制帧率很貌似很不精确,update按道理是30fps,实际测试只有20左右。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.