ObjGfx is the underlying framework for a highly scalable high-resolution protected-mode object-oriented graphics library.

The purpose of ObjGfx is to create a uniform interface between graphics objects, whether they be the screen, window, double buffer, or a bitmap image. We feel that existing APIs fall far short of how a real object-oriented system should behave.

ObjGfx8 and ObjGfx16 are 8bpp and 15/16bpp libraries, respectively, which are derived from the ObjGfx0 class. Because all graphics objects are decended from a generic base class, it is easy to add support for other video modes, including but not limited to monochrome, CGA, EGA/VGA, ModeX, and True Colour.

If you are currently using ObjGfx 1.x please see the end of this document for changes you will need to make to your existing programs.


  • 48-bit Protected Mode support
  • Access to double buffers as large as 32768x4096
  • Fully object oriented access to graphics buffers
  • VBE 1.2, 2.0 and 3.0 compliant
  • Transparent support for a linear frame buffer (LFB) when available
  • Blindingly fast graphics primitives, most of which are faster than the ones produced by SciTech, VirTech, and FastGraph. Also noticably faster than TMT Pascal's Graph unit. You can download an example of ours versus theirs in the Demo/Games section. ObjGfx also recently won in a taste test against them.
  • Support for any 8/15/16bpp modes, including unstandard resolutions such as 400x300 or 512x384.
  • Generic loading and saving of graphic files including: PCX, MSH, DNY
  • The fastest transparent image (blit) support of any graphics library in existence (Blits are not compiled sprites)
  • Highly optimized bitmap routines specifically designed for games and/or graphical user interfaces (GUIs).
  • General clipping of all but three routines (GetImage, PutImage, and PutBlit do not yet clip)
  • Runs under Dos, Windows 3.1x, Windows 95, and Windows 98
  • Contains NewFrontier, a unit that allows the allocation of pointers larger than 64K.
  • Contains Keys, a unit that contains functions that behave identically to the readkey and keypressed functions in the CRT unit. It also allows an alternate keyboard handler which allows detection of multiple keypresses.

Compatibility and Limitations:

ObjGfx currently runs under all versions of DOS 5.0+, Windows 3.1x, Windows 95, and Windows 98. However, NT support is limited to 320x200. This is a limitation of NT and currently cannot be fixed. ObjGfx8 and ObjGfx16 run with all versions of VESA 1.2 and above, including SciTech's Universal VESA BIOS TSR.

ObjGfx8 and ObjGfx16 cannot be used with any other graphics routines that write directly to the screen. Any program that writes directly to SegA000 when a Linear Frame Buffer is being used will cause the LFB to automatically turn off, and the program will errantly exit.

Occasionally memory allocation will fail. This usually occurs when running in the BP IDE. Exit out of the IDE, recompile and execute it. If the allocation still fails you really don't have enough memory.

There is no mouse support yet. This will be added soon.

The LoadGfx() and SaveGfx() routines will only work on 8bpp (256 colour) PCX, MSH, DNY, LBM, and BMP files. Future support will be extended all bitmap based graphics files. StripPal() can load the palette out of these file types: PCX, MSH, DNY, PAL, BMP, LBM, and PNG. The images cannot be larger than 32768x4096.

While Borland Pascal claims it can allocate only 16 megabytes of memory, it is possible [with the NewFrontier unit] to allocate much more. However, there is a theoretical limit of somewhere around 120 megabytes. As we do not have access to a machine with more than 120 megabytes of RAM, it is unclear whether this limit actually exists. It is quite possible that with a little effort one could allocate 8,589,934,592,000 bytes (2000 * 232), or 8 Terabytes of memory. But, as we do not have access to a machine with 8 Terabytes of RAM, that will remain a mystery... at least until they start shipping the 1 Gigabyte RAM chips. Remember, 640Mb should be enough for everyone. (Note: even with 1Ghz chips not yet on the market it would take 14 minutes just to clear 8Tb of memory).


You will need RTM.EXE and DPMI16BI.OVL to run the examples. If you don't already have these files you can download them. We recommend that you at least download GfxDemo, OGSource, and Font8.

GfxDemo: A collection of graphical demos showing the power of ObjGfx. Source to each demo is included. Several new demos have been added, including some nifty line fire plasmas (lfire, lfire2 and lfire3), and a cube plasma (firecube). Last updated: 1999-06-01

OGSource: ObjGfx and other related library source code. Includes ObjGfx0, ObjGfx8, ObjGfx16, NewFrontier, and Keys. You will need these if you wish to write your own programs using ObjGfx. Last updated: 1999-06-01

Font8: A font library for use with ObjGfx8. Source code to the library is included along with many fonts and several examples of how to use them. Last updated: 1999-06-01

Ship: An example of how to use aliased Tgfx8 objects and load/save graphic files. Last updated: 1999-06-01

Caveman2: A port of Remco De Korte's Caveman demo to ObjGfx. Last updated: 1999-06-01

Life: The popular Life simulation. Contains an example of how to create a child Gfx8 object using an external ASM module. Last updated: 1999-06-01

Hexagon: An example of TMT pascal's Graph unit versus ObjGfx. Last updated: 1999-06-01

Dink: A small screen saver-esque program written by Scott Earnest. Last updated: 1999-06-01

Chelu 3: A shareware platform game that shows what is possible with ObjGfx. Last updated: 1998-05-22


LoadGfx() doesn't load all 8bpp LBMs correctly.


As of ObjGfx 2.0 the source code falls under the GNU Library General Public License.

According to section 5 of the LGPL, you may do whatever you wish with any programs you write using these libraries, including releasing your work as commercial software. Please read the LGPL carefully if you plan on modifying the libraries.

We encourage people to modify and distribute ObjGfx based on the conditions and terms laid forth in the file COPYING.TXT, which is included with the source-code. Ports to other languages and compilers are planned. Please contact us if you wish to help.

New changes in ObjGfx 2.0

  • ObjGfx is now called ObjGfx8, denoting that it is an 8bpp graphics library. There is a new unit called ObjGfx0 which contains a majority of data types and structures. Add ObjGfx0 to your Uses clause if the compiler complains about an unknown symbol.
  • There is no longer a Vesa8 type. It is now called TScreen8. If you want a pointer to TScreen8 object use PScreen8.
  • There is no longer a Gfx8 type. It is now called TGfx8. If you want a pointer to a TGfx8 object use PGfx8.
  • The ordering of variables in the objects has changed. Please see ObjGfx8.ASM for the new structure.
  • The maximum number of scanlines in an object is 4096.
  • WhatType() has been renamed to WhatType8().
  • ModeIsAvailable() has been renamed to IsModeAvailable().
  • GetBlit now accepts a pointer48 instead of a selector as the buffer to put the blit in.

    Here is an example of the old way:


    Here is the new way:


    This will allow you to dump multiple blits in the same buffer assuming that you have pre-calculated the space required.
  • AliasGfx8 no longer uses relative coords (ie, StartX, StartY, width, height). It now uses absolute coords (ie, x1,y1,x2,y2).

    Here is an example of the old way:

    {Alias a 320x200 section starting at 50,50}

    This is the new way:

    {Alias a 320x200 section starting at 50,50}


ObjGfx is Copyright © 1999
Mark Iuzzolino & Daniel Robbins.

Portions Copyright © 1972
Harold J Iuzzolino

Special thanx to Mark Baldwin and Ted Gruber for their contributions to the data structures and resolution of VESA coding problems; Henrique de Paula for writing the NewFrontier manual; Ansgar Scherp, Remco De Korte, Scott Earnest, Jare/Iguana, Denthor of Asphyxia, and others for their graphical demos which were ported to ObjGfx; and to Micah LaCombe and Shawn Bailly for showing mouse support was possible.

© 1999 MonsterSoft. All Rights Reserved.