DEPUI, DEGFX and DETK
Portable gui, graphics and toolkit source code libraries under a GPL licence
Download DEPUI 3.0 (stable) (includes DEPUI, DEGFX and DETK)
Page at Freshmeat
Work-in-progress DEPUI 3.1 WIP and history
Doug Eleveld (deleveld@dds.nl)
DEPUI 3.0 - A GPL portable gui library
DEPUI is a small extremely portable user interface library. It uses an object oriented C API with reference counting for many of the objects.
Platform dependant functions are all kept in a single file and allow run-time theme changes. DEPUI is independant of the
supporting graphics library, all platform dependent functions are in a single file. Support for platforms DEGFX and Allegro
is included.
- Clean object oriented C API
- Memory efficient and fast
- Extensive documentation using MXDOC and
Doxygen
- Separated into modules: gui, graphics (DEGFX or Allegro) and toolkit (DETL)
- Themes and GFX mode changable at runtime
- Widgets:
- Text objects
- Buttons
- Horizontal and vertical sliders
- Scrollable area
- Lists with scrollbars if necessary
- Windows and window borders
- Child windows and modal windows
- GFXmode/theme window
- File selector window
- Objects can be transparent and can have any shape
- Library source is completly self-contained - You dont have to link to external libraries, not even to DEPUI!
- DEPUI uses #define flags to determine which modules to use. This guarantees that only the portions of DEPUI that you
actually use get included in your executable.
- All platform dependant code in a single file for platform/theme code
- Pre-built platforms for:
- DEGFX (tested with DJGPP, MINGW32, BCC32, LCC, Open Watcom)
- Allegro (tested with DOS)
- Runs on almost any hardware, even my 40 MHz 386 test machine
- Compiles with no changes on MSB first or LSB first hardware
- Open source and GPL licence
DEGFX 1.0 - A GPL portable graphics library

DEGFX is a small extremely portable graphics library. It has only 6 (!) platform dependant functions. It uses a clean
object oriented C API with reference counting and delete locking for (almost) all the objects. The library supports transparency for bitmaps and
all drawing functions and antialiased fonts. The user has very fast pixel level access to bitmaps using
iterators. DEGFX has no external library dependencies. Compared to other portable graphics libraries DEGFX is:
- Smaller and simpler than Allegro or SDL
- Fast alpha-blending (transparency, anti-aliasing) built into all drawing functions
- Color conversions are completely hidden to the user
- More graphic functions (line, blit) than SDL
- More portable than SDL (doesn't need threads)
- Guaranteed flicker-free graphics without double buffering the entire display
- Library source is completly self-contained - You dont have to link to external libraries, not even to DEGFX!
- Easy to determine which modules (drivers, fonts etc...) are included in the executable
DEGFX uses a different approach than most graphics libraries.
- DEGFX makes no attempt to handle bitmaps of different color depths and works internally only with 32 bit ARGB pixel
format. This makes the library internally very simple. Bitmap are only converted to the screen color depth when writing to the screen. This has the advantage
that the library internals are very simple because they only have to deal with 32 bit ARGB pixel format. This also allows
transparency and alpha-blending to be used even for monochrome, 4-bit and 8-bit displays. Although admittedly
a program that makes heavy use of antialiasing and transparency might not look very good on a 4-bit display.
- DEGFX uses a partial double buffer system that guarantees no screen flicker when drawing but uses a
lot less memory than full double buffering. Only a portion of the screen is buffered at a time and the users
redraw function is called multiple times with different clipping settings. Because a clipped graphics drawing
can be made very fast, calling the update function many times is hardly slower than full double buffering. In fact
the smaller buffer sometimes be faster than full screen buffering because of better cache behavior. In any case you can
choose how much memory you want to use for the screen buffer (even during runtime) so you can do do full double
buffering if you want to, or use minimal memory and tolerate a slightly slower screen update speed.
- DEGFX does not require linking to a library, you include the DEGFX C source code directly into you own programs.
So installing or removing DEGFX from your system is as simple as moving or deleting a directory from your
compilers include path. Using this method can cause long compile times since you are essentially compiling the library
every time you compile your program. But if you include DEGFX in a separate object file you can solve this problem.
- DEGFX uses #define flags to determine which modules to use. This guarantees that only the portions of DEGFX that you
actually use get included in your executable.
Some Features:
- Object oriented C API with attention to maximum type safety.
- Fast, unified transparency support
- Plot a solid blue pixel: mx_pixel(x, y, MXRGB(0,0,255));
- Same pixel with 50% transparency: mx_pixel(x, y, MXRGBT(0,0,255,128));
- RBG and RGBT colors are compile time macro for fast execution
- Transparency works for ALL displays even 8 bit and 4 bit graphic modes
- Unified reference counting for many objects
- Platform driver may use dirty-rectangle buffer system for fast flicker-free screen updates
- Copying to screen is localized by buffer system so banked modes work almost as fast as linear modes
- Bitmap support:
- Pixel RGB colors (32 bit ARGB) are compile time constants
- Color conversions are completely hidden from user
- Unified transparency support
- Drawing functions: pixel, line, blit, etc...
- Drawing functions are simple and fast because only 32 bit ARGB is needed
- Very fast pixel-level access using iterators
- Functions to load bitmaps from files (PCX, TGA, GIF)
- Named colors similar to X11
- Reference counting
- Font support:
- Support for bitmapped fonts and antialiased fonts
- UTF-8 encoding
- Loadable from bitmap (similar format as Allegro)
- Allegro's TTF2PCX utility can be used to make loadable TTF fonts
- Reference counting
- Simple mouse and keyboard support
- DEGFX source compiles inside your own source code
- Installing/removing the library means simply copying/deleting a directory in your compilers include path
- No need to use library tools
- Currently available drivers:
- DOS - DJGPP VESA 1.2(banked) and 2.0(linear)
- DOS - DJGPP standard VGA (640x480x4)
- DOS - DJGPP VGA mode 13h (320x200x8)
- Linux - Svgalib *** has problems ***
- Win32 - MINGW32 using GDI
- Win32 - Borlands free compiler BCC32 using GDI
- Win32 - LCC using GDI
- Win32 - Open Watcom target Win32 (GDI)
- Sinclair QL - QDOS *** in development ***
- Low memory requirements when using 'partial' double buffer
- Buffering mode can be changed on the fly
- Extremely portable: only 6 (!) platform dependant functions
- start, stop, poll, dirty, keypress, mouse info
- Runs on almost any hardware, even my 40 MHz 386 test machine
- Compiles with no changes on MSB first or LSB first hardware
- Open source and GPL licence
DETK 1.0 - A portable toolkit library
DETK is a small toolkit library for commonly used functions
- MX_ATOM base class for reference counting
- MX_RECT simple rectangle struct
- MX_RECTATOM rectangle with reference counting (derived from MX_ATOM)
- MX_VECTOR utility for handling vector of objects
- Optional wrapper for malloc/realloc/free does simple header/footer corruption checking
- A few very simple UTF-8 functions
- DETK source compiles inside your own source code
- Installing/removing the library means simply copying/deleting a directory in your compilers include path
- No need to use library tools
- Compiles with no changes on MSB first or LSB first hardware
- Open source and GPL licence
Library structure diagram for DEPUI, DEGFX and DETK
If DEPUI platform is set to DEGFX then the library structure is:
+------------------------------------------------------------+
| DETK library |
+----------------+-----------+-------------------+-----------+
| | |
| | |
+------------+---+---+-------+-------+ |
| Hardware | | | |
+------------+ | | |
| struct MX_DRIVER | | |
+--------------------+ | |
| DEGFX library | |
+----------+-------------------------+ |
| |
| |
+----------+---------------+---------------------+-----------+
| Platform/Theme driver | |
+--------------------------+ |
| DEPUI library |
+------------------------------------------------------------+
Another possibility is if DEPUI uses Allegro as its platform:
+----------+---------+---------------+
| Hardware | |
+--------------------+ |
| Allegro |
+----------+-------------------------+
|
| +-------------------------+
| | DETK library |
| +-------------+-----------+
| |
+----------+---------------+---------------------+-----------+
| Platform/Theme driver | |
+--------------------------+ |
| DEPUI library |
+------------------------------------------------------------+
Inheritance tree for DEPUI, DEGFX and DETK
DEGFX main functions:
mx_guimain
mx_start
mx_execute
MX_VECTOR - An almost typesafe C vector for objects of any size
mx_vector
mx_vector_free
mx_vector_set
mx_vector_reserve
mx_vector_append
mx_vector_remove
mx_vector_insert
mx_vector_resize
mx_vector_contract
MX_STRING - Small class for string handling
mx_string
mx_string_free
mx_string_set
mx_string_text
MX_RECT - Simple rectangle
MX_EVENT - Gui event type
mx_event
mx_emit
mx_inform
mx_answer
MX_ATOM - Base class for reference counting
| mx_delete
| mx_lock
| mx_unlock
|
+- MX_FONT - Normal or antialiased fonts
| mx_font_draw
| mx_font_drawblock
| mx_font_width
| mx_font_height
| mx_font_blocksize
| mx_font_bitmap
| mx_font_pcx
|
+- MX_RECTATOM - Reference counted rectangle
| mx_x1
| mx_y1
| mx_x2
| mx_y2
| mx_w
| mx_h
|
+- MX_BITMAP - 32 bit RGBA bitmap
| mx_bitmap
| mx_bitmap_tga
| mx_bitmap_pcx
| mx_iter
| mx_getpixel
| mx_pixel
| mx_vline
| mx_hline
| mx_rect
| mx_blit
| mx_blittrans
| mx_blitcopy
| mx_blitstretch
| mx_box
| mx_frame
|
+- MX_OBJ - Gui base object
| mx_obj
| mx_x
| mx_y
| mx_resize
| mx_move
| mx_position
| mx_place
| mx_geometry
| mx_defaultrect
| mx_armed
| mx_armable
| mx_is_armable
| mx_selected
| mx_selectable
| mx_is_selectable
| mx_disabled
| mx_arm
| mx_select
| mx_disable
| mx_focus
| mx_unfocus
| mx_wantmove
| mx_layout
| mx_top
| mx_dirty
|
+- MX_WINBORDER - Border for a window
|
+- MX_SLIDER - Drag/click slider
| mx_slider
| mx_slider_set
| mx_slider_to
| mx_slider_value
|
+- MX_TEXTUAL - Base class for objects with text
| mx_textual
| mx_text
| mx_text_set
| mx_text_align
| mx_text_align_get
| mx_text_height
| mx_text_width
|
+- MX_BUTTON - Clickable button
| | mx_button
| |
| +- MX_LISTELEM - Clickable element for a MX_LIST
| mx_listelem
|
+- MX_SCROLL - Generic scrollable area
| | mx_scroll
| |
| +- MX_LIST - Vertical list of selectable objects
| mx_list
| mx_list_select_id
| mx_list_selected_id
| mx_list_selected
| mx_list_append
| mx_list_multiple
| mx_list_iter
|
+- MX_WIN - Standard (or child) window
| mx_win
| mx_active
| mx_activate
| mx_child
| mx_modal
| mx_win_dirty
|
+- MX_GFXMODE - Graphics mode and theme selector
| mx_gfxmode
|
+- MX_FILESEL - File selector
mx_filesel
mx_filesel_info
mx_filesel_path
mx_filesel_refresh