I'm trying to get the Leadwerks Engine working inside a Qt application. Here, the OpenGL context setup is done by Qt. Leadwerks should render to a buffer as usual (setup with CreateBuffer) and then do the final render (RenderLights) to the custom buffer (CreateCustomBuffer) associated with the QGLWidget rendering context.
However, so far, I haven't been able to get anything but crashes inside the engine DLL. So far, it appears that the engine won't work without Graphics() being set up, i.e. without the engine creating its own window. Is this correct or am I missing something here?
Thanks for any help.
---
Some other gripes with the API:
- CreateCustomBuffer should take a void* user data pointer. Right now there is no way to associate custom buffers with their corresponding user-side contexts.
- All string arguments to the API functions should be const char*; the engine has no business altering strings outside its scope. If it wants to alter them, it should copy them to local storage.
- The 'inline' specifier in C++ is generally pointless without the compiler also seeing the function body, so for the calls to actually inline, all the function definitions inside the .cpp files that just stub DLL function pointers should be moved into the headers.
- It would be nice for all API symbols to have a consistent prefix to all names so it plays well when integrated into an application with other libraries. E.g. all names would start with "LE" (LECreateBuffer instead of just CreateBuffer) or something.