• Advertisement
Sign in to follow this  

Creating a library? SDL2 GUI system

This topic is 1273 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I'm building an SDL2 + Opengl 3.x GUI system that uses HTML. Something I'd like to do is create a library or a dll in order to make it easy for people to use my software without having to push all my .h and .cpp files into their code base. 




This is the code (there's lots of things I need to work on... memory management, using smart-pointers instead of the pointers I do use ect. )

I'm in the process of building out a subset of html elements and adding css for the box model and other styling considerations. 


I'm working in VS2012, can any one teach me how to create this into a library? Also any other advice would be nice... but it is currently a bit hard to understand in the code.



For those that want to know how it should work:

The user of this system will create a GUIFactory.

Use the factory to create a GUIManager by handing the factory an HTML/XML file

Then pass SDL2 events to the GUIManager and call the managers draw function.

To change properties of elements, I will be making an interface similar to the javascript DOM ... where you select an element or set of elements by id and then change or add properties to them. This will allow people to use the system for slightly dynamic user interfaces (such as updating points for a game). In order to render a different page, you will need to create another manager with the factory and call its draw and event functions instead (any suggestions for improving this would be appreciated).


Thanks a lot in advance.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement