[Bf-committers] SDL2-based GUI toolkit for Blender (hewi)

Felipe Ferreira da Silva felipefsdev at gmail.com
Sun Dec 15 21:39:42 CET 2013


@Everybody,

I just made the gitub repository, I'm calling it TableGUI. I only tested it
on Linux, but I think there will be no problem on MacOS or Windows (making
changes on the makefile, or course).
Well, I solved the framebuffer blitting problem, so each widget is being
rendered correctly.

GitHub for TableGUI:
https://github.com/FelipeFS/TableGUI

You will require my library BasicUtils (contains some useful stuff like
double-linked list):
https://github.com/FelipeFS/BasicUtils

Next steps:
* Translate the SDL event loop (still there, but commented) to a GLFW event
loop (easy task).
* Find a good way to draw texts.
* Translate the SDL drawing functions to OpenGL functions (all SDL stuff is
still there, but commented).
* Refactor all OpenGL parts, leaving only what is really necessary
(K.I.S.S. principle).

Considerations for the future:
* Could css theming be a good choice? It would need a reader to call OpenGL
functions according to the css instructions.
* A XML theming system could be a choice, too.
* No theming engine.
* Looking some concepts of mobile applications at Dribbble.com for
inspiration.

Btw, SDL2 is not a considerable to be in the title of this thread.

@Arnaud,

My mistake, I always thought that QT couldn't be used for commercial
purposes without a paid license.

The loop is not fancy, there is no FPS counter system. I will not put that,
because, for example, if somebody wants to create a embbed game engine
(what cosnincidence, like Blender does! and my own project needs it too,
since it is a game engine/editor), the developer will have the autonomy to
set its own FPS counter system. So the program runs at full speed.

Something I was think about is the fact that my loop runs the TWindow (my
window struct), not an TApplication (struct that I didn't create yet). So,
the library can work with only one top-window, for now. To run multiple
top-windows, I will have to create the TApplication struct (that will have
a list with all top-windows), and make the loop run using the TApplication
has parameter, looping over all top-windows. But, I will work on this later.

Regards,
Felipe Ferreira


2013/12/15 Arnaud Loonstra <arnaud at sphaero.org>

> On 12/13/2013 09:26 PM, Felipe Ferreira da Silva wrote:
> > @Hewi,
> > I have already switched to GLFW, and I liked it, but the only issue that
> > keeps me from make a github sooner is my lack of experience with OpenGL.
> > I'm having some troubles to blit from framebuffers to framebuffers. After
> > solving this, I will rewrite the drawing functions of each widget I made
> > using OpenGL primitives (from that point, I will make the github). Later,
> > find a good library for text rendering. If I get too desperate, I will
> use
> > Cairo (http://cairographics.org/) for post text rendering (get the FBO's
> > pixel data and render the text on it using Cairo).
> > I hope to finish this before the end of the year.
>
> Well, if you would do it out in the open you might receive some help? It
> doesn't need to be perfect before putting it on github ;).
>
> I'm also curious what kind of application loop you're thinking of.
>
> >
> > @Arnaud,
> > About Gtk... well, I am using it, for now. But, in cases like Blender,
> the
> > user (developer), need to know all the functions callbacks of Gtk if
> he/she
> > wants to create a plug-in/extension. Gtk has a bad design for
> extensibility
> > with script languages. I solved it. Add/Get/Set properties to/from
> widgets
> > requires a small bunch of functions:
> >
> > Widget_SetInt(Widget, PropertyName, Value);
> > Widget_GetInt(Widget, PropertyName);
> > Widget_AddInt(Widget, PropertyName, Value);
> >
> > This is used for any integer property that belongs to the widget. Easy to
> > make a callback for any script language.
> > And Qt... never go that way. Free, but only for free purposes. In my
> > opinion, I don't think Qt will survive having Gtk as competitor, only if
> it
> > were LGPL.
> >
> I have evaluated GTK as well but it's support for other platforms is
> really lacking. QT on the other hand I really liked. To me GTK doesn't
> even come close to be a competitor. My bet is that GTK will suffer
> before QT does. On the other hand QT is a complete framework beyond
> UI's. GTK is not.
>
> You're wrong about the licence issues as Jed pointed out:
>
> "On 14 January 2009, Qt version 4.5 added another option, the LGPL,[70]
> which should make Qt even more attractive for non-GPL open source
> projects and for closed applications."
> http://en.wikipedia.org/wiki/Qt_%28software%29#Licensing
>
> Also nice to know is that Maya amongst other are made with QT.
>
> Still I would like a seperate 'BUI' project as QT is huge.
>
> Rg,
>
> Arnaud
> --
> w: http://www.sphaero.org
> t: http://twitter.com/sphaero
> g: http://github.com/sphaero
> i: freenode: sphaero_z25
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
- Felipe Ferreira da Silva


More information about the Bf-committers mailing list