WindowHandle is an opaque pointer on Windows, that you just need to pass around. You're not supposed to "use" (dereference) it. Can you show your code?
Here it is, it's a complete WIP though
See commented lines at binding/lua_registration_SFML_window.cpp:123, 126 and 146. I'm not sure what happens behind this though, it's all deep magic for me. If it helps, compiler errors on that line:
template <class T>
class_id const registered_class<T>::id = allocate_class_id(typeid(T));
With T = HWND__ I think. It looks like luabind needs to know.
Why don't you use a wrapper library such as luabind, which allows you to declare the binding in a very simple way?
I'm actually using luabind!
luabind v0.9.1 (latest) doesn't allow default values for parameters (was apparently scheduled for v1, but the project is not really maintained anymore). I've Googled it and the only solution seems to be function overloading.
Forget what I said about public inheritance though, I realized that in this case (since I'm not accessing anything private) I can just make static functions for each overload that accept a pointer to that SFML class and then bind them as if they came from the class. It'll be cleaner and easier even if not ideal. Still need to implement all these overloads though ^^'
Other problems I encountered with luabind were:
- No support for class attributes, I will probably have to wrap them all in static member functions. Maybe I can inject them again in their classes as attributes once luabind has finished.
- No support for operator[], which is really annoying! I think I'll just bind it to the __call metamethod in Lua, which is the equivalent of operator(), for the moment. Perhaps I can find a workaround using the Lua C API or something on the Lua side, I don't know yet