Linux
µGFX runs natively on any Linux system that runs the X server. Running µGFX on your computer can be used to simplify the process of developing your embedded GUI because you don't have to flash the firmware every time to try it. Also, this way µGFX can be used as the native GUI system on low power Linux devices such as the Raspberry-Pi and other single board computers.
Note: The performance of the resulting program is very bad. This is because the X driver just uses setPixel() and doesn't take any advantage of area blitting or double buffering. The application will run A LOT faster on the actual microcontroller.
Framebuffer
The Linux driver does not only come with an X driver, but also with a framebuffer driver. To use the framebuffer driver, include the following line in your Makefile:
include $(GFXLIB)/boards/base/Linux-Framebuffer/board.mk
Makefile
The following Makefile can be used to compile an µGFX application on a Linux system. Modify the highlighted line(s).
# The name of the project / binaryPROJECT = ugfx# List C source files hereSRC = $(GFXSRC) \
main.c# List all user directories hereUINCDIR = $(GFXINC) \
# List all librariesLIBS = -lX11 -pthread
# Include uGFXGFXLIB = /home/tectu/projects/resources/ugfx
include $(GFXLIB)/gfx.mk
include $(GFXLIB)/boards/base/Linux/board.mk # The X driver
#include $(GFXLIB)/boards/base/Linux-Framebuffer/board.mk # The framebuffer driver################################################################################ Do not change anything below this line unless you know what you're doing ################################################################################# Your toolchainCC = gccINCDIR = $(patsubst %,-I%,$(DINCDIR) $(UINCDIR))
LIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
OBJS = $(SRC:.c=.o)
CCFLAGS = -O2 -Wall -DGFX_USE_OS_LINUX=TRUE
LDFLAGS =################################################################################ Actual Makefile rules ################################################################################all: $(OBJS) $(PROJECT)
%.o : %.c
$(CC) -c $(CCFLAGS) -I . $(INCDIR) $< -o $@
$(PROJECT): $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
clean:-rm -f $(OBJS)
-rm -f $(PROJECT)