Is FLTK based on vector graphics?

44 views
Skip to first unread message

SSteven

unread,
Jan 6, 2018, 11:01:54 AM1/6/18
to fltk.general
Hello

I'm new to FLTK.

I have a little experience with wxwidgets. I understand wxwidgets isn't based on vector graphics.

My understanding is that FLTK is built on top of OpenGL, which is a vector graphics library.

Therefore, I'd like to ask:

1) Does this mean that FLTK widgets use vector graphics?

2) Since vector graphics automatically resize, do FLTK widgets automatically resize when windows are resized?

Thanks.

SSteven

Albrecht Schlosser

unread,
Jan 6, 2018, 11:17:48 AM1/6/18
to fltkg...@googlegroups.com
On 06.01.2018 16:44 SSteven wrote:

> I'm new to FLTK.

Welcome to the FLTK community!

> I have a little experience with wxwidgets. I understand wxwidgets isn't
> based on vector graphics.
>
> My understanding is that FLTK is built on top of OpenGL, which is a
> vector graphics library.

No, FLTK is not built on OpenGL, but FLTK can handle OpenGL windows
(class Fl_Gl_Window) that can be embedded in other FLTK windows so you
can use OpenGL in FLTK seamlessly.

FLTK uses the native graphics devices of its supported platforms, i.e.
basically Unix/Linux (X11), Windows, and macOS, but since FLTK 1.4.0
this is based on FLTK's new (extended) "driver" layer with virtual
driver classes per platform, so this is pretty much extensible. There
are proof-of-concepts for SDL, Android, and maybe more.

> Therefore, I'd like to ask:
>
> 1) Does this mean that FLTK widgets use vector graphics?

No, generally not, the graphics are more or less pixel-based, but the
graphics primitives used internally are similar to PostScript functions
and can scale well.

> 2) Since vector graphics automatically resize, do FLTK widgets
> automatically resize when windows are resized?

FLTK widgets can be designed to resize automatically (see the
resizable() method of Fl_Group). This means that your internal draw()
methods can scale the widgets when the main window is resized. This
works sufficiently for widget scaling, but lets the text sizes untouched.

Since FLTK 1.4.0 (current development branch) we have automatic
application scaling with CTRL/+/-/0, as you can see in current browsers
and similar applications. This scales the entire window including text
sizes etc. so the user can use the same application on "normal" and
high-DPI (high resolution) screens.

HTH, Albrecht
Reply all
Reply to author
Forward
0 new messages