Table of Contents

Introduction GUI Methods GUI Components Sample GUI 1 Notes Sample GUI 2 Conclusion

Notes - GUI126

This chapter mentions some more details of the BYW method


GLFW

GLFW is tied to GL from opengl. This are two libraries: one for windows and the other for drawing.

GL can be used for both 2d and 3d graphics which makes it more complicated. We had to use it to to draw our frame to the GLFW Window Instance.


Frames

While drawing store the current frame so as to draw on it without having to redraw everything again.


Centering a Widget in a Window

The formula to get the coordinates of a centered widget is described thus:
(windowWidth - widgetWidth)/2.0


The width and Height of a button with text

First measure the text and add the margins to the width. Your 2d library should provide this.


Fixed dimension windows are Good

This reduces your tasks. That is you don't need to redraw your frame for a larger or smaller screen.

Though GLFW supports both.


Try to Use the least screen space as possible

Screens are expensive: this is noticed when buying a very large screen.

Another reason is that you would end up enabling multitasking.

< Previous Next >