Wednesday, February 22, 2012

SFML 2 libRocket Renderer

I know libRocket is quite popular, and since I use it in my engine, along with SFML 2 most recent (or almost) graphics API, I decided to share a snippet that will be able to render your documents using sf::VertexArray.

The below snippet will do the job of rendering the textured geometry of the whole rocket document, assuming you already made a few things:
 - load textures as sf::Texture in the appropriate place
 - define target as a valid SFML sf::RenderTarget, before calling Render on the context
 - return NULL in the compile geometry attempt, so the "immediate" mode is used.

Don't worry as later I will give you a lot more, if you need it now or just need help with libRocket, feel free to contact me!

No comments:

Post a Comment