[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: OpenGL and GLUT bindings
- From: Anders F Björklund <afb@...>
- Date: Thu, 7 Jul 2005 20:19:47 +0200
varol kaptan wrote:
Thanks a lot fot the patches - they have been incorporated. I also
fixed the support for windows and added an example showing how to do
raw memory access (loading textures, etc).
Download from
http://lua-users.org/files/wiki_insecure/users/VarolKaptan/
And here comes another patch, for your updated version... :-)
http://www.algonet.se/~afb/lua/luaglut-0.2-macosx.patch
Two main issues:
1) I used "dylib", which is the Mac OS X term for shared library.
However, it turned out that I *should* have used "bundle" instead,
which is Mac OS X speak for loadable/unloadable library - same as
Perl and Python uses for their native modules, for instance... ?
No big deal, just flip ".dylib" for ".bundle" and the GCC flag
-dynamiclib for -bundle instead (it's all been done in the patch)
I also added a note that you need to compile your Lua with support
for "dlopen", possibly by using the "dlcompat" library on Mac OS X.
2) For some bogus reason like: "it's easier with Mac .app bundles",
or something, glutInit on Mac OS X *changes the working directory* !
This makes the texture demo fail to find the PPM file next to it...
(sometimes I think they make it different on purpose, to tease us ?)
As a workaround, I moved the texture loading above the glutInit call.
I also set texture enabled by default, to show the lovely texture,
and added an "assert" around the io.open (I used that to "debug" it)
Now works fine on Mac OS X 10.3 with Lua 5.0.2, compiled with DLOPEN.
--anders
PS. I should add the Lua package to my homepage, now that you linked it
(as currently I only have the old Mac OS 9-based binary up there...)