I guess you have to make some changes in libRocket code to make it pass Window creation. I'm not sure if there is another way but I'm sure this piece of code will work! and I assume you are developing for a windows system, if you are targeting another platform there is a similar steps but with different variables and function changes!
first of all you need to get a handler to the window SDL creates. this piece of code extracts required HWND value (according to here:
#include <SDL_syswm.h>
struct SDL_SysWMinfo wmInfo;
SDL_VERSION(&wmInfo.version);
if(-1 == SDL_GetWMInfo(&wmInfo))
throw AVException(SDL_GetError());
HWND hwndSDL = wmInfo.window;
now we need to make sure libRocket uses same window for it's rendering, after a little search in it's files I've found a file hg/shell/src/win32/ShellWin32.cpp
(address is based on googlecode) which contains window creation functions. there you'll see a function named bool Shell::OpenWindow(const char* name, bool attach_opengl)
. that is the main function responsible for creating a window. to make libRocket reuse our hwndSDL
variable you have to remove/comment all the lines in that function except these :
if (attach_opengl)
{
opengl_attached = AttachOpenGL();
if (!opengl_attached)
return false;
}
and just before these lines add this piece of code:
window_handle = hwndSDL;
I know it's probably not the best way to do job but I'm sure it'll work. and if you are targeting anything other than windows you just have to find equivalents for HWND value and createwindow function. they sure are somewhere in codes since almost all window systems either windows or non-windows share same logic.