No more GRX. Color bits working but colors wrong in SDL.

This commit is contained in:
Scott Duensing 2022-06-06 19:45:52 -05:00
parent 05b666f977
commit 7d2908b365
2003 changed files with 528 additions and 510427 deletions

View file

@ -1,123 +0,0 @@
#!/bin/bash -x
export BUILD_HOME=$(pwd)
export INSTALLED=${BUILD_HOME}/installed
export DJGPP=/opt/cross/djgpp
function buildGrx() {
pushd grx249
cp -f ${BUILD_HOME}/makedefs.grx .
make -f makefile.dj2 clean
make -f makefile.dj2 libs \
CROSS_PLATFORM="${DJGPP}/bin/i586-pc-msdosdjgpp-" \
C_FLAGS="-I${INSTALLED}/dos/include" \
L_FLAGS="-L${INSTALLED}/dos/lib"
cp -p -f lib/dj2/*.a ${INSTALLED}/dos/lib
cp -p -f include/*.h ${INSTALLED}/dos/include
make -f makefile.dj2 clean
rm lib/dj2/lib*
rm bin/*.exe
make -f makefile.x11 clean
make -f makefile.x11 libs \
C_FLAGS="-I${INSTALLED}/linux/include" \
L_FLAGS="-L${INSTALLED}/linux/lib"
cp -p -f lib/unix/*.a ${INSTALLED}/linux/lib
cp -p -f include/*.h ${INSTALLED}/linux/include
make -f makefile.x11 clean
rm lib/unix/lib*
rm bin/{bin2c,fnt2c,xmodetest}
popd
}
function buildJpeg() {
pushd jpeg-9e
(
source ${DJGPP}/setenv
sed -i 's/RM= del/RM= rm/g' makefile.dj
cp -f jconfig.dj jconfig.h
make -i -f makefile.dj clean
make -i -f makefile.dj libjpeg.a
cp -p -f *.a ${INSTALLED}/dos/lib
cp -p -f *.h ${INSTALLED}/dos/include
make -i -f makefile.dj clean
)
./configure --prefix=${INSTALLED}/linux --disable-shared
make clean
make
make install
make clean
popd
}
function buildPng() {
pushd libpng-1.6.37
(
source ${DJGPP}/setenv
cp scripts/makefile.dj2 .
sed -i "s#\-I\.\./zlib#\-I${INSTALLED}/dos/include \-DPNG_NO_CONSOLE_IO#g" makefile.dj2
sed -i "s#\-L\.\./zlib/#\-L${INSTALLED}/dos/lib#g" makefile.dj2
make -f makefile.dj2 clean
make -f makefile.dj2 libpng.a
cp -p -f *.a ${INSTALLED}/dos/lib
cp -p -f *.h ${INSTALLED}/dos/include
make -f makefile.dj2 clean
)
make clean
cp scripts/makefile.linux .
make -f makefile.linux clean
make -f makefile.linux libpng.a
cp -p -f *.a ${INSTALLED}/linux/lib
cp -p -f *.h ${INSTALLED}/linux/include
make -f makefile.linux clean
popd
}
function buildZlib() {
pushd zlib-1.2.12
(
source ${DJGPP}/setenv
make clean
./configure --prefix=${INSTALLED}/dos
make
make install
make clean
rm *.exe
)
make clean
./configure --prefix=${INSTALLED}/linux --static
make
make install
make clean
popd
}
mkdir -p ${INSTALLED}/dos/{include,lib,share}
mkdir -p ${INSTALLED}/linux/{include,lib,share}
pushd thirdparty
buildZlib
buildPng
buildJpeg
buildGrx
popd

View file

@ -4,9 +4,8 @@ CONFIG -= qt
CONFIG += console
CONFIG += c99
#CONFIG += BACKEND_GRX
#CONFIG += BACKEND_SDL2
CONFIG += BACKEND_DJGPP
CONFIG += BACKEND_SDL2
#CONFIG += BACKEND_DJGPP
SHARED = $$PWD/../shared
@ -28,10 +27,10 @@ HEADERS += \
src/gui/font.h \
src/gui/gui.h \
src/gui/image.h \
src/gui/surface.h \
src/gui/wmwindow.h \
src/os.h \
src/platform/djgpp.h \
src/platform/grx.h \
src/platform/platform.h \
src/platform/sdl2.h \
src/thirdparty/stb_image.h
@ -45,28 +44,15 @@ SOURCES += \
src/gui/font.c \
src/gui/gui.c \
src/gui/image.c \
src/gui/surface.c \
src/gui/wmwindow.c \
src/main.c \
src/platform/djgpp.c \
src/platform/grx.c \
src/platform/sdl2.c
OTHER_FILES += \
$$PWD/../LICENSE
BACKEND_GRX {
LINUX = $$PWD/../installed/linux
DEFINES += BACKEND_GRX
INCLUDEPATH += $$LINUX/include
LIBS += \
-L$$LINUX/lib \
-lgrx20X \
-lX11 \
-ljpeg \
-lpng \
-lz
}
BACKEND_SDL2 {
DEFINES += BACKEND_SDL2
LIBS += \

View file

@ -105,15 +105,15 @@ void fontRender(FontT *font, char *string, ColorT foreground, ColorT background,
offset += (font->span / 2);
if (odd) {
videoSurfacePixelSet(x, yp, (data & 0x08) ? foreground : background);
videoSurfacePixelSet(x + 1, yp, (data & 0x04) ? foreground : background);
videoSurfacePixelSet(x + 2, yp, (data & 0x02) ? foreground : background);
videoSurfacePixelSet(x + 3, yp, (data & 0x01) ? foreground : background);
surfacePixelSet(x, yp, (data & 0x08) ? foreground : background);
surfacePixelSet(x + 1, yp, (data & 0x04) ? foreground : background);
surfacePixelSet(x + 2, yp, (data & 0x02) ? foreground : background);
surfacePixelSet(x + 3, yp, (data & 0x01) ? foreground : background);
} else {
videoSurfacePixelSet(x, yp, (data & 0x80) ? foreground : background);
videoSurfacePixelSet(x + 1, yp, (data & 0x40) ? foreground : background);
videoSurfacePixelSet(x + 2, yp, (data & 0x20) ? foreground : background);
videoSurfacePixelSet(x + 3, yp, (data & 0x10) ? foreground : background);
surfacePixelSet(x, yp, (data & 0x80) ? foreground : background);
surfacePixelSet(x + 1, yp, (data & 0x40) ? foreground : background);
surfacePixelSet(x + 2, yp, (data & 0x20) ? foreground : background);
surfacePixelSet(x + 3, yp, (data & 0x10) ? foreground : background);
}
yp++;
@ -130,14 +130,14 @@ void fontRender(FontT *font, char *string, ColorT foreground, ColorT background,
data = font->bits[offset];
offset += font->span;
videoSurfacePixelSet(x, yp, (data & 0x80) ? foreground : background);
videoSurfacePixelSet(x + 1, yp, (data & 0x40) ? foreground : background);
videoSurfacePixelSet(x + 2, yp, (data & 0x20) ? foreground : background);
videoSurfacePixelSet(x + 3, yp, (data & 0x10) ? foreground : background);
videoSurfacePixelSet(x + 4, yp, (data & 0x08) ? foreground : background);
videoSurfacePixelSet(x + 5, yp, (data & 0x04) ? foreground : background);
videoSurfacePixelSet(x + 6, yp, (data & 0x02) ? foreground : background);
videoSurfacePixelSet(x + 7, yp, (data & 0x01) ? foreground : background);
surfacePixelSet(x, yp, (data & 0x80) ? foreground : background);
surfacePixelSet(x + 1, yp, (data & 0x40) ? foreground : background);
surfacePixelSet(x + 2, yp, (data & 0x20) ? foreground : background);
surfacePixelSet(x + 3, yp, (data & 0x10) ? foreground : background);
surfacePixelSet(x + 4, yp, (data & 0x08) ? foreground : background);
surfacePixelSet(x + 5, yp, (data & 0x04) ? foreground : background);
surfacePixelSet(x + 6, yp, (data & 0x02) ? foreground : background);
surfacePixelSet(x + 7, yp, (data & 0x01) ? foreground : background);
yp++;
}

View file

@ -3,7 +3,7 @@
#include "os.h"
#include "../platform/platform.h"
#include "surface.h"
typedef struct FontS {

View file

@ -13,7 +13,6 @@ typedef struct WidgetCatalogS {
ColorT *__guiBaseColors = NULL;
SurfaceT *__guiBackBuffer = NULL;
SurfaceT *__guiScreenBuffer = NULL;
FontT *__guiFontVGA8x14 = NULL;
@ -32,17 +31,17 @@ void guiRun(void) {
platformEventGet(&event);
// Paint desktop.
videoSurfaceSet(__guiBackBuffer);
videoSurfaceClear(GUI_CYAN);
surfaceSet(__guiBackBuffer);
surfaceClear(GUI_CYAN);
// Paint GUI.
wmPaint(&event);
// Paint mouse pointer.
videoSurfaceBlitWithTransparency(__guiBackBuffer, event.x, event.y, _mousePointer, _mouseTransparency);
surfaceBlitWithTransparency(__guiBackBuffer, event.x, event.y, _mousePointer, _mouseTransparency);
// Copy to screen.
videoSurfaceBlit(__guiScreenBuffer, 0, 0, __guiBackBuffer);
videoBlit(0, 0, __guiBackBuffer);
// Emergency Exit?
if (event.flags & EVENT_FLAG_KEYPRESS && event.key == KEY_ESC) guiStop();
@ -68,8 +67,8 @@ void guiShutdown(void) {
fontUnload(&__guiFontVGA8x14);
videoSurfaceDestroy(_mousePointer);
videoSurfaceDestroy(__guiBackBuffer);
surfaceDestroy(_mousePointer);
surfaceDestroy(__guiBackBuffer);
platformShutdown();
}
@ -79,12 +78,11 @@ uint8_t guiStartup(int16_t width, int16_t height, int16_t depth) {
if (platformStartup(width, height, depth) == FAIL) return FAIL;
__guiScreenBuffer = videoSurfaceScreenGet();
__guiBackBuffer = videoSurfaceCreate(videoDisplayWidthGet(), videoDisplayHeightGet());
videoSurfaceSet(__guiBackBuffer);
__guiBackBuffer = surfaceCreate(videoDisplayWidthGet(), videoDisplayHeightGet());
surfaceSet(__guiBackBuffer);
_mousePointer = imageLoad("mouse.png");
_mouseTransparency = videoSurfacePixelGet(_mousePointer, videoSurfaceWidthGet(_mousePointer) - 2, 0); // Find our transparency color.
_mouseTransparency = surfacePixelGet(_mousePointer, surfaceWidthGet(_mousePointer) - 2, 0); // Find our transparency color.
__guiFontVGA8x14 = fontLoad("vga8x14.dat");

View file

@ -2,7 +2,6 @@
#define STBI_ONLY_PNG
#include "thirdparty/stb_image.h"
#include "../platform/platform.h"
#include "image.h"
@ -17,23 +16,23 @@ SurfaceT *imageLoad(char *filename) {
int32_t x;
int32_t y;
SurfaceT *i = NULL;
SurfaceT *t = videoSurfaceGet();
SurfaceT *t = surfaceGet();
unsigned char *raw = NULL;
r = stbi_info(filename, &w, &h, &n);
if (r) {
raw = stbi_load(filename, &w, &h, &n, PIXEL_COMPONENTS);
if (raw) {
i = videoSurfaceCreate(w, h);
videoSurfaceSet(i);
i = surfaceCreate(w, h);
surfaceSet(i);
n = 0;
for (y=0; y<h; y++) {
for (x=0; x<w; x++) {
videoSurfacePixelSet(x, y, videoColorMake(raw[n], raw[n + 1], raw[n + 2]));
surfacePixelSet(x, y, surfaceColorMake(raw[n], raw[n + 1], raw[n + 2]));
n += PIXEL_COMPONENTS;
}
}
videoSurfaceSet(t);
surfaceSet(t);
stbi_image_free(raw);
}
}

View file

@ -3,7 +3,7 @@
#include "os.h"
#include "../platform/platform.h"
#include "surface.h"
SurfaceT *imageLoad(char *filename);

301
client/src/gui/surface.c Normal file
View file

@ -0,0 +1,301 @@
#include "surface.h"
SurfaceT *__surfaceActive = NULL;
uint8_t __surfaceBitsPerPixel = 0;
uint8_t __surfaceBytesPerPixel = 0;
SurfaceFormatT __surfaceFormat = { 0 };
void surfaceBlit(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source) {
uint16_t y1;
size_t offsetTarget;
size_t offsetSource;
if (targetX == 0 && targetY == 0 && target->width == source->width && target->height == source->height) {
// Direct blit of entire surface.
memcpy(target->buffer.bits8, source->buffer.bits8, source->bytes);
} else {
// Blit into larger surface.
offsetTarget = targetY * __surfaceActive->scanline + targetX * __surfaceBytesPerPixel;
offsetSource = 0;
for (y1=targetY; y1<targetY+source->height; y1++) {
memcpy(&target->buffer.bits8[offsetTarget], &source->buffer.bits8[offsetSource], source->scanline);
offsetTarget += target->scanline;
offsetSource += source->scanline;
}
}
}
void surfaceBlitWithTransparency(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source, ColorT transparent) {
uint16_t x1;
uint16_t y1;
uint16_t x2 = source->width;
uint16_t y2 = source->height;
ColorT pixel;
SurfaceT *t = surfaceGet();
surfaceSet(target);
// Clip on right and bottom
if (targetX + x2 > target->width) x2 -= targetX + x2 - target->width;
if (targetY + y2 > target->height) y2 -= targetY + y2 - target->height;
for (y1=0; y1<y2; y1++) {
for (x1=0; x1<x2; x1++) {
pixel = surfacePixelGet(source, x1, y1);
if (transparent != pixel) {
surfacePixelSet(targetX + x1, targetY + y1, pixel);
}
}
}
surfaceSet(t);
}
void surfaceClear(ColorT color) {
uint16_t x;
size_t offsetTarget;
// Draw the top line.
for (x=0; x<__surfaceActive->width; x++) {
surfacePixelSet(x, 0, color);
}
// Copy it to the other lines.
offsetTarget = __surfaceActive->scanline;
for (x=1; x<__surfaceActive->height; x++) {
memcpy(&__surfaceActive->buffer.bits8[offsetTarget], &__surfaceActive->buffer.bits8[0], __surfaceActive->scanline);
offsetTarget += __surfaceActive->scanline;
}
}
ColorT surfaceColorMake(uint8_t r, uint8_t g, uint8_t b) {
return
(r >> __surfaceFormat.rLoss) << __surfaceFormat.rShift |
(g >> __surfaceFormat.gLoss) << __surfaceFormat.gShift |
(b >> __surfaceFormat.bLoss) << __surfaceFormat.bShift |
((255 >> __surfaceFormat.aLoss) << __surfaceFormat.aShift & __surfaceFormat.aMask);
}
SurfaceT *surfaceCreate(int16_t width, int16_t height) {
SurfaceT *surface = (SurfaceT *)malloc(sizeof(SurfaceT));
if (!surface) return NULL;
surface->width = width;
surface->height = height;
surface->scanline = width * __surfaceBytesPerPixel;
surface->bytes = surface->scanline * height;
surface->buffer.bits8 = malloc(surface->bytes);
if (!surface->buffer.bits8) {
free(surface);
return NULL;
}
memset(surface->buffer.bits8, 0, surface->bytes);
return surface;
}
void surfaceBox(int16_t x1, int16_t y1, int16_t x2, int16_t y2, ColorT c) {
surfaceLineH(x1, x2, y1, c);
surfaceLineH(x1, x2, y2, c);
surfaceLineV(x1, y1, y2, c);
surfaceLineV(x2, y1, y2, c);
}
void surfaceBoxFilled(int16_t x1, int16_t y1, int16_t x2, int16_t y2, ColorT c) {
int16_t i;
size_t offsetTarget;
size_t offsetSource;
uint16_t width;
if (x1 > x2) {
i = x1;
x1 = x2;
x2 = i;
}
if (y1 > y2) {
i = y1;
y1 = y2;
y2 = i;
}
width = (x2 - x1 + 1) * __surfaceBytesPerPixel;
// Draw the top line.
for (i=x1; i<=x2; i++) {
surfacePixelSet(i, y1, c);
}
// Copy it to the other lines.
offsetTarget = __surfaceActive->scanline * (y1 + 1) + (x1 * __surfaceBytesPerPixel);
offsetSource = __surfaceActive->scanline * y1 + (x1 * __surfaceBytesPerPixel);
for (i=y1 + 1; i<=y2; i++) {
memcpy(&__surfaceActive->buffer.bits8[offsetTarget], &__surfaceActive->buffer.bits8[offsetSource], width);
offsetTarget += __surfaceActive->scanline;
}
}
void surfaceDestroy(SurfaceT *surface) {
free(surface->buffer.bits8);
free(surface);
}
SurfaceT *surfaceGet(void) {
return __surfaceActive;
}
int16_t surfaceHeightGet(SurfaceT *surface) {
return surface->height;
}
void surfaceLineH(int16_t x1, int16_t x2, int16_t y, ColorT c) {
int16_t i;
int16_t t;
if (x1 > x2) {
t = x2;
x2 = x1;
x1 = t;
}
for (i=x1; i<=x2; i++) {
surfacePixelSet(i, y, c);
}
}
void surfaceLineV(int16_t x, int16_t y1, int16_t y2, ColorT c) {
int16_t i;
int16_t t;
if (y1 > y2) {
t = y2;
y2 = y1;
y1 = t;
}
for (i=y1; i<=y2; i++) {
surfacePixelSet(x, i, c);
}
}
ColorT surfacePixelGet(SurfaceT *surface, int16_t x, int16_t y) {
switch (__surfaceBitsPerPixel) {
case 8:
return surface->buffer.bits8[y * surface->width + x];
case 16:
return surface->buffer.bits16[y * surface->width + x];
default:
return surface->buffer.bits32[y * surface->width + x];
}
}
void surfacePixelSet(int16_t x, int16_t y, ColorT c) {
switch (__surfaceBitsPerPixel) {
case 8:
__surfaceActive->buffer.bits8[y * __surfaceActive->width + x] = (uint8_t)c;
break;
case 16:
__surfaceActive->buffer.bits16[y * __surfaceActive->width + x] = (uint8_t)c;
break;
default:
__surfaceActive->buffer.bits32[y * __surfaceActive->width + x] = (uint8_t)c;
break;
}
}
void surfaceSet(SurfaceT *surface) {
__surfaceActive = surface;
}
void surfaceShutdown(void) {
// Nada
}
void surfaceStartup(uint8_t bits) {
uint8_t redMaskSize;
uint8_t greenMaskSize;
uint8_t blueMaskSize;
uint8_t alphaMaskSize;
__surfaceBitsPerPixel = bits;
__surfaceBytesPerPixel = bits >> 3;
switch (bits) {
case 8:
// xxx 3:3:2
alphaMaskSize = 0;
redMaskSize = 3;
greenMaskSize = 3;
blueMaskSize = 2;
break;
case 16:
// xx 5:6:5
alphaMaskSize = 0;
redMaskSize = 5;
greenMaskSize = 6;
blueMaskSize = 5;
break;
default:
// x 8:8:8
alphaMaskSize = 8;
redMaskSize = 8;
greenMaskSize = 8;
blueMaskSize = 8;
break;
}
__surfaceFormat.bShift = 0;
__surfaceFormat.gShift = __surfaceFormat.bShift + blueMaskSize;
__surfaceFormat.rShift = __surfaceFormat.gShift + greenMaskSize;
__surfaceFormat.aShift = __surfaceFormat.rShift + redMaskSize;
__surfaceFormat.rMask = ((1UL << redMaskSize) - 1) << __surfaceFormat.rShift;
__surfaceFormat.gMask = ((1UL << greenMaskSize) - 1) << __surfaceFormat.gShift;
__surfaceFormat.bMask = ((1UL << blueMaskSize) - 1) << __surfaceFormat.bShift;
__surfaceFormat.aMask = ((1UL << alphaMaskSize) - 1) << __surfaceFormat.aShift;
__surfaceFormat.rLoss = 8 - redMaskSize;
__surfaceFormat.gLoss = 8 - greenMaskSize;
__surfaceFormat.bLoss = 8 - blueMaskSize;
__surfaceFormat.aLoss = 8 - alphaMaskSize;
printf("Red Mask %u Shift %u Loss %u\n", __surfaceFormat.rMask, __surfaceFormat.rShift, __surfaceFormat.rLoss);
printf("Green Mask %u Shift %u Loss %u\n", __surfaceFormat.gMask, __surfaceFormat.gShift, __surfaceFormat.gLoss);
printf("Blue Mask %u Shift %u Loss %u\n", __surfaceFormat.bMask, __surfaceFormat.bShift, __surfaceFormat.bLoss);
printf("Alpha Mask %u Shift %u Loss %u\n\n", __surfaceFormat.aMask, __surfaceFormat.aShift, __surfaceFormat.aLoss);
}
int16_t surfaceWidthGet(SurfaceT *surface) {
return surface->width;
}

64
client/src/gui/surface.h Normal file
View file

@ -0,0 +1,64 @@
#ifndef SURFACE_H
#define SURFACE_H
#include "os.h"
typedef uint32_t ColorT;
typedef struct SurfaceS {
uint16_t width;
uint16_t height;
size_t scanline;
size_t bytes;
union {
uint8_t *bits8;
uint16_t *bits16;
uint32_t *bits32;
} buffer;
} SurfaceT;
typedef struct SurfaceFormatS {
uint32_t rMask;
uint32_t gMask;
uint32_t bMask;
uint32_t aMask;
uint8_t rShift;
uint8_t gShift;
uint8_t bShift;
uint8_t aShift;
uint8_t rLoss;
uint8_t gLoss;
uint8_t bLoss;
uint8_t aLoss;
} SurfaceFormatT;
extern SurfaceT *__surfaceActive;
extern uint8_t __surfaceBitsPerPixel;
extern uint8_t __surfaceBytesPerPixel;
extern SurfaceFormatT __surfaceFormat;
void surfaceBlit(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source);
void surfaceBlitWithTransparency(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source, ColorT transparent);
void surfaceClear(ColorT color);
ColorT surfaceColorMake(uint8_t r, uint8_t g, uint8_t b);
SurfaceT *surfaceCreate(int16_t width, int16_t height);
void surfaceBox(int16_t x1, int16_t y1, int16_t x2, int16_t y2, ColorT c);
void surfaceBoxFilled(int16_t x1, int16_t y1, int16_t x2, int16_t y2, ColorT c);
void surfaceDestroy(SurfaceT *surface);
SurfaceT *surfaceGet(void);
int16_t surfaceHeightGet(SurfaceT *surface);
void surfaceLineH(int16_t x1, int16_t x2, int16_t y, ColorT c);
void surfaceLineV(int16_t x, int16_t y1, int16_t y2, ColorT c);
ColorT surfacePixelGet(SurfaceT *surface, int16_t x, int16_t y);
void surfacePixelSet(int16_t x, int16_t y, ColorT c);
void surfaceSet(SurfaceT *surface);
void surfaceShutdown(void);
void surfaceStartup(uint8_t bits);
int16_t surfaceWidthGet(SurfaceT *surface);
#endif // SURFACE_H

View file

@ -57,14 +57,14 @@ void windowPaint(struct WidgetS *widget, ...) {
ColorT titleBackgroundColor = GUI_DARKGRAY;
// Fake Window contents.
videoSurfaceBoxFilled(x1, y1, x2, y2, GUI_BLACK);
surfaceBoxFilled(x1, y1, x2, y2, GUI_BLACK);
// If we need a titlebar, it's 18px.
if (w->title || w->flags & WIN_CLOSE || w->flags & WIN_MAXIMIZE || w->flags & WIN_MINIMIZE) {
// Draw title bar background.
y1 -= 18;
videoSurfaceBoxFilled(x1, y1, x2, y1 + 17, titleBackgroundColor);
surfaceBoxFilled(x1, y1, x2, y1 + 17, titleBackgroundColor);
// Close box?
if (w->flags & WIN_CLOSE) {
@ -73,18 +73,18 @@ void windowPaint(struct WidgetS *widget, ...) {
w->close.y = y1 + 1;
w->close.x2 = w->close.x + 24;
w->close.y2 = w->close.y + 15;
videoSurfaceBoxFilled(w->close.x + 1, w->close.y + 1, w->close.x2 - 1, w->close.y2 - 1, GUI_LIGHTGRAY);
videoSurfaceLineH(w->close.x, w->close.x2, w->close.y, GUI_WHITE);
videoSurfaceLineV(w->close.x, w->close.y, w->close.y2, GUI_WHITE);
surfaceBoxFilled(w->close.x + 1, w->close.y + 1, w->close.x2 - 1, w->close.y2 - 1, GUI_LIGHTGRAY);
surfaceLineH(w->close.x, w->close.x2, w->close.y, GUI_WHITE);
surfaceLineV(w->close.x, w->close.y, w->close.y2, GUI_WHITE);
// Button is 8px down, 3px tall, and 4px in on both sides.
tx1 = w->close.x + 4;
ty1 = w->close.y + 7;
tx2 = w->close.x2 - 4;
ty2 = w->close.y + 9;
videoSurfaceLineH(tx1, tx2, ty1, GUI_WHITE);
videoSurfacePixelSet(tx1, ty1 + 1, GUI_WHITE);
videoSurfaceLineH(tx1, tx2, ty2, GUI_BLACK);
videoSurfaceLineV(tx2, ty1, ty2, GUI_BLACK);
surfaceLineH(tx1, tx2, ty1, GUI_WHITE);
surfacePixelSet(tx1, ty1 + 1, GUI_WHITE);
surfaceLineH(tx1, tx2, ty2, GUI_BLACK);
surfaceLineV(tx2, ty1, ty2, GUI_BLACK);
// Set titlebar area.
w->titlebar.x = w->close.x2 + 2;
} else {
@ -102,18 +102,18 @@ void windowPaint(struct WidgetS *widget, ...) {
w->maximize.x2 = x2 - 1;
w->maximize.x = w->maximize.x2 - 24;
w->maximize.y2 = w->maximize.y + 15;
videoSurfaceBoxFilled(w->maximize.x + 1, w->maximize.y + 1, w->maximize.x2 - 1, w->maximize.y2 - 1, GUI_LIGHTGRAY);
videoSurfaceLineH(w->maximize.x, w->maximize.x2, w->maximize.y, GUI_WHITE);
videoSurfaceLineV(w->maximize.x, w->maximize.y, w->maximize.y2, GUI_WHITE);
surfaceBoxFilled(w->maximize.x + 1, w->maximize.y + 1, w->maximize.x2 - 1, w->maximize.y2 - 1, GUI_LIGHTGRAY);
surfaceLineH(w->maximize.x, w->maximize.x2, w->maximize.y, GUI_WHITE);
surfaceLineV(w->maximize.x, w->maximize.y, w->maximize.y2, GUI_WHITE);
// Button is 3px down, and 4px in on both sides.
tx1 = w->maximize.x + 4;
ty1 = w->maximize.y + 4;
tx2 = w->maximize.x2 - 3;
ty2 = w->maximize.y + 12;
videoSurfaceLineH(tx1, tx2, ty1, GUI_WHITE);
videoSurfaceLineV(tx1, ty1, ty2, GUI_WHITE);
videoSurfaceLineH(tx1, tx2, ty2, GUI_BLACK);
videoSurfaceLineV(tx2, ty1, ty2, GUI_BLACK);
surfaceLineH(tx1, tx2, ty1, GUI_WHITE);
surfaceLineV(tx1, ty1, ty2, GUI_WHITE);
surfaceLineH(tx1, tx2, ty2, GUI_BLACK);
surfaceLineV(tx2, ty1, ty2, GUI_BLACK);
// Move minimize button over.
minimizeOffset = 26;
// Set titlebar area.
@ -127,24 +127,24 @@ void windowPaint(struct WidgetS *widget, ...) {
w->minimize.x2 = x2 - 1 - minimizeOffset;
w->minimize.x = w->minimize.x2 - 24;
w->minimize.y2 = w->minimize.y + 15;
videoSurfaceBoxFilled(w->minimize.x + 1, w->minimize.y + 1, w->minimize.x2 - 1, w->minimize.y2 - 1, GUI_LIGHTGRAY);
videoSurfaceLineH(w->minimize.x, w->minimize.x2, w->minimize.y, GUI_WHITE);
videoSurfaceLineV(w->minimize.x, w->minimize.y, w->minimize.y2, GUI_WHITE);
surfaceBoxFilled(w->minimize.x + 1, w->minimize.y + 1, w->minimize.x2 - 1, w->minimize.y2 - 1, GUI_LIGHTGRAY);
surfaceLineH(w->minimize.x, w->minimize.x2, w->minimize.y, GUI_WHITE);
surfaceLineV(w->minimize.x, w->minimize.y, w->minimize.y2, GUI_WHITE);
tx1 = w->minimize.x + 10;
ty1 = w->minimize.y + 6;
tx2 = w->minimize.x2 - 8;
ty2 = w->minimize.y + 9;
videoSurfaceLineH(tx1, tx2, ty1, GUI_WHITE);
videoSurfaceLineV(tx1, ty1, ty2, GUI_WHITE);
videoSurfaceLineH(tx1, tx2, ty2, GUI_BLACK);
videoSurfaceLineV(tx2, ty1, ty2, GUI_BLACK);
surfaceLineH(tx1, tx2, ty1, GUI_WHITE);
surfaceLineV(tx1, ty1, ty2, GUI_WHITE);
surfaceLineH(tx1, tx2, ty2, GUI_BLACK);
surfaceLineV(tx2, ty1, ty2, GUI_BLACK);
// Set titlebar area.
w->titlebar.x2 -= 26;
}
// Title font area is 12px high.
videoSurfaceLineH(w->titlebar.x, w->titlebar.x2 - 1, w->titlebar.y, GUI_WHITE);
videoSurfaceLineV(w->titlebar.x, w->titlebar.y, w->titlebar.y2 - 1, GUI_WHITE);
surfaceLineH(w->titlebar.x, w->titlebar.x2 - 1, w->titlebar.y, GUI_WHITE);
surfaceLineV(w->titlebar.x, w->titlebar.y, w->titlebar.y2 - 1, GUI_WHITE);
if (w->title) {
ty1 = w->titlebar.y + 2;
tx1 = w->titlebar.x + 2 + (w->titlebar.x2 - w->titlebar.x - 4) * 0.5 - ((strlen(w->title) * 8) * 0.5);
@ -157,29 +157,29 @@ void windowPaint(struct WidgetS *widget, ...) {
y1--;
x2++;
y2++;
videoSurfaceLineH(x1, x2, y2, GUI_WHITE);
videoSurfaceLineV(x2, y1, y2, GUI_WHITE);
videoSurfaceLineH(x1, x2, y1, GUI_DARKGRAY);
videoSurfaceLineV(x1, y1, y2, GUI_DARKGRAY);
surfaceLineH(x1, x2, y2, GUI_WHITE);
surfaceLineV(x2, y1, y2, GUI_WHITE);
surfaceLineH(x1, x2, y1, GUI_DARKGRAY);
surfaceLineV(x1, y1, y2, GUI_DARKGRAY);
// Frame Border. 4px wide.
x1 -= 4;
y1 -= 4;
x2 += 4;
y2 += 4;
videoSurfaceBoxFilled(x1, y1, x1 + 3, y2, GUI_LIGHTGRAY);
videoSurfaceBoxFilled(x2, y1, x2 - 3, y2, GUI_LIGHTGRAY);
videoSurfaceBoxFilled(x1, y1, x2, y1 + 3, GUI_LIGHTGRAY);
videoSurfaceBoxFilled(x1, y2, x2, y2 - 3, GUI_LIGHTGRAY);
surfaceBoxFilled(x1, y1, x1 + 3, y2, GUI_LIGHTGRAY);
surfaceBoxFilled(x2, y1, x2 - 3, y2, GUI_LIGHTGRAY);
surfaceBoxFilled(x1, y1, x2, y1 + 3, GUI_LIGHTGRAY);
surfaceBoxFilled(x1, y2, x2, y2 - 3, GUI_LIGHTGRAY);
// Resize handle.
if (w->flags & WIN_RESIZE) {
ty1 = y2 - 15 - 3;
tx1 = x2 - 15 - 3;
videoSurfaceLineH(x2, x2 - 3, ty1, GUI_DARKGRAY);
videoSurfaceLineH(x2, x2 - 3, ty1 + 1, GUI_WHITE);
videoSurfaceLineV(tx1, y2, y2 - 3, GUI_DARKGRAY);
videoSurfaceLineV(tx1 + 1, y2, y2 - 3, GUI_WHITE);
surfaceLineH(x2, x2 - 3, ty1, GUI_DARKGRAY);
surfaceLineH(x2, x2 - 3, ty1 + 1, GUI_WHITE);
surfaceLineV(tx1, y2, y2 - 3, GUI_DARKGRAY);
surfaceLineV(tx1 + 1, y2, y2 - 3, GUI_WHITE);
}
// Outermost shadow frame. 1px wide.
@ -187,10 +187,10 @@ void windowPaint(struct WidgetS *widget, ...) {
y1--;
x2++;
y2++;
videoSurfaceLineH(x1, x2, y1, GUI_WHITE);
videoSurfaceLineV(x1, y1, y2, GUI_WHITE);
videoSurfaceLineH(x1, x2, y2, GUI_DARKGRAY);
videoSurfaceLineV(x2, y1, y2, GUI_DARKGRAY);
surfaceLineH(x1, x2, y1, GUI_WHITE);
surfaceLineV(x1, y1, y2, GUI_WHITE);
surfaceLineH(x1, x2, y2, GUI_DARKGRAY);
surfaceLineV(x2, y1, y2, GUI_DARKGRAY);
w->bounds.x = x1;
w->bounds.x2 = x2;
w->bounds.y = y1;
@ -225,7 +225,7 @@ void wmPaint(EventT *event) {
// Paint all windows.
for (i=0; i<arrlen(_windowList); i++) {
videoSurfaceSet(__guiBackBuffer);
surfaceSet(__guiBackBuffer);
widget = (WidgetT *)_windowList[i];
widget->reg->paint(widget);
}
@ -239,12 +239,12 @@ void wmPaint(EventT *event) {
if (event->buttons & BUTTON_LEFT) {
// DEBUG - draw active regions. ***TODO*** No resize grabber here.
videoSurfaceBox(win->bounds.x, win->bounds.y, win->bounds.x2, win->bounds.y2, GUI_YELLOW);
videoSurfaceBox(win->base.r.x, win->base.r.y, win->base.r.x + win->base.r.w - 1, win->base.r.y + win->base.r.h - 1, GUI_YELLOW);
videoSurfaceBox(win->close.x, win->close.y, win->close.x2, win->close.y2, GUI_RED);
videoSurfaceBox(win->titlebar.x, win->titlebar.y, win->titlebar.x2, win->titlebar.y2, GUI_RED);
videoSurfaceBox(win->minimize.x, win->minimize.y, win->minimize.x2, win->minimize.y2, GUI_RED);
videoSurfaceBox(win->maximize.x, win->maximize.y, win->maximize.x2, win->maximize.y2, GUI_RED);
surfaceBox(win->bounds.x, win->bounds.y, win->bounds.x2, win->bounds.y2, GUI_YELLOW);
surfaceBox(win->base.r.x, win->base.r.y, win->base.r.x + win->base.r.w - 1, win->base.r.y + win->base.r.h - 1, GUI_YELLOW);
surfaceBox(win->close.x, win->close.y, win->close.x2, win->close.y2, GUI_RED);
surfaceBox(win->titlebar.x, win->titlebar.y, win->titlebar.x2, win->titlebar.y2, GUI_RED);
surfaceBox(win->minimize.x, win->minimize.y, win->minimize.x2, win->minimize.y2, GUI_RED);
surfaceBox(win->maximize.x, win->maximize.y, win->maximize.x2, win->maximize.y2, GUI_RED);
// Are we currently dragging?
if (dragging) {

View file

@ -64,20 +64,20 @@ void platformEventGet(EventT *event);
ColorT videoColorMake(uint8_t red, uint8_t green, uint8_t blue);
uint16_t videoDisplayHeightGet(void);
uint16_t videoDisplayWidthGet(void);
void videoSurfaceBlit(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source);
void videoSurfaceBlitWithTransparency(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source, ColorT transparent);
void videoSurfaceClear(ColorT color);
SurfaceT *videoSurfaceCreate(int16_t width, int16_t height);
void videoSurfaceBox(int16_t x1, int16_t y1, int16_t x2, int16_t y2, ColorT c);
void videoSurfaceBoxFilled(int16_t x1, int16_t y1, int16_t x2, int16_t y2, ColorT c);
void videoSurfaceDestroy(SurfaceT *surface);
SurfaceT *videoSurfaceGet(void);
int16_t videoSurfaceHeightGet(SurfaceT *surface);
void videoSurfaceLineH(int16_t x1, int16_t y1, int16_t x, ColorT c);
void videoSurfaceLineV(int16_t x, int16_t x2, int16_t y2, ColorT c);
void videoSurfaceSet(SurfaceT *surface);
SurfaceT *videoSurfaceScreenGet(void);
int16_t videoSurfaceWidthGet(SurfaceT *surface);
void surfaceBlit(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source);
void surfaceBlitWithTransparency(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source, ColorT transparent);
void surfaceClear(ColorT color);
SurfaceT *surfaceCreate(int16_t width, int16_t height);
void surfaceBox(int16_t x1, int16_t y1, int16_t x2, int16_t y2, ColorT c);
void surfaceBoxFilled(int16_t x1, int16_t y1, int16_t x2, int16_t y2, ColorT c);
void surfaceDestroy(SurfaceT *surface);
SurfaceT *surfaceGet(void);
int16_t surfaceHeightGet(SurfaceT *surface);
void surfaceLineH(int16_t x1, int16_t y1, int16_t x, ColorT c);
void surfaceLineV(int16_t x, int16_t x2, int16_t y2, ColorT c);
void surfaceSet(SurfaceT *surface);
SurfaceT *videoDisplayGet(void);
int16_t surfaceWidthGet(SurfaceT *surface);
#endif // DJGPP_H

View file

@ -1,107 +0,0 @@
#ifdef BACKEND_GRX
#include "stdio.h"
#include "grx.h"
#include "../gui/gui.h"
typedef struct VideoModeS {
int width;
int height;
int depth;
} VideoModeT;
// This is a total hack to prevent GRX from drawing the mouse pointer.
extern struct _GR_mouseInfo _GrMouseInfo;
void platformShutdown(void) {
GrMouseEraseCursor();
GrMouseUnInit();
GrSetMode(GR_default_text);
}
uint8_t platformStartup(int16_t width, int16_t height, int16_t depth) {
// Set up graphics environment.
if (!GrSetMode(GR_width_height_bpp_graphics, width, height, depth)) {
return FAIL;
}
GrSetRGBcolorMode();
__guiBaseColors = GrAllocEgaColors(); // This does not need released.
// Set up mouse.
GrMouseInit();
GrMouseEventEnable(1, 1);
GrMouseSetCursorMode(GR_M_CUR_NORMAL);
// This is a total hack to prevent GRX from drawing the mouse pointer.
_GrMouseInfo.cursor = 0;
return SUCCESS;
}
void videoModesShow(void) {
VideoModeT mode[256];
int32_t modeCount = 0;
int32_t i;
GrFrameMode fm;
const GrVideoMode *mp;
GrSetDriver(0);
if (GrCurrentVideoDriver() == 0) {
printf("No graphics driver found!\n");
return;
}
for (fm=GR_firstGraphicsFrameMode; fm<=GR_lastGraphicsFrameMode; fm++) {
mp = GrFirstVideoMode(fm);
while (mp != 0) {
if (mp->width >= 640 && mp->height >= 480 && mp->bpp >= 8) {
mode[modeCount].width = mp->width;
mode[modeCount].height = mp->height;
mode[modeCount].depth = mp->bpp;
modeCount++;
}
mp = GrNextVideoMode(mp);
}
}
GrSetMode(GR_default_text);
printf("Available graphics modes:\n\n");
for (i=0; i<modeCount; i++) {
printf("%4d x %4d %2d bpp\n", mode[i].width, mode[i].height, mode[i].depth);
}
GrKeyRead();
return;
}
void videoSurfaceBlit(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source) {
GrBitBlt(target, targetX, targetY, source, 0, 0, videoSurfaceWidthGet(source) - 1, videoSurfaceHeightGet(source) - 1, GrWRITE);
}
void videoSurfaceBlitWithTransparency(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source, ColorT transparent) {
GrBitBlt(target, targetX, targetY, source, 0, 0, videoSurfaceWidthGet(source) - 1, videoSurfaceHeightGet(source) - 1, GrIMAGE | transparent);
}
int16_t videoSurfaceHeightGet(SurfaceT *surface) {
return surface->gc_ymax + 1;
}
int16_t videoSurfaceWidthGet(SurfaceT *surface) {
return surface->gc_xmax + 1;
}
#endif // BACKEND_GRX

View file

@ -1,57 +0,0 @@
#ifndef GRX_H
#define GRX_H
#include <stdint.h>
#include "grx20.h"
#include "grxkeys.h"
typedef GrColor ColorT;
typedef GrContext SurfaceT;
typedef GrMouseEvent EventT;
#define EVENT_FLAG_KEYPRESS GR_M_KEYPRESS
#define EVENT_FLAG_LEFT_DOWN GR_M_LEFT_DOWN
#define EVENT_FLAG_LEFT_UP GR_M_LEFT_UP
#define EVENT_FLAG_RIGHT_DOWN GR_M_RIGHT_DOWN
#define EVENT_FLAG_RIGHT_UP GR_M_RIGHT_UP
#define BUTTON_LEFT GR_M_LEFT
#define BUTTON_RIGHT GR_M_RIGHT
#define META_ALT GR_KB_ALT
#define META_CTRL GR_KB_CTRL
#define META_SHIFT GR_KB_SHIFT
#define KEY_ESC GrKey_Escape
#define platformEventGet(p) GrMouseGetEventT(GR_M_EVENT, p, 0)
#define videoDisplayHeightGet GrScreenY
#define videoDisplayWidthGet GrScreenX
#define videoSurfaceClear GrClearContext
#define videoColorMake GrAllocColor
#define videoSurfaceCreate(w,h) GrCreateContext(w,h,0,0)
#define videoSurfaceBox GrBox
#define videoSurfaceBoxFilled GrFilledBox
#define videoSurfaceDestroy GrDestroyContext
#define videoSurfaceGet GrCurrentContext
#define videoSurfaceLineH GrHLine
#define videoSurfaceLineV GrVLine
#define videoSurfacePixelGet GrPixelC
#define videoSurfacePixelSet GrPlot
#define videoSurfaceSet GrSetContext
#define videoSurfaceScreenGet GrScreenContext
void videoSurfaceBlit(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source);
void videoSurfaceBlitWithTransparency(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source, ColorT transparent);
int16_t videoSurfaceHeightGet(SurfaceT *surface);
int16_t videoSurfaceWidthGet(SurfaceT *surface);
#endif // GRX_H

View file

@ -5,10 +5,6 @@
#include "stdint.h"
#ifdef BACKEND_GRX
#include "grx.h"
#endif
#ifdef BACKEND_SDL2
#include "sdl2.h"
#endif

View file

@ -2,28 +2,20 @@
#include "sdl2.h"
#define BYTES_PER_PIXEL 4
#include "../gui/surface.h"
static SDL_Window *_window = NULL;
static SDL_Renderer *_renderer = NULL;
static SDL_Surface *_surface = NULL;
static SDL_Texture *_texture = NULL;
static uint16_t _width = 0;
static uint16_t _height = 0;
static uint8_t _windowScale = 1;
static uint32_t _pixelFormat = SDL_PIXELFORMAT_RGBA8888;
static SurfaceT *_activeSurface = NULL;
extern ColorT *__guiBaseColors;
#define PUTPIXEL(s,x,y,c) s->buffer.bits32[(y) * s->width + (x)] = (c)
void platformEventGet(EventT *event) {
SDL_Event e;
static uint8_t ASCII = 0;
@ -94,6 +86,8 @@ void platformEventGet(EventT *event) {
void platformShutdown(void) {
surfaceShutdown();
free(__guiBaseColors);
if (_texture) {
@ -135,17 +129,52 @@ void platformStartup(int16_t width, int16_t height, int16_t depth) {
{ 255, 255, 85 }, /* yellow */
{ 255, 255, 255 } /* white */
};
SDL_PixelFormatEnum pixelFormat;
(void)depth;
SDL_Surface *bits8 = SDL_CreateRGBSurfaceWithFormat(0, 320, 200, 8, SDL_PIXELFORMAT_RGB332);
SDL_Surface *bits16 = SDL_CreateRGBSurfaceWithFormat(0, 320, 200, 8, SDL_PIXELFORMAT_RGB565);
SDL_Surface *bits32 = SDL_CreateRGBSurfaceWithFormat(0, 320, 200, 8, SDL_PIXELFORMAT_ARGB8888);
printf("8 Red Mask %u Shift %u Loss %u\n", bits8->format->Rmask, bits8->format->Rshift, bits8->format->Rloss);
printf("8 Green Mask %u Shift %u Loss %u\n", bits8->format->Gmask, bits8->format->Gshift, bits8->format->Gloss);
printf("8 Blue Mask %u Shift %u Loss %u\n", bits8->format->Bmask, bits8->format->Bshift, bits8->format->Bloss);
printf("8 Alpha Mask %u Shift %u Loss %u\n\n", bits8->format->Amask, bits8->format->Ashift, bits8->format->Aloss);
printf("16 Red Mask %u Shift %u Loss %u\n", bits16->format->Rmask, bits16->format->Rshift, bits16->format->Rloss);
printf("16 Green Mask %u Shift %u Loss %u\n", bits16->format->Gmask, bits16->format->Gshift, bits16->format->Gloss);
printf("16 Blue Mask %u Shift %u Loss %u\n", bits16->format->Bmask, bits16->format->Bshift, bits16->format->Bloss);
printf("16 Alpha Mask %u Shift %u Loss %u\n\n", bits16->format->Amask, bits16->format->Ashift, bits16->format->Aloss);
printf("32 Red Mask %u Shift %u Loss %u\n", bits32->format->Rmask, bits32->format->Rshift, bits32->format->Rloss);
printf("32 Green Mask %u Shift %u Loss %u\n", bits32->format->Gmask, bits32->format->Gshift, bits32->format->Gloss);
printf("32 Blue Mask %u Shift %u Loss %u\n", bits32->format->Bmask, bits32->format->Bshift, bits32->format->Bloss);
printf("32 Alpha Mask %u Shift %u Loss %u\n\n", bits32->format->Amask, bits32->format->Ashift, bits32->format->Aloss);
switch (depth) {
case 8:
pixelFormat = SDL_PIXELFORMAT_RGB332;
break;
case 16:
pixelFormat = SDL_PIXELFORMAT_RGB565;
break;
case 32:
pixelFormat = SDL_PIXELFORMAT_ARGB8888;
break;
}
SDL_Init(SDL_INIT_EVERYTHING);
_windowScale = 3;
_window = SDL_CreateWindow("GUI Debug", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, SDL_WINDOW_ALLOW_HIGHDPI);
_surface = SDL_GetWindowSurface(_window);
_renderer = SDL_CreateRenderer(_window, -1, SDL_RENDERER_ACCELERATED);
_texture = SDL_CreateTexture(_renderer, _pixelFormat, SDL_TEXTUREACCESS_STREAMING, width, height);
_texture = SDL_CreateTexture(_renderer, pixelFormat, SDL_TEXTUREACCESS_STREAMING, width, height);
SDL_RenderSetLogicalSize(_renderer, width, height);
SDL_SetWindowSize(_window, width * _windowScale, height * _windowScale);
@ -153,13 +182,35 @@ void platformStartup(int16_t width, int16_t height, int16_t depth) {
_width = width;
_height = height;
surfaceStartup(depth);
// ***TODO*** This needs to be in GUI.
__guiBaseColors = (ColorT *)malloc(sizeof(ColorT) * 16);
for (i=0; i<16; i++) {
__guiBaseColors[i] = videoColorMake(EGA[i][0], EGA[i][1], EGA[i][2]);
__guiBaseColors[i] = surfaceColorMake(EGA[i][0], EGA[i][1], EGA[i][2]);
}
}
void videoBlit(int16_t targetX, int16_t targetY, SurfaceT *source) {
void *pixels;
int temp;
//***TODO*** Does not handle partial blits at this time.
(void)targetX;
(void)targetY;
SDL_LockTexture(_texture, NULL, &pixels, &temp);
memcpy(pixels, source->buffer.bits8, source->bytes);
SDL_UnlockTexture(_texture);
SDL_RenderCopy(_renderer, _texture, NULL, NULL);
SDL_RenderPresent(_renderer);
// Throttle this to some sane frame rate.
SDL_Delay(32);
}
uint16_t videoDisplayHeightGet(void) {
return _height;
}
@ -175,220 +226,4 @@ void videoModesShow(void) {
}
void videoSurfaceBlit(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source) {
uint16_t y1;
size_t offsetTarget;
size_t offsetSource;
void *pixels;
int temp;
// HACK! Are we copying to the screen? This assumes a full screen update.
if (!target) {
SDL_LockTexture(_texture, NULL, &pixels, &temp);
memcpy(pixels, source->buffer.bits8, source->bytes);
SDL_UnlockTexture(_texture);
SDL_RenderCopy(_renderer, _texture, NULL, NULL);
SDL_RenderPresent(_renderer);
// Throttle this to some sane frame rate.
SDL_Delay(32);
return;
}
if (targetX == 0 && targetY == 0 && target->width == source->width && target->height == source->height) {
// Direct blit of entire surface.
memcpy(target->buffer.bits8, source->buffer.bits8, source->bytes);
} else {
// Blit into larger surface.
offsetTarget = targetY * _activeSurface->scanline + targetX * BYTES_PER_PIXEL;
offsetSource = 0;
for (y1=targetY; y1<targetY+source->height; y1++) {
memcpy(&target->buffer.bits8[offsetTarget], &source->buffer.bits8[offsetSource], source->scanline);
offsetTarget += target->scanline;
offsetSource += source->scanline;
}
}
}
void videoSurfaceBlitWithTransparency(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source, ColorT transparent) {
uint16_t x1;
uint16_t y1;
uint16_t x2 = source->width;
uint16_t y2 = source->height;
ColorT pixel;
// Clip on right and bottom
if (targetX + x2 > target->width) x2 -= targetX + x2 - target->width;
if (targetY + y2 > target->height) y2 -= targetY + y2 - target->height;
for (y1=0; y1<y2; y1++) {
for (x1=0; x1<x2; x1++) {
pixel = source->buffer.bits32[y1 * source->width + x1];
if (transparent != pixel) {
PUTPIXEL(target, targetX + x1, targetY + y1, pixel);
}
}
}
}
void videoSurfaceClear(ColorT color) {
uint16_t x;
size_t offsetTarget;
// Draw the top line.
for (x=0; x<_activeSurface->width; x++) {
PUTPIXEL(_activeSurface, x, 0, color);
}
// Copy it to the other lines.
offsetTarget = _activeSurface->scanline;
for (x=1; x<_activeSurface->height; x++) {
memcpy(&_activeSurface->buffer.bits8[offsetTarget], &_activeSurface->buffer.bits8[0], _activeSurface->scanline);
offsetTarget += _activeSurface->scanline;
}
}
SurfaceT *videoSurfaceCreate(int16_t width, int16_t height) {
SurfaceT *surface = (SurfaceT *)malloc(sizeof(SurfaceT));
if (!surface) return NULL;
surface->width = width;
surface->height = height;
surface->scanline = width * BYTES_PER_PIXEL;
surface->bytes = surface->scanline * height;
surface->buffer.bits8 = malloc(surface->bytes);
if (!surface->buffer.bits8) {
free(surface);
return NULL;
}
memset(surface->buffer.bits8, 0, surface->bytes);
return surface;
}
void videoSurfaceBox(int16_t x1, int16_t y1, int16_t x2, int16_t y2, ColorT c) {
videoSurfaceLineH(x1, x2, y1, c);
videoSurfaceLineH(x1, x2, y2, c);
videoSurfaceLineV(x1, y1, y2, c);
videoSurfaceLineV(x2, y1, y2, c);
}
void videoSurfaceBoxFilled(int16_t x1, int16_t y1, int16_t x2, int16_t y2, ColorT c) {
int16_t i;
size_t offsetTarget;
size_t offsetSource;
uint16_t width;
if (x1 > x2) {
i = x1;
x1 = x2;
x2 = i;
}
if (y1 > y2) {
i = y1;
y1 = y2;
y2 = i;
}
width = (x2 - x1 + 1) * BYTES_PER_PIXEL;
// Draw the top line.
for (i=x1; i<=x2; i++) {
PUTPIXEL(_activeSurface, i, y1, c);
}
// Copy it to the other lines.
offsetTarget = _activeSurface->scanline * (y1 + 1) + (x1 * BYTES_PER_PIXEL);
offsetSource = _activeSurface->scanline * y1 + (x1 * BYTES_PER_PIXEL);
for (i=y1 + 1; i<=y2; i++) {
memcpy(&_activeSurface->buffer.bits8[offsetTarget], &_activeSurface->buffer.bits8[offsetSource], width);
offsetTarget += _activeSurface->scanline;
}
}
void videoSurfaceDestroy(SurfaceT *surface) {
free(surface->buffer.bits8);
free(surface);
}
SurfaceT *videoSurfaceGet(void) {
return _activeSurface;
}
int16_t videoSurfaceHeightGet(SurfaceT *surface) {
return surface->height;
}
void videoSurfaceLineH(int16_t x1, int16_t x2, int16_t y, ColorT c) {
int16_t i;
int16_t t;
if (x1 > x2) {
t = x2;
x2 = x1;
x1 = t;
}
for (i=x1; i<=x2; i++) {
PUTPIXEL(_activeSurface, i, y, c);
}
}
void videoSurfaceLineV(int16_t x, int16_t y1, int16_t y2, ColorT c) {
int16_t i;
int16_t t;
if (y1 > y2) {
t = y2;
y2 = y1;
y1 = t;
}
for (i=y1; i<=y2; i++) {
PUTPIXEL(_activeSurface, x, i, c);
}
}
ColorT videoSurfacePixelGet(SurfaceT *surface, int16_t x, int16_t y) {
return surface->buffer.bits32[y * surface->width + x];
}
void videoSurfacePixelSet(int16_t x, int16_t y, ColorT c) {
PUTPIXEL(_activeSurface, x, y, c);
}
void videoSurfaceSet(SurfaceT *surface) {
_activeSurface = surface;
}
SurfaceT *videoSurfaceScreenGet(void) {
return NULL;
}
int16_t videoSurfaceWidthGet(SurfaceT *surface) {
return surface->width;
}
#endif // BACKEND_SDL2

View file

@ -5,22 +5,9 @@
#include <stdint.h>
#include <SDL2/SDL.h>
#include "../gui/surface.h"
typedef uint32_t ColorT;
typedef struct SurfaceS {
uint16_t width;
uint16_t height;
size_t scanline;
size_t bytes;
union {
uint8_t *bits8;
uint16_t *bits16;
uint32_t *bits32;
} buffer;
} SurfaceT;
typedef struct EventS {
int32_t flags;
int32_t x;
@ -48,28 +35,10 @@ typedef struct EventS {
#define KEY_ESC 27
#define videoColorMake(r,g,b) (((r) << 24) | ((g) << 16) | ((b) << 8) | 255)
void platformEventGet(EventT *event);
void videoBlit(int16_t targetX, int16_t targetY, SurfaceT *source);
uint16_t videoDisplayHeightGet(void);
uint16_t videoDisplayWidthGet(void);
void videoSurfaceBlit(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source);
void videoSurfaceBlitWithTransparency(SurfaceT *target, int16_t targetX, int16_t targetY, SurfaceT *source, ColorT transparent);
void videoSurfaceClear(ColorT color);
SurfaceT *videoSurfaceCreate(int16_t width, int16_t height);
void videoSurfaceBox(int16_t x1, int16_t y1, int16_t x2, int16_t y2, ColorT c);
void videoSurfaceBoxFilled(int16_t x1, int16_t y1, int16_t x2, int16_t y2, ColorT c);
void videoSurfaceDestroy(SurfaceT *surface);
SurfaceT *videoSurfaceGet(void);
int16_t videoSurfaceHeightGet(SurfaceT *surface);
void videoSurfaceLineH(int16_t x1, int16_t x2, int16_t y, ColorT c);
void videoSurfaceLineV(int16_t x, int16_t y1, int16_t y2, ColorT c);
ColorT videoSurfacePixelGet(SurfaceT *surface, int16_t x, int16_t y);
void videoSurfacePixelSet(int16_t x, int16_t y, ColorT c);
void videoSurfaceSet(SurfaceT *surface);
SurfaceT *videoSurfaceScreenGet(void);
int16_t videoSurfaceWidthGet(SurfaceT *surface);
#endif // SDL2_H

View file

@ -1,261 +0,0 @@
### CONFIGURATION ########################################################
# This file sets variables that direct the libary build for the
# programmer needs. The file is used for the four standard plattforms
# Specify version of GRX
# Currently only used to generate name of shared libraries for linux
GRX_VERSION=2.4.9
# Specify if you have libtiff.a and corresponding .h files.
# Change setting to 'y' if you have it, or to 'n' if not.
HAVE_LIBTIFF=n
# Specify if you have libjpeg.a and corresponding .h files.
HAVE_LIBJPEG=y
# Specify if you have libpng.a and corresponding .h files.
HAVE_LIBPNG=y
# Specify if one of the above libs requires the
# zlib compression library
NEED_ZLIB=y
# Specify if you want to include printing code from addons
INCLUDE_PRINTING_CODE=n
# Specify if you want to include bmp image code from addons
INCLUDE_BMP_CODE=y
# Specify if you want to include GNU_Pascal (gpc) support
INCLUDE_GPC_SUPPORT=n
# Specify if you want shared library support (Linux console and X11)
INCLUDE_SHARED_SUPPORT=n
# Specify if you want to include BGI support
INCLUDE_BGI_SUPPORT=n
# For cross-compiling, specify prefix for tools including the trailing dash
# (e.g. i386-mingw32- for using i386-mingw32-gcc instead of just gcc)
#CROSS_PLATFORM=i586-pc-msdosdjgpp-
# Specify if you want to use Unix tools on DOS-like platforms
HAVE_UNIX_TOOLS=y
# Specify in linux if you want to build the library for x86_64
BUILD_X86_64=y
# For SDL driver the executable prefix EP is used to discriminate
# between linux X11 and mingw32. Set
#EP=x ... For linux X11.
#EP= ... For mingw32
EP=x
### SYSTEM SETTINGS ######################################################
CC = $(CROSS_PLATFORM)gcc
PC = $(CROSS_PLATFORM)gpc
AR = $(CROSS_PLATFORM)ar
RANLIB = $(CROSS_PLATFORM)ranlib
STRIP = $(CROSS_PLATFORM)strip
# Different systems / setups may generate .o files
# this tag files will show what version is present
SYSTEM_TAG_PREFIX = systag
LINUX_i386_CONSOLE = $(SYSTEM_TAG_PREFIX).000
LINUX_i386_X11 = $(SYSTEM_TAG_PREFIX).002
DOS_DJGPP_V2 = $(SYSTEM_TAG_PREFIX).004
WIN32_GCC_i386_STATIC = $(SYSTEM_TAG_PREFIX).006
ANY_GCC_SDL_STATIC = $(SYSTEM_TAG_PREFIX).008
ifdef DEBUG
CCOPT = -O2 -fno-strict-aliasing -Wall -g -DDEBUG=$(DEBUG) ${C_FLAGS}
LDOPT = -g ${L_FLAGS}
else
CCOPT = -O2 -fno-strict-aliasing -Wall ${C_FLAGS}
LDOPT = -s ${L_FLAGS}
endif
ifdef PROFILE
CCOPT += -pg
endif
# Additional warnings for development
WARNOPTS = -W -Wshadow -Wpointer-arith -Wbad-function-cast \
-Wcast-align -Wconversion -Wmissing-prototypes \
-Wnested-externs -Wstrict-prototypes
#CCOPT += $(WARNOPTS)
# Some systems can't allocate big arrays on stack.
# If test/xcirctest fails on bigger diameters, try
#CCOPT += -DSMALL_STACK
# You may want to enable one (or both) of the following
# switches if your get lots of warnings when compiling GRX
#CCOPT += -DNO_LEFTSIDE_LVALUE_CAST
#CCOPT += -DNO_LEFTSIDE_PTR_CAST
##########################################################################
ifdef GRXVSDL
ifeq ($(EP),x)
GRXVX11=y
else
GRXVW32=y
endif
endif
ifdef GRXVLNX
GRXVUNX=y
endif
ifdef GRXVX11
GRXVUNX=y
endif
### UNIX SPECIFIC ########################################################
ifdef GRXVUNX
# Put libgrx20.a, libgrx20.so, libgrx20X.a, libgrx20X.so and libgrx20S.a
# in lib/unix
GRX_LIB_SUBDIR=unix
# Set here the default destination dirs for install and uninstall targets
prefix=/usr/local
# Set the default GRX font path
#GRX_DEFAULT_FONT_PATH=${datadir}/grx/fonts
# check for i386 or x86_64 build
ifeq ($(BUILD_X86_64),y)
CCOPT += -m64
LDOPT += -m64
else
CCOPT += -m32
LDOPT += -m32
endif
endif
### LINUX CONSOLE SPECIFIC ###############################################
ifdef GRXVLNX
# Use direct PS/2 mouse driver instead the svgalib one
USE_DIRECT_MOUSE_DRIVER=n
# Set the videodrivers to be included, you can set both or only one of them
# (remember to set USE_DIRECT_MOUSE_DRIVER to 'y' if you set only the
# framebuffer driver)
USE_SVGALIB_DRIVER=y
USE_FRAMEBUFFER_DRIVER=y
# Set or not set suid root. This is required for the svgalib 1.4.x stable
# release, it can be set to 'n' if you use the framebuffer driver only or
# the svgalib 1.9.x alpha release without the 1 and 4 bpp resolutions
# (see bellow)
SET_SUIDROOT=y
# Set to 'y' this variable if you want to add the framedrivers that use
# inport/outport instructions: 1 and 4 bpp modes and the 8 bpp mode X. But
# beware this works only with svgalib 1.4.x (not with 1.9.x) and without
# the linux framebuffer enabled
USE_INOUTP_FRAMEDRIVERS=y
endif
### LINUX X11 SPECIFIC ###################################################
ifdef GRXVX11
# The X11 base dir on your system
X11BASE=/usr/X11R6
# Add directories with X11 include files here
X11INCS=-I$(X11BASE)/include
# put X11 required libraries and directories here
# note: some systems need -lsocket added
X11LIB=$(X11BASE)/lib
X11LIBS=-L$(X11LIB) -lX11
# Set to try to use the XFree86 Direct Graphics Access driver (DGA2)
# (if DGA2 is not available, fall back to the windowed X11 driver)
# As of XFree-4.3.99.5 DGA/DGA2 seems stable, but use with caution.
USE_XF86DGA_DRIVER=n
# Set to 'y' this variable if you want the DGA2 driver to use direct
# framebuffer access. That should not make DGA2 more unstable and is
# faster. If this setting is 'y', the DGA2 driver (see above) must
# also be 'y', or you will get compilation/linkage errors.
USE_XF86DGA_FRAMEBUFFER=n
# Set or not set suid root for X11. This is required for the DGA2
# framebuffer access, it can be set to 'n' if you use the standard
# X11 driver only or DGA2 without framebuffer access.
SET_XSUIDROOT=n
endif
### DOS DJGPPv2 SPECIFIC #################################################
ifdef GRXVDJ2
# Put libgrx20.a to lib/dj2
GRX_LIB_SUBDIR=dj2
# Set here the destination dir for install and uninstall targets
prefix=/dev/env/DJDIR
# Set the default GRX font path
#GRX_DEFAULT_FONT_PATH=/dev/env/DJDIR/share/grx/fonts
# If you want to use 'upx.exe' compressor
# disable the echo line and enable upx line.
EXE_COMPRESS = -echo
#EXE_COMPRESS = upx --best
# Default compiler switches. In djgpp.env. under [make],
# add the line "BUTT=-mcpu=i386", if that is your target,
# or directly add -mcpu here.
# At present gcc supports 'i386', 'i486', 'i586' ('pentium'),
# 'i686' ('pentiumpro') and 'k6'.
#CCOPT += $(BUTT)
#CCOPT += -mcpu=i586
# GRX uses "uclock" to gets 1 ms resolution in the input code,
# this can causes problems in Win3.1, so you may want to enable
# the following switch
#CCOPT += -DNO_REPROGRAM_TIMER
endif
### WIN32 MINGW SPECIFIC #################################################
ifdef GRXVW32
# Put libgrx20.a and libgrx20S.a to lib/win32
GRX_LIB_SUBDIR=win32
# Set here the destination dir for install and uninstall targets
prefix=C:\MINGW
# Set the default GRX font path
#GRX_DEFAULT_FONT_PATH=c:/grxfonts
endif
### COMMON ##############################################################
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
libdir=${exec_prefix}/lib
datadir=${prefix}/share
infodir=${prefix}/info
includedir=${prefix}/include
unitsdir=${exec_prefix}/units
##########################################################################

View file

@ -1 +0,0 @@
makefile.x11

View file

@ -1,669 +0,0 @@
/*
** <bmp.c> - BMP read/write file
** by Michal Stencl Copyright (c) 1998
** - read BMP 2, 4, 8 bpp
** - write BMP 8, 24 bpp
** <e-mail> - [stenclpmd@ba.telecom.sk]
**
*/
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#if defined(_MSC_VER) && defined(_WIN32)
#include <io.h>
#else
#include <unistd.h>
#endif
#include <fcntl.h>
#include <sys/stat.h>
#include <string.h>
#ifdef __MSDOS__
# include <io.h>
#endif
#include "libgrx.h"
#include "clipping.h"
#if defined(__MSDOS__) || defined(MSDOS)
#define BIN_WR (O_WRONLY | O_BINARY)
#define BIN_RD (O_RDONLY | O_BINARY)
#else
#define BIN_WR O_WRONLY
#define BIN_RD O_RDONLY
#endif
#define BIN_CREAT (BIN_WR|O_CREAT)
#ifndef S_IREAD
#define S_IREAD S_IRUSR
#endif
#ifndef S_IWRITE
#define S_IWRITE S_IWUSR
#endif
#define CREAT_PERM S_IREAD|S_IWRITE
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define BMPFILEHEADERSIZE 14
#define BMPINFOHEADERSIZE 40
#define BI_RGB 0L
#define BI_RLE8 1L
#define BI_RLE4 2L
#define _GrBitmapPointerTypes_DEFINED_
typedef struct _GR_bitmapfileheader GrBitmapFileHeader;
typedef struct _GR_bitmapinfoheader GrBitmapInfoHeader;
typedef struct _GR_bmpimagecolors GrBmpImageColors;
typedef struct _GR_bmpimage GrBmpImage;
/* ************************************************************************ */
/* _GR_bitmapfileheader */
/* ************************************************************************ */
struct _GR_bitmapfileheader {
GR_int16u bf_type;
GR_int32u bf_size;
GR_int16u bf_reserved1;
GR_int16u bf_reserved2;
GR_int32u bf_offbits;
};
/* ************************************************************************ */
/* _GR_bitmapinfoheader */
/* ************************************************************************ */
struct _GR_bitmapinfoheader {
GR_int32u bn_size;
GR_int32u bn_width;
GR_int32u bn_height;
GR_int16u bn_planes;
GR_int16u bn_bitcount;
GR_int32u bn_compression;
GR_int32u bn_sizeimage;
GR_int32u bn_xpelspermeter;
GR_int32u bn_ypelspermeter;
GR_int32u bn_clrused;
GR_int32u bn_clrimportant;
};
/* ************************************************************************ */
/* _GR_bmpimagecolors */
/* ************************************************************************ */
struct _GR_bmpimagecolors {
GR_int8u *bp_palette; /* (R, G, B, Reserved) * | 2 | 16 | 256 */
GrColor *bp_colormap;
int bp_numcolors;
};
/* ************************************************************************ */
/* _GR_bmpimage */
/* ************************************************************************ */
struct _GR_bmpimage {
GrBitmapFileHeader *bi_bmpfileheader;
GrBitmapInfoHeader *bi_bmpinfoheader;
GrBmpImageColors *bi_bmpimagecolors;
GR_int16s bi_erasepalette;
char *bi_map;
};
#define bi_width bi_bmpinfoheader->bn_width
#define bi_height bi_bmpinfoheader->bn_height
#define bi_palette bi_bmpimagecolors->bp_palette
#define bi_colormap bi_bmpimagecolors->bp_colormap
#define bi_numcolors bi_bmpimagecolors->bp_numcolors
int GrLoadBmpFileHeader ( int _handle, GrBitmapFileHeader* _fileheader );
int GrLoadBmpInfoHeader ( int _handle, GrBitmapInfoHeader* _infoheader );
static unsigned char *__GrLoadPaletteBmp ( int _handle, unsigned long _paloffset, int _colors );
static unsigned char *GrLoadPaletteBmp ( int _handle, int *_col, GrBitmapInfoHeader *_iheader );
static char *GrLoadImageFromBmpBiRgb ( int _handle, unsigned long _offset, long _maxbufsize, int _colors, GrBitmapInfoHeader *_infoheader );
static char *GrLoadImageFromBmpBiRle8 ( int _handle, unsigned long _offset, unsigned long _maxbufsize, int _colors, GrBitmapInfoHeader *_infoheader );
static char *GrLoadImageFromBmpBiRle4 ( int _handle, unsigned long _offset, unsigned long _maxbufsize, int _colors, GrBitmapInfoHeader *_infoheader );
static char *GrLoadImageFromBmp ( int _handle, unsigned long _offset, int _colors, GrBitmapInfoHeader *_infoheader );
/* exported functions */
int GrFreeBmpImageColors ( GrBmpImageColors *_pal );
int GrAllocBmpImageColors ( GrBmpImage *_bmp, GrBmpImageColors *_pal );
GrBmpImage *GrLoadBmpImage ( char *_filename );
GrPattern *GrConvertBmpImageToPattern ( GrBmpImage *_bmp );
GrPattern *GrConvertBmpImageToStaticPattern ( GrBmpImage *_bmp );
void GrUnloadBmpImage ( GrBmpImage *_bmp );
int GrSaveBmpImage ( char *_filename, GrContext *_c, int _x1, int _y1, int _x2, int _y2 );
unsigned long GrBmpImageWidth ( GrBmpImage* _bmp );
unsigned long GrBmpImageHeight ( GrBmpImage* _bmp );
char *GrBmpImagePalette ( GrBmpImage* _bmp );
GrColor *GrBmpImageColorMap ( GrBmpImage* _bmp );
GrColor GrBmpImageNumColors ( GrBmpImage* _bmp );
/* end of exported functions */
/* ************************************************************************ */
int GrLoadBmpFileHeader ( int _handle, GrBitmapFileHeader *_fileheader )
/* ************************************************************************ */
{
if (( !_fileheader ) || ( _handle == -1 )) return FALSE;
memset(_fileheader, 0, BMPFILEHEADERSIZE);
lseek(_handle, SEEK_SET, 0);
read(_handle, &_fileheader->bf_type, 2);
read(_handle, &_fileheader->bf_size, 4);
read(_handle, &_fileheader->bf_reserved1, 2);
read(_handle, &_fileheader->bf_reserved2, 2);
read(_handle, &_fileheader->bf_offbits, 4);
return TRUE;
}
/* ************************************************************************ */
int GrLoadBmpInfoHeader ( int _handle, GrBitmapInfoHeader *_infoheader )
/* ************************************************************************ */
{
if (( !_infoheader ) || ( _handle == -1 )) return FALSE;
lseek(_handle, SEEK_SET, BMPFILEHEADERSIZE);
_infoheader->bn_size = 0;
read(_handle, &_infoheader->bn_size, 4);
memset(_infoheader, 0, _infoheader->bn_size);
read(_handle, &_infoheader->bn_width, 4);
if ( _infoheader->bn_width % 4 )
_infoheader->bn_width += 4 - (_infoheader->bn_width % 4);
read(_handle, &_infoheader->bn_height, 4);
read(_handle, &_infoheader->bn_planes, 2);
read(_handle, &_infoheader->bn_bitcount, 2);
read(_handle, &_infoheader->bn_compression, 4);
read(_handle, &_infoheader->bn_sizeimage, 4);
read(_handle, &_infoheader->bn_xpelspermeter, 4);
read(_handle, &_infoheader->bn_ypelspermeter, 4);
read(_handle, &_infoheader->bn_clrused, 4);
read(_handle, &_infoheader->bn_clrimportant, 4);
return TRUE;
}
/* ************************************************************************ */
static unsigned char *__GrLoadPaletteBmp ( int _handle, unsigned long _paloffset, int _colors )
/* ************************************************************************ */
{
unsigned char *palette;
if ( _handle == -1 ) return NULL;
palette = (unsigned char*)malloc(_colors * 4);
if ( !palette ) return NULL;
lseek(_handle, SEEK_SET, _paloffset);
read(_handle, palette, _colors * 4);
return palette;
}
/* ************************************************************************ */
static unsigned char *GrLoadPaletteBmp ( int _handle, int *_col, GrBitmapInfoHeader* _iheader )
/* ************************************************************************ */
{
unsigned char *palette;
unsigned long paloffset;
*_col = -1;
if (( _handle == -1 ) || ( !_iheader )) return NULL;
palette = NULL;
paloffset = BMPFILEHEADERSIZE + _iheader->bn_size;
switch ( _iheader->bn_bitcount )
{
case 1 : { *_col = 2; palette = __GrLoadPaletteBmp(_handle, paloffset, 2); } break;
case 4 : { *_col = 16; palette = __GrLoadPaletteBmp(_handle, paloffset, 16); } break;
case 8 : { *_col = 256; palette = __GrLoadPaletteBmp(_handle, paloffset, 256); } break;
case 24 : { *_col = 0; palette = NULL; } break;
default : *_col = -1;
}
if (( !palette ) && ( *_col != 0 )) *_col = -1;
return palette;
}
/* ************************************************************************ */
static char *GrLoadImageFromBmpBiRgb ( int _handle, unsigned long _offset, long _maxbufsize, int _colors,
GrBitmapInfoHeader *_infoheader )
/* ************************************************************************ */
{
char *map = NULL;
char *buffer = NULL;
unsigned long width;
unsigned long size;
unsigned long i;
if (( _handle == -1 ) || ( !_infoheader ) || ( _infoheader->bn_bitcount < 1 ))
return NULL;
width = _infoheader->bn_width;
size = width;
i = size;
lseek(_handle, SEEK_SET, _offset);
if ( _infoheader->bn_bitcount == 1 )
{
unsigned char bits[8], n;
unsigned long w, bufsize;
int j, k;
char *runmap;
_maxbufsize = _maxbufsize * 8;
map = (char *)malloc(_maxbufsize);
bufsize = (unsigned long)ceil((float)width / 8);
buffer = (char *)malloc(bufsize);
runmap = NULL;
if ( !map || !buffer )
{
if (map) free(map);
if (buffer) free(buffer);
return NULL;
}
while ( i <= _maxbufsize )
{
read(_handle, buffer, bufsize);
runmap = &map[_maxbufsize - i];
for ( w = 0; w < width; w++)
{
j = w % 8;
if ( !j )
{
n = buffer[w / 8];
for ( k = 0; k < 8; k++ )
{
bits[7 - k] = n & 1;
n = n >> 1;
}
}
runmap[w] = bits[j];
}
i += size;
}
}
if ( _infoheader->bn_bitcount == 4 )
{
unsigned long bufsize;
char *runmap;
unsigned char bits[2], n;
unsigned long w;
int j, q;
_maxbufsize = _maxbufsize * 2;
map = (char *)malloc(_maxbufsize);
bufsize = (unsigned long)ceil((float)width / 2);
buffer = (char*)malloc(bufsize);
runmap = NULL;
if ( !map || !buffer )
{
if (map) free(map);
if (buffer) free(buffer);
return NULL;
}
while ( i <= _maxbufsize )
{
read(_handle, buffer, bufsize);
runmap = &map[_maxbufsize - i];
for ( w = 0; w < width; w++)
{
j = w % 2;
if ( !j )
{
n = buffer[w / 2];
q = n & 255;
bits[1] = q & 15;
q = q >> 4;
bits[0] = q & 15;
n = n >> 8;
}
runmap[w] = bits[j];
}
i += size;
}
}
if ( _infoheader->bn_bitcount == 8 )
{
unsigned long bufsize;
map = (char*)malloc(_maxbufsize);
bufsize = size;
if ( !map ) return NULL;
while ( i <= _maxbufsize )
{
read(_handle, &map[_maxbufsize - i], bufsize);
i += bufsize;
}
}
if ( _infoheader->bn_bitcount == 24 )
{
}
if (buffer) free(buffer);
return map;
}
/* ************************************************************************ */
static char *GrLoadImageFromBmpBiRle8 ( int _handle, unsigned long _offset, unsigned long _maxbufsize, int _colors,
GrBitmapInfoHeader *_infoheader )
/* ************************************************************************ */
{
return NULL; /* this version not contains Rle8 yet */
}
/* ************************************************************************ */
static char *GrLoadImageFromBmpBiRle4 ( int _handle, unsigned long _offset, unsigned long _maxbufsize, int _colors,
GrBitmapInfoHeader *_infoheader )
/* ************************************************************************ */
{
return NULL; /* this version not contains Rle4 yet */
}
/* ************************************************************************ */
static char *GrLoadImageFromBmp ( int _handle, unsigned long _offset, int _colors, GrBitmapInfoHeader *_infoheader )
/* ************************************************************************ */
{
char* map;
int maxbufsize;
if (( _handle == -1 ) || ( !_infoheader )) return NULL;
map = NULL;
maxbufsize = _infoheader->bn_sizeimage;
switch ( _infoheader->bn_compression ) {
case BI_RGB :
{
if ( !maxbufsize )
maxbufsize = _infoheader->bn_width * _infoheader->bn_height;
map = GrLoadImageFromBmpBiRgb(_handle, _offset, maxbufsize, _colors, _infoheader); break;
}
case BI_RLE8 :
map = GrLoadImageFromBmpBiRle8(_handle, _offset, maxbufsize, _colors, _infoheader); break;
case BI_RLE4 :
map = GrLoadImageFromBmpBiRle4(_handle, _offset, maxbufsize, _colors, _infoheader); break;
}
return map;
}
/*====++====================================================================*/
/* EXPORTED FUNCTIONS */
/*==++======================================================================*/
/* ************************************************************************ */
int GrFreeBmpImageColors ( GrBmpImageColors *_pal )
/* ************************************************************************ */
{
if (( !_pal ) || ( !_pal->bp_colormap )) return FALSE;
if ( _pal->bp_palette )
{
int i;
GrColor *colors = _pal->bp_colormap;
colors[0] = _pal->bp_numcolors;
for ( i = 0; i < _pal->bp_numcolors; i++ )
GrFreeColor(colors[i+1]);
free(_pal->bp_palette);
_pal->bp_palette = NULL;
_pal->bp_numcolors = 0;
return TRUE;
}
return FALSE;
}
/* ************************************************************************ */
int GrAllocBmpImageColors ( GrBmpImage *_bmp, GrBmpImageColors *_pal )
/* ************************************************************************ */
{
if (( !_bmp ) || ( _bmp->bi_colormap != NULL ) || (_bmp->bi_numcolors < 2 ))
return FALSE;
_bmp->bi_erasepalette = TRUE;
if ( _bmp->bi_palette )
{
int i;
GrColor *colors = malloc(sizeof(GrColor)*(_bmp->bi_numcolors+1));
if ( !colors ) return FALSE;
colors[0] = _bmp->bi_numcolors;
for ( i = 0; i < _bmp->bi_numcolors; i++ )
colors[i+1] = GrAllocColor(_bmp->bi_palette[i*4+2], _bmp->bi_palette[i*4+1], _bmp->bi_palette[i*4+0]);
_bmp->bi_colormap = colors;
if ( _pal )
{
_bmp->bi_erasepalette = FALSE;
memcpy(_pal,_bmp->bi_bmpimagecolors,sizeof(GrBmpImageColors));
_bmp->bi_palette = NULL;
_bmp->bi_numcolors = 0;
}
return TRUE;
}
return FALSE;
}
/* ************************************************************************ */
GrBmpImage *GrLoadBmpImage ( char *_filename )
/* ************************************************************************ */
{
#define defClose { \
close(handle); \
if (bmpimage) free(bmpimage); \
return NULL; \
}
#define ADD2PTR(p,o) ((void *) ((char *)(p)+(o)) )
int handle;
GrBmpImage *bmpimage = NULL;
if ( (handle = open(_filename, BIN_RD)) != -1 ) {
bmpimage = malloc( sizeof(GrBmpImage)
+sizeof(GrBitmapFileHeader)
+sizeof(GrBitmapInfoHeader)
+sizeof(GrBmpImageColors));
if ( !bmpimage ) defClose;
memset(bmpimage, 0, sizeof(GrBmpImage)
+sizeof(GrBitmapFileHeader)
+sizeof(GrBitmapInfoHeader)
+sizeof(GrBmpImageColors));
bmpimage->bi_bmpfileheader = ADD2PTR(bmpimage, sizeof(GrBmpImage));
bmpimage->bi_bmpinfoheader = ADD2PTR(bmpimage, sizeof(GrBmpImage)
+sizeof(GrBitmapFileHeader));
bmpimage->bi_bmpimagecolors = ADD2PTR(bmpimage, sizeof(GrBmpImage)
+sizeof(GrBitmapFileHeader)
+sizeof(GrBitmapInfoHeader));
bmpimage->bi_erasepalette = TRUE;
if ( !GrLoadBmpFileHeader(handle, bmpimage->bi_bmpfileheader) )
defClose;
if ( bmpimage->bi_bmpfileheader->bf_type != 19778 ) /* MAGIC NUMBER */
defClose;
if ( !GrLoadBmpInfoHeader(handle, bmpimage->bi_bmpinfoheader) )
defClose;
bmpimage->bi_palette = GrLoadPaletteBmp(handle, &(bmpimage->bi_numcolors), bmpimage->bi_bmpinfoheader);
if ( bmpimage->bi_numcolors == -1 )
defClose;
bmpimage->bi_map = GrLoadImageFromBmp(handle, bmpimage->bi_bmpfileheader->bf_offbits - BMPFILEHEADERSIZE, bmpimage->bi_numcolors, bmpimage->bi_bmpinfoheader);
if ( !bmpimage->bi_map )
defClose;
}
#undef defClose
return bmpimage;
}
/* ************************************************************************ */
GrPattern *GrConvertBmpImageToPattern ( GrBmpImage *_bmp )
/* ************************************************************************ */
{
if (( !_bmp ) || ( !_bmp->bi_map )) return NULL;
return GrBuildPixmap(_bmp->bi_map, _bmp->bi_width, _bmp->bi_height, _bmp->bi_colormap);
}
/* ************************************************************************ */
GrPattern *GrConvertBmpImageToStaticPattern ( GrBmpImage *_bmp )
/* ************************************************************************ */
{
GrPattern *p = NULL;
if ( _bmp && _bmp->bi_map )
{
p = GrBuildPixmap(_bmp->bi_map, _bmp->bi_width, _bmp->bi_height, _bmp->bi_colormap);
if ( p ) GrUnloadBmpImage(_bmp);
}
return p;
}
/* ************************************************************************ */
void GrUnloadBmpImage ( GrBmpImage *_bmp )
/* ************************************************************************ */
{
if ( !_bmp ) return;
if ( _bmp->bi_erasepalette )
GrFreeBmpImageColors(_bmp->bi_bmpimagecolors);
_bmp->bi_palette = NULL;
_bmp->bi_numcolors = 0;
if ( _bmp->bi_map ) free(_bmp->bi_map);
free(_bmp);
_bmp = NULL;
}
/* ************************************************************************ */
int GrSaveBmpImage ( char *_filename, GrContext *_c, int _x1, int _y1, int _x2, int _y2 )
/* ************************************************************************ */
{
int handle;
unsigned long width, height;
unsigned char palette[256*4];
int r, g, b;
char* line;
unsigned long yy, xx;
GrColor pixcol;
GrBitmapFileHeader fileheader;
GrBitmapInfoHeader infoheader;
GrColor colors, i;
GrContext safe;
if ( !_c ) _c = (GrContext *)GrCurrentContext();
/*
handle = creat(_filename, S_IWRITE);
if ( handle < 0 )
{
close(handle);
return FALSE;
}
*/
handle = open(_filename, BIN_CREAT, CREAT_PERM);
if ( handle < 0 ) return FALSE;
clip_box_(_c, _x1, _y1, _x2, _y2, CLIP_EMPTY_MACRO_ARG, CLIP_EMPTY_MACRO_ARG);
width = _x2 - _x1;
height = _y2 - _y1;
safe = *GrCurrentContext();
GrSetContext(_c);
colors = GrNumColors();
GrSetContext(&safe);
if ( width % 4 ) width += 4 - (width % 4);
/*========= FILEHEADER =========*/
fileheader.bf_type = 19778;
if ( colors == 256 )
fileheader.bf_size = BMPINFOHEADERSIZE + BMPFILEHEADERSIZE + 256*4 + width*height;
else
fileheader.bf_size = BMPINFOHEADERSIZE + BMPFILEHEADERSIZE + (width*height*3);
fileheader.bf_reserved1 = 0;
fileheader.bf_reserved2 = 0;
if ( colors == 256 )
fileheader.bf_offbits = BMPINFOHEADERSIZE + BMPFILEHEADERSIZE + 256*4;
else
fileheader.bf_offbits = BMPINFOHEADERSIZE + BMPFILEHEADERSIZE;
/*========= INFOHEADER =========*/
infoheader.bn_size = BMPINFOHEADERSIZE;
infoheader.bn_width = width;
infoheader.bn_height = height;
infoheader.bn_planes = 1;
infoheader.bn_bitcount = ( colors == 256 ) ? 8 : 24;
infoheader.bn_compression = BI_RGB;
infoheader.bn_sizeimage = width*height*(infoheader.bn_bitcount / 8);
infoheader.bn_xpelspermeter = 0L;
infoheader.bn_ypelspermeter = 0L;
infoheader.bn_clrused = 0L;
infoheader.bn_clrimportant = 0L;
/*========= PALETTE =========*/
if ( colors == 256 )
{
for ( i = 0; i < colors; i++ )
{
GrQueryColor(i, &r, &g, &b);
palette[(i*4)] = (unsigned char)b;
palette[(i*4)+1] = (unsigned char)g;
palette[(i*4)+2] = (unsigned char)r;
palette[(i*4)+3] = 0;
}
}
line = (char *)malloc(width*(infoheader.bn_bitcount / 8));
if ( !line )
{
close(handle);
return FALSE;
}
/*========= WRITE FILEHEADER =========*/
write(handle, &fileheader.bf_type, 2);
write(handle, &fileheader.bf_size, 4);
write(handle, &fileheader.bf_reserved1, 2);
write(handle, &fileheader.bf_reserved2, 2);
write(handle, &fileheader.bf_offbits, 4);
/*========= WRITE INFOHEADER =========*/
write(handle, &infoheader.bn_size, 4);
write(handle, &infoheader.bn_width, 4);
write(handle, &infoheader.bn_height, 4);
write(handle, &infoheader.bn_planes, 2);
write(handle, &infoheader.bn_bitcount, 2);
write(handle, &infoheader.bn_compression, 4);
write(handle, &infoheader.bn_sizeimage, 4);
write(handle, &infoheader.bn_xpelspermeter, 4);
write(handle, &infoheader.bn_ypelspermeter, 4);
write(handle, &infoheader.bn_clrused, 4);
write(handle, &infoheader.bn_clrimportant, 4);
/*========= WRITE PALETTE =========*/
if ( colors == 256 ) write(handle, palette, 256*4);
/*========= WRITE MAP =========*/
yy = height;
do {
xx = 0;
do {
pixcol = GrPixelC(_c,_x1+xx,_y1+yy);
if ( colors == 256 ) line[xx] = pixcol;
else
{
line[(xx*3)+0] = GrRGBcolorBlue(pixcol);
line[(xx*3)+1] = GrRGBcolorGreen(pixcol);;
line[(xx*3)+2] = GrRGBcolorRed(pixcol);;
}
} while(++xx < width);
write(handle, line, width*(infoheader.bn_bitcount / 8));
} while(--yy > 0);
free((void *)line);
close(handle);
return TRUE;
}
/* ************************************************************************ */
unsigned long GrBmpImageWidth ( GrBmpImage* _bmp )
/* ************************************************************************ */
{
return ( _bmp && _bmp->bi_bmpinfoheader ) ? _bmp->bi_width : 0L;
}
/* ************************************************************************ */
unsigned long GrBmpImageHeight ( GrBmpImage* _bmp )
/* ************************************************************************ */
{
return ( _bmp && _bmp->bi_bmpinfoheader ) ? _bmp->bi_height : 0L;
}
/* ************************************************************************ */
char *GrBmpImagePalette ( GrBmpImage* _bmp )
/* ************************************************************************ */
{
return (char *)(( _bmp && _bmp->bi_bmpimagecolors ) ? _bmp->bi_palette : NULL);
}
/* ************************************************************************ */
GrColor *GrBmpImageColorMap ( GrBmpImage* _bmp )
/* ************************************************************************ */
{
return ( _bmp && _bmp->bi_bmpimagecolors ) ? _bmp->bi_colormap : NULL;
}
/* ************************************************************************ */
GrColor GrGetBmpImageNumColors ( GrBmpImage* _bmp )
/* ************************************************************************ */
{
return ( _bmp && _bmp->bi_bmpimagecolors ) ? _bmp->bi_numcolors : 0;
}

View file

@ -1,190 +0,0 @@
==============================
o LOAD MS-WINDOWS BITMAP FILE
==============================
Syntax
------
GrBmpImage *GrLoadBmpImage ( char *_filename );
Description
-----------
This function load BMP file format ( 1, 4, 8 Bytes Per Pixel ) from
the file _filename into structure GrBmpImage*.
Return Value
------------
On succes pointer to new GrBmpImage structure, otherwise NULL
Example
-------
GrBmpImage* bmp = GrLoadBmpImage("logogrx.bmp");
==============================
o SETTING GrBmpImage COLORS
==============================
Syntax
------
int GrAllocBmpImageColors ( GrBmpImage *_bmp, GrBmpImageColors *_col );
Description
-----------
This function setting GrBmpImage colors. (_bmp) is pointer to GrBmpImage
structure and (_pal) is pointer to structrure, where we want to store
information about BMP palette and colors. If (_col) is NULL, it set colors and into
(_bmp) structure write 1 for own destroing palette by GrUnloadBmpImage.
Otherwise palette will be destroy only by function GrEraseBmpImageColors.
Return Value
------------
On succes 1, otherwise 0
Example 1 ( _col is NULL )
-------
GrBmpImage* bmp = GrLoadBmpImage("logogrx.bmp");
GrAllocBmpImageColors(bmp, NULL);
GrUnloadBmpImage(bmp);
Example 2 ( _col is pointer to structure )
-------
GrBmpImage* bmp = GrLoadBmpImage("logogrx.bmp");
GrBmpImageColors col;
GrAllocBmpImageColors(bmp, &col);
GrUnloadBmpImage(bmp);
GrFreeBmpImageColors(&pal);
==============================
o FREE GrBmpImage COLORS
==============================
Syntax
------
int GrFreeBmpImageColors ( GrBmpImageColors *_col );
Description
-----------
It destroy _col structure, free GrBmpImage Colors and set to NULL
Return Value
------------
On succes 1, otherwise 0
Example
-------
GrBmpImage* bmp = GrLoadBmpImage("logogrx.bmp");
GrBmpImageColors bmpcolors;
GrAllocBmpImageColors(bmp, &bmpcolors);
GrUnloadBmpImage(bmp);
GrFreeBmpImageColors(&bmpcolors);
===============================
o CONVERT GrBmpImage STRUCTURE
===============================
Syntax
------
GrPattern *GrConvertBmpImageToPattern ( GrBmpImage *_bmp );
Description
-----------
Make GrPattern structure from GrBmpImage pointer.
Return Value
------------
On succes pointer to new GrPattern structure, else NULL
Example
-------
GrPattern *bmppat;
GrBmpImage *bmp = GrLoadBmpImage("logogrx.bmp");
GrAllocBmpImageColors(bmp, NULL);
bmppat = GrConvertBmpImageToPattern(bmp);
if ( bmppat ) GrPatternFilledBox(0, 0, GrMaxX(), GrMaxY(), bmppat);
GrUnloadBmpImage(bmp);
if ( bmppat ) GrDestroyPattern(bmppat);
IN THE OTHER WAY
Syntax
------
GrPattern *GrConvertBmpImageToStaticPattern ( GrBmpImage *_bmp );
Description
-----------
Make GrPattern structure from GrBmpImage pointer, AND GrBmpImage (_bmp)
structure unload.
Return Value
------------
On succes pointer to new GrPattern structure, else NULL
Example
-------
GrPattern *bmppat;
GrBmpImage *bmp = GrLoadBmpImage("logogrx.bmp");
GrAllocBmpImageColors(bmp, NULL);
bmppat = GrConvertBmpImageToStaticPattern(bmp);
if ( bmppat ) GrPatternFilledBox(0, 0, GrMaxX(), GrMaxY(), bmppat);
if ( bmppat ) GrDestroyPattern(bmppat);
==============================
o UNLOAD GrBmpImage STRUCTURE
==============================
Syntax
------
int GrUnloadBmpImage ( GrBmpImage *_bmp );
Description
-----------
Free _bmp and BmpImage colors/palette (only if GrAllocBmpImagePalette
contains NULL in 2nd variable ).
Return Value
------------
On succes 1, else 0
Example
-------
GrBmpImage* bmp = GrLoadBmpImage("logogrx.bmp");
GrUnloadBmpImage(bmp);
=========================================
o SAVE CONTEXT TO MS-WINDOWS BITMAP FILE
=========================================
Syntax
------
int GrSaveBmpImage ( char *_filename, GrContext *_c, int _x1, int _y1,
int _x2, int _y2 );
Description
-----------
Save context from the position ( where _x1,_y1 is left uppon origin &&
_x2,_y2 right bottom origin)
to BMP ( 8 or 24 bpp file ). The BMP file will be set to 8 Bits Per Line,
when GrNumColors() in GRXxx.H is set to 256, otherwise it'll be set to
24 Bits Per Line.
If _context is set to NULL, _c will be pointer to current context
structure.
Return Value
------------
On succes 1, owtherwise 0
Example
-------
GrSaveBmpImage("logogrx.bmp", NULL, 100, 100, 400, 400);
=========================================
======= THE END =========================
=========================================
Michal Stencl
<e-mail> - [stenclpmd@ba.telecom.sk]

View file

@ -1,30 +0,0 @@
#include "grx20.h"
#include "bmp.c"
int main ( void )
{
GrBmpImage *bmp256, *bmp;
GrPattern *p256, *p;
GrSetMode(GR_width_height_color_graphics, 800, 600, 256);
bmp256 = GrLoadBmpImage("mysha256.bmp");
bmp = GrLoadBmpImage("some1.bmp");
GrAllocBmpImageColors(bmp, NULL);
GrAllocBmpImageColors(bmp256, NULL);
p256 = GrConvertBmpImageToPattern(bmp256);
p = GrConvertBmpImageToPattern(bmp);
if ( p ) {
GrImageDisplay(0, 0, GrImageFromPattern(p));
getkey();
}
if ( p256 ) {
GrImageDisplay(300, 300, GrImageFromPattern(p256));
getkey();
}
if ( p ) GrDestroyPattern(p);
if ( p256 ) GrDestroyPattern(p256);
GrSaveBmpImage("save.bmp", NULL, 0, 0, 400, 400);
GrUnloadBmpImage(bmp);
GrUnloadBmpImage(bmp256);
return 0;
};

View file

@ -1,78 +0,0 @@
/*
** <grxbmp.h> - BMP read/write file
** by Michal Stencl Copyright (c) 1998
** - read BMP 2, 4, 8 bpp
** - write BMP 8, 24 bpp
** <e-mail> - [stenclpmd@ba.telecom.sk]
**
*/
#include "libgrx.h"
#define _GrBitmapPointerTypes_DEFINED_
typedef struct _GR_bitmapfileheader GrBitmapFileHeader;
typedef struct _GR_bitmapinfoheader GrBitmapInfoHeader;
typedef struct _GR_bmpimagecolors GrBmpImageColors;
typedef struct _GR_bmpimage GrBmpImage;
/* ************************************************************************ */
/* _GR_bitmapfileheader */
/* ************************************************************************ */
struct _GR_bitmapfileheader {
GR_int16u bf_type;
GR_int32u bf_size;
GR_int16u bf_reserved1;
GR_int16u bf_reserved2;
GR_int32u bf_offbits;
};
/* ************************************************************************ */
/* _GR_bitmapinfoheader */
/* ************************************************************************ */
struct _GR_bitmapinfoheader {
GR_int32u bn_size;
GR_int32u bn_width;
GR_int32u bn_height;
GR_int16u bn_planes;
GR_int16u bn_bitcount;
GR_int32u bn_compression;
GR_int32u bn_sizeimage;
GR_int32u bn_xpelspermeter;
GR_int32u bn_ypelspermeter;
GR_int32u bn_clrused;
GR_int32u bn_clrimportant;
};
/* ************************************************************************ */
/* _GR_bmpimagecolors IMPORTANT */
/* ************************************************************************ */
struct _GR_bmpimagecolors {
GR_int8u *bp_palette; /* (R, G, B, Reserved) * | 2 | 16 | 256 */
GrColor *bp_colormap;
int bp_numcolors;
};
/* ************************************************************************ */
/* _GR_bmpimage IMPORTANT */
/* ************************************************************************ */
struct _GR_bmpimage {
GrBitmapFileHeader *bi_bmpfileheader;
GrBitmapInfoHeader *bi_bmpinfoheader;
GrBmpImageColors *bi_bmpimagecolors;
GR_int16s bi_erasepalette;
char *bi_map;
};
GrBmpImage *GrLoadBmpImage ( char *_filename );
int GrSaveBmpImage ( char *_filename, GrContext *_c, int _x1, int _y1, int _x2, int _y2 );
void GrUnloadBmpImage ( GrBmpImage *_bmp );
int GrAllocBmpImageColors ( GrBmpImage *_bmp, GrBmpImageColors *_pal );
int GrFreeBmpImageColors ( GrBmpImageColors *_pal );
GrPattern *GrConvertBmpImageToPattern ( GrBmpImage *_bmp );
GrPattern *GrConvertBmpImageToStaticPattern ( GrBmpImage *_bmp );
unsigned long GrBmpImageWidth ( GrBmpImage* _bmp );
unsigned long GrBmpImageHeight ( GrBmpImage* _bmp );
char *GrBmpImagePalette ( GrBmpImage* _bmp );
GrColor *GrBmpImageColorMap ( GrBmpImage* _bmp );
GrColor GrBmpImageNumColors ( GrBmpImage* _bmp );

View file

@ -1,210 +0,0 @@
/**
** CTX2TIFF.C ---- saves a context in a TIFF file
**
** Copyright (c) 1997 Hartmut Schirmer
**
** requires tifflib by Sam Leffler (sam@engr.sgi.com)
** available at ftp://ftp.sgi.com/graphics/tiff
**
** should work with every compiler supporting both,
** tifflib and GRX libraries
**/
#include <stdlib.h>
#include <grx20.h>
#include <tiffio.h>
#include <string.h>
#define SCALE(x) ((x)<<8)
#define puttobuf(r,x,depth,col) do { \
switch (depth) { \
case 1 : if (col) { \
int offset = (x) >> 3; \
int mask = 0x80 >> ((x) & 7); \
r[offset] |= mask; \
} \
break; \
case 8 : r[x] = (unsigned char)(col); break; \
case 24: r[3*(x)+0] = GrRGBcolorRed(col); \
r[3*(x)+1] = GrRGBcolorGreen(col); \
r[3*(x)+2] = GrRGBcolorBlue(col); \
break; \
} \
} while(0)
/*
** SaveContextToTiff - Dump a context in a TIFF file
**
** Arguments:
** ctx: Context to be saved (NULL -> use current context)
** tiffn: Name of tiff file
** compr: Compression method (see tiff.h), 0: automatic selection
** docn: string saved in the tiff file (DOCUMENTNAME tag)
**
** Returns 0 on success
** -1 on error
*/
int
SaveContextToTiff(GrContext *ctx, char *tiffn, unsigned compr, char *docn) {
int depth, i, res;
long row;
TIFF *tif;
long width, height, colors;
short photometric;
short samplesperpixel;
short bitspersample;
unsigned char *r;
unsigned short red[256], green[256], blue[256];
if (!ctx) ctx = (GrContext *)GrCurrentContext();
if (!ctx) return -1;
width = ctx->gc_xmax+1;
height = ctx->gc_ymax+1;
colors = GrNumColors();
if (colors < 2) return -1;
if (colors == 2) depth = 1; else
if (colors <= 256) depth = 8; else
if (colors <= 1L<<24) depth = 24; else return -1;
if (!compr) { /* compr == 0 -> auto select compression */
if (depth==1) compr = COMPRESSION_CCITTFAX4;
else compr = COMPRESSION_LZW;
}
switch (depth) {
case 1:
samplesperpixel = 1;
bitspersample = 1;
photometric = PHOTOMETRIC_MINISBLACK;
break;
case 8:
samplesperpixel = 1;
bitspersample = 8;
photometric = PHOTOMETRIC_PALETTE;
break;
case 24:
samplesperpixel = 3;
bitspersample = 8;
photometric = PHOTOMETRIC_RGB;
break;
default:
return -1; /* shouldn't happen */
}
r = (unsigned char *) malloc( depth>1 ?
samplesperpixel*width*sizeof(unsigned char) :
(width+7)/8);
if (!r) return -1;
tif = TIFFOpen(tiffn, "w");
if (tif == NULL) {
free(r);
return -1;
}
TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width);
TIFFSetField(tif, TIFFTAG_IMAGELENGTH, height);
TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bitspersample);
TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
TIFFSetField(tif, TIFFTAG_COMPRESSION, compr);
TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric);
if (docn)
TIFFSetField(tif, TIFFTAG_DOCUMENTNAME, docn);
TIFFSetField(tif, TIFFTAG_IMAGEDESCRIPTION, "GRX saved context");
TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, samplesperpixel);
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, height);
TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
memset(red, 0, sizeof(red));
memset(green, 0, sizeof(green));
memset(blue, 0, sizeof(blue));
if (depth == 8) {
for (i = 0; i < colors; i++) {
int r, g, b;
GrQueryColor(i, &r, &g, &b);
red[i] = SCALE(r);
green[i] = SCALE(g);
blue[i] = SCALE(b);
}
TIFFSetField(tif, TIFFTAG_COLORMAP, red, green, blue);
}
res = 0;
for (row = 0; row < height; row++) {
int x;
GrColor c;
#if GRX_VERSION_API-0 >= 0x229
const GrColor *rcb = GrGetScanlineC(ctx,0,width-1,row);
if (rcb) {
for (x=0; x < width; ++x) {
c = rcb[x];
puttobuf(r,x,depth,c);
}
} else
#endif
{
if (depth==1) memset (r,0,(width+7)/8);
for (x=0; x < width; ++x) {
c = GrPixelC(ctx,x,row);
puttobuf(r,x,depth,c);
}
}
if (TIFFWriteScanline(tif, r, row, 0) < 0) {
res = -1;
break;
}
}
TIFFFlushData(tif);
TIFFClose(tif);
free(r);
return res;
}
#ifdef TEST_CTX2TIFF
#include "../test/test.h"
TESTFUNC(wintest)
{
int x = GrSizeX();
int y = GrSizeY();
int ww = (x / 2) - 10;
int wh = (y / 2) - 10;
long c;
GrContext *w1 = GrCreateSubContext(5,5,ww+4,wh+4,NULL,NULL);
GrContext *w2 = GrCreateSubContext(15+ww,5,ww+ww+14,wh+4,NULL,NULL);
GrContext *w3 = GrCreateSubContext(5,15+wh,ww+4,wh+wh+14,NULL,NULL);
GrContext *w4 = GrCreateSubContext(15+ww,15+wh,ww+ww+14,wh+wh+14,NULL,NULL);
GrSetContext(w1);
c = GrAllocColor(200,100,100);
drawing(0,0,ww,wh,c,GrBlack());
c = GrAllocColor(100,50,50);
GrBox(0,0,ww-1,wh-1,c);
GrSetContext(w2);
c = GrAllocColor(100,200,200);
drawing(0,0,ww,wh,c,GrBlack());
c = GrAllocColor(50,100,100);
GrBox(0,0,ww-1,wh-1,c);
GrSetContext(w3);
c = GrAllocColor(200,200,0);
drawing(0,0,ww,wh,c,GrBlack());
c = GrAllocColor(100,100,0);
GrBox(0,0,ww-1,wh-1,c);
GrSetContext(w4);
c = GrAllocColor(0,100,200);
drawing(0,0,ww,wh,c,GrBlack());
c = GrAllocColor(255,0,100);
GrBox(0,0,ww-1,wh-1,c);
GrSetContext(NULL);
SaveContextToTiff(NULL, "test.tif", 0, "Context2TIFF test file");
getch();
}
#endif

View file

@ -1,64 +0,0 @@
[See below for an english version]
PRINTER.BGI
(C) Copyright 1990-1995 Ullrich von Bassewitz
Bedingungen fuer Nutzung und Weitergabe
Die Software (sowohl die Quellcodes, als auch die Binaries) werden
ohne jegliche Zusagen/Garantien bez<65>glich Funktionalit„t oder
Funktionsf„higkeit abgegeben. Weder die Autoren noch die Distributoren
<EFBFBD>bernehmen eine Verantwortung f<>r Sch„den, die durch die Benutzung der
Software verursacht werden.
Die Software darf frei verwendet und weitergegeben werden, wobei
"frei" ausdr<64>cklich auch eine kommerzielle Nutzung/Weitergabe
einschlieát, *vorausgesetzt* die folgenden Bedingungen werden
eingehalten:
1. Die Herkunft der Software muá - wenn <20>berhaupt - dann korrekt
angegeben werden. Es ist nicht erlaubt, die Software als Werk
eines anderen auszugeben. Wird die Software in Teilen oder als
Ganzes in einem Produkt benutzt, dann w<>rde ich mich <20>ber einen
Hinweis auf die Herkunft in der Dokumentation freuen. Ein solcher
Hinweis ist aber nicht zwingend notwendig.
2. Ge„nderte Quellcodes m<>ssen deutlich als solche gekennzeichnet
werden und d<>rfen nicht ohne einen expliziten Hinweis auf die
durchgef<65>hrten Žnderungen weiterverteilt werden.
3. Die Bedingungen <20>ber die Nutzung/Weitergabe d<>rfen nicht entfernt
oder ge„ndert werden.
-------------------------------------------------------------------------------
[Dasselbe auf englisch:]
PRINTER.BGI
(C) Copyright 1990-1995 Ullrich von Bassewitz
COPYING CONDITIONS
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution

File diff suppressed because it is too large Load diff

View file

@ -1,133 +0,0 @@
/****************************************************************************
**
** grxprint.h : Output of graphics on printer from GRX graphic library
** Version 0.5 (beta) 98/01/26 Andris Pavenis (pavenis@acad.latnet.lv)
**
** Version 0.6 98/03/03 A.Pavenis
** Renamed some procedures
**
** Version 0.66 98/05/07 H.Schirmer
** - made cpp # start on first column
**
** Version 0.67 98/05/10 H.Schirmer
** - eleminated C++ style comments for better portability
**
** Version 0.68 98/05/13 H.Schirmer
** - clean source for better portability / ANSI-C conformance
**
** This code is port of part of printer BGI driver
** (C) 1990-1995 Ullrich von Bassewitz (see copying.uz).
**
** Full version of printer BGI driver version 4.0 can be found
** at URL ftp://ftp.musoftware.com/pub/uz/
** An alternate URL is http://www.lanet.lv/~pavenis/printerbgi+src.zip
**
*****************************************************************************/
#ifndef __GRXPRINT_H
#define __GRXPRINT_H
enum __grxPrintModes
{
FX_240x72 = 0, /* EPSON FX (8-Nadel), 240 * 72 DPI */
FX_240x216 = 1, /* EPSON FX (8-Nadel), 240 * 216 DPI */
LQ_180x180 = 2, /* EPSON LQ (24-Nadel), 180 * 180 DPI */
LQ_360x180 = 3, /* EPSON LQ (24-Nadel), 360 * 180 DPI */
LQ_360x360 = 4, /* EPSON LQ (24-Nadel), 360 * 360 DPI */
P6_360x360 = 5, /* NEC P6, P6+, P60 (24-Nadel), 360 * 360 DPI (1) */
X24_180x180 = 6, /* IBM Proprinter X24 (24-Nadel), 180 * 180 DPI */
X24_360x180 = 7, /* IBM Proprinter X24 (24-Nadel), 360 * 180 DPI */
LQ_P6_180x180x9 = 8, /* EPSON LQ / NEC P6, P6+, 180 * 180 DPI, 9 Farben (6) */
LQ_P6_360x180x9 = 9, /* EPSON LQ / NEC P6, P6+, 360 * 180 DPI, 9 Farben (6) */
LQ_P6_360x360x9 = 10, /* EPSON LQ, 360 * 360 DPI, 9 Farben (6) */
P6_360x360x9 = 11, /* NEC P6, P6+, 360 * 360 DPI, 9 Farben (6) */
GRX_PRN_RESERVED_1 = 12, /* Reserviert */
GRX_PRN_USER1 = 13, /* Benutzerdefinierter Modus 1 (not implemented) (2) */
GRX_PRN_USER2 = 14, /* Benutzerdefinierter Modus 2 (not implemented) (2) */
GRX_PRN_USER3 = 15, /* Benutzerdefinierter Modus 3 (not implemented) (2) */
HPLJ_75x75 = 16, /* HP LJ, 75 * 75 DPI (3) */
HPLJ_100x100 = 17, /* HP LJ, 100 * 100 DPI (3) */
HPLJ_150x150 = 18, /* HP LJ, 150 * 150 DPI (3) */
HPLJ_300x300 = 19, /* HP LJ, 300 * 300 DPI (3) */
HPLJ_75x75_NC = 20, /* HP LJ, 75 * 75 DPI, keine Kompression (4) */
HPLJ_100x100_NC = 21, /* HP LJ, 100 * 100 DPI, keine Kompression (4) */
HPLJ_150x150_NC = 22, /* HP LJ, 150 * 150 DPI, keine Kompression (4) */
HPLJ_300x300_NC = 23, /* HP LJ, 300 * 300 DPI, keine Kompression (4) */
HPDJ500C_75x75x8 = 24, /* HP DJ 500C, 75 * 75 DPI, 8 Farben, A4 */
HPDJ500C_100x100x8 = 25, /* HP DJ 500C, 100 * 100 DPI, 8 Farben, A4 */
HPDJ500C_150x150x8 = 26, /* HP DJ 500C, 150 * 150 DPI, 8 Farben, A4 */
HPDJ500C_300x300x8 = 27, /* HP DJ 500C, 300 * 300 DPI, 8 Farben, A4 */
HPDJ500C_75x75x8_B = 28, /* HP DJ 550C, 75 * 75 DPI, 8 Farben, echtes Schwarz (7) */
HPDJ500C_100x100x8_B = 29, /* HP DJ 550C, 100 * 100 DPI, 8 Farben, echtes Schwarz (7) */
HPDJ500C_150x150x8_B = 30, /* HP DJ 550C, 150 * 150 DPI, 8 Farben, echtes Schwarz (7) */
HPDJ500C_300x300x8_B = 31, /* HP DJ 550C, 300 * 300 DPI, 8 Farben, echtes Schwarz (7) */
HPLJ_600x600 = 32, /* HP LJ IV, 600 * 600 DPI (5) */
LQ_180x180_A3 = 33, /* EPSON LQ (24-Nadel), 180 * 180 DPI, DIN A3 */
LQ_360x180_A3 = 34, /* EPSON LQ (24-Nadel), 360 * 180 DPI, DIN A3 */
LQ_360x360_A3 = 35, /* EPSON LQ (24-Nadel), 360 * 360 DPI, DIN A3 */
P7_360x360_A3 = 36, /* NEC P7 (24-Nadel), 360 * 360 DPI, DIN A3 (1) */
LQ_180x180x9_A3 = 37, /* EPSON LQ (24-Nadel), 180 * 180 DPI, DIN A3, 9 Farben (6) */
LQ_360x180x9_A3 = 38, /* EPSON LQ (24-Nadel), 360 * 180 DPI, DIN A3, 9 Farben (6) */
LQ_360x360x9_A3 = 39, /* EPSON LQ (24-Nadel), 360 * 360 DPI, DIN A3, 9 Farben (6) */
P7_360x360x9_A3 = 40, /* NEC P7 (24-Nadel), 360 * 360 DPI, DIN A3, 9 Farben (1) (6) */
HPDJ1200C150 = 41, /* Deskjet 1200C, 256 Farben */
HPLJ_1200x1200 = 42 /* HP LJ4000, 1200 * 1200 DPI (5) */
};
#ifdef __cplusplus
extern "C" {
#endif
int GrPrintSetMode (int mode);
int GrPrintToFile (const char * DestFile);
int GrDoPrinting (void);
void GrPrintGetAspectRatio ( unsigned * x , unsigned * y );
/******************************************************************************/
/* Setting and quering some printer settings. These procedures */
/* are usufull only with LaserJet or DeskJet printers */
/******************************************************************************/
struct GrPrintOptionsType
{
short Quality; /* see enum __GrPrintQuality */
short Shingling; /* 0* - normal */
/* 1 - 25% (2 pass) */
/* 2 - 50% (4 pass) */
short Depletion; /* 0 - none */
/* 1* - 25% */
/* 2 - 50% */
short MediaType; /* 0* - plain paper */
/* 1 - bond paper */
/* 2 - special paper */
/* 3 - glossy film */
/* 4 - transparency film */
};
void GrPrintGetDefaultOptions ( struct GrPrintOptionsType * opt );
void GrPrintGetCurrentOptions ( struct GrPrintOptionsType * opt );
void GrPrintSetOptions ( struct GrPrintOptionsType * opt );
#ifdef __cplusplus
};
#endif
#endif

Binary file not shown.

View file

@ -1,109 +0,0 @@
PRINTING FROM GRX GRAPHIC LIBRARY
Version 0.7
Andris Pavenis
e-mail: pavenis@lanet.lv
26 June 1998
This directory contains procedures that allows printing graphics
from GRX graphic library. The source of this package is based on
sources of printer BGI driver for Borland C and Pascal compilers
developed by Ullrich von Bassevitz (see copying.uz).
Printing from GRX is tested under MS-DOS with DJGPP and under Linux.
There is no plans to allow use it from MS-DOS real mode with Borland C++
as the memory available to program is insufficient to allocate memory
area necessary to build image in memory.
int GrPrintSetMode (int mode)
Initializes GRX with "memory only" driver with necessary image size to print
the page. See grxprint.h for available modes.
int GrDoPrinting (void)
Outputs the image built with GRX functions after call to GrSetPrintMode to
printer. In MS-DOS the output is done to file 'prn'. In Linux the output
is written through pipe to lpr.
int GrPrintToFile (const char * fName)
The same as GrDoPrinting but the output is written to requested file. For Linux
there is one more option: if filename begins with '|', the remaining part of
name is interpretted as command for popen() (it is GrPrintToFile("|lpr") is
the equivalent with GrDoPrinting).
int GrPrintGetAspectRatio ( unsigned * aspx , unsigned * aspy )
Returns aspect ratio for image on printer. For example
unsigned AspX, AspY;
double Asp;
int MaxX, MaxY;
MaxX = GrSizeX ();
MaxY = GrSizeY ();
GrPrintGetAspectRatio (&AspX,&AspY);
Asp = ((double) AspX)/AspY;
GrEllipse (MaxX/2-100,MaxY/2,(int) (r*Asp), (int) r, 1);
will draw circle (see test.cc)
void GrPrintGetDefaultOptions ( struct GrPrintOptionsType * opt )
void GrPrintGetCurrentOptions ( struct GrPrintOptionsType * opt )
void GrPrintSetOptions ( struct GrPrintOptionsType * opt )
Allows to retrieve printing options. Works for LaserJet and DeskJet
printers. Does nothing for dot matrix printers.
------------------------ ChangeLog -----------------------------
98/05/13 H.Schirmer
- clean source for better portability / ANSI-C conformance
98/05/10 H.Schirmer
- eleminated C++ style comments for better portability
7 May 1998 H.Schirmer
- made cpp # start on first column
9 March 1998 Andris Pavenis
- Version changed to 0.65
- Changed procedure GrPrintToFile(). Now under Linux the output is
written to pipe if the name begins with '|'
3 March 1998 Andris Pavenis
- Fixed problem when printing directly to printer (DJGPP version).
The opened file was opened in text mode (old bug in libc, it is told
to be fixed, but the workaround mentioned for that worked OK so
I didn't study it more).
- Get rid of most of warnings that appears with -Wall
26 February 1998 Andris Pavenis
- Version changed to 0.6
- Many bugfixes. The first tests appeared to be incomplete.
Therefore a mirrored image were printed before. FIXED
24 February 1998 Andris Pavenis
- Changed names of functions: GrDoPrinting() to GrPrintToFile()
- A new function added to print to PRN under MS-DOS and
to pipe output to lpr under Linux
18 February 1998 Andris Pavenis
- Fixes to allow to work under Linux (still printing to file only)
26 January 1998 Andris Pavenis
- Initial version. Only some preliminary tests were done so this
version still were very buggy.

View file

@ -1,221 +0,0 @@
/*****************************************************************************/
/* */
/* grxprn00.h : Output of graphics on printer from GRX graphic library */
/* Version 0.5 (beta) 98/01/26 Andris Pavenis (pavenis@acad.latnet.lv) */
/* */
/* Version 0.66 98/05/07 H.Schirmer */
/* - made cpp # start on first column */
/* */
/* Version 0.68 98/05/13 H.Schirmer */
/* - clean source for better portability / ANSI-C conformance */
/* */
/* Version 0.7 98/05/20 A.Pavenis */
/* - removed definitions of procedures internal to grxprint.c */
/* (they are now declared static inside grxprint.c) */
/* */
/* This code is port of part of printer BGI driver */
/* (C) 1990-1995 Ullrich von Bassewitz (see copying.uz). */
/* */
/* Full version of printer BGI driver version 4.0 can be found */
/* at URL ftp://ftp.musoftware.com/pub/uz/ */
/* An alternate URL is http://www.lanet.lv/~pavenis/printerbgi+src.zip */
/* */
/*****************************************************************************/
#ifndef __GRXPRN00_H
#define __GRXPRN00_H
#include <setjmp.h>
#ifndef __GRX20_H_INCLUDED__
#include <grx20.h>
#endif
/* */
/* Datentyp BOOLEAN */
/* */
typedef unsigned char BOOLEAN;
#define TRUE 1
#define OK TRUE
#define FALSE 0
/* */
/* Diverse andere Datentypen mit festen Bit-Groessen */
/* */
/*
>>>>> These types should be mapped to the GRX internal types GR_int..u <<<<<
*/
typedef unsigned int WORD;
typedef unsigned char BYTE;
typedef unsigned long DWORD;
/****************************************************************************/
/* */
/* Macros */
/* */
/****************************************************************************/
/* NULL Macro */
#ifndef NULL
#define NULL 0
#endif
/* Die Farbtabelle wird (da nicht verwendet) als Moeglichkeit zur Einstellung*/
/* von diversen Daten von aussen benutzt. Sie heisst daher nicht ColorTable */
/* (wie im SVGA-Treiber), sondern Settings (fuer die aktuelle Tabelle) und */
/* DefaultSettings (fuer die Default-Einstellungen). */
/* Defines zum Zugriff auf die Elemente von Settings und DefaultSettings */
#define djDefQuality (DefaultSettings.Quality)
#define djDefShingling (DefaultSettings.Shingling)
#define djDefDepletion (DefaultSettings.Depletion)
#define djDefMediaType (DefaultSettings.MediaType)
#define djQuality (Settings.Quality)
#define djShingling (Settings.Shingling)
#define djDepletion (Settings.Depletion)
#define djMediaType (Settings.MediaType)
/* RGB Palette. */
struct RGBEntry {
BYTE R, G, B;
};
/****************************************************************************/
/* Konstante fuer das Flags Byte von _DST */
/****************************************************************************/
#define pfIsEpson 0x01 /* Epson-Modus */
/* Nadeldrucker-Flags */
#define pfReverse 0x02 /* Nadelnummerierung umdrehen (EPSON) */
/* Deskjet-Flags */
#define pfSeparateBlack 0x02 /* Separate Schwarz-Plane (Deskjet) */
#define pfDoCompression 0x04 /* TIFF Pacbits Kompression durchfuehren */
#define pfHasPalette 0x08 /* RGB Palette ja/nein */
/* Anzahl Druckermodi */
#define MaxModes 43
/****************************************************************************/
/* Grund-Deskriptor fuer einen Druckermodus */
/****************************************************************************/
/* Die folgende struct enthaelt die Grund-Werte bzw. Funktionen, die sich */
/* nie aendern. Jeder Treiber kann spezielle Funktionen am Ende hinzufuegen.*/
struct _DST {
WORD XDPI; /* Aufloesung in X-Richtung*/
WORD YDPI; /* Aufloesung in Y-Richtung*/
WORD XInch; /* Groesse X in Inch * 1000*/
WORD YInch; /* Groesse Y in Inch * 1000*/
WORD ColorCount; /* Anzahl Farben des Modus*/
BYTE ColorBits; /* Anzahl Bit in denen ein Pixel codiert ist */
BYTE Flags; /* Diverse bitmapped Flags */
char *Name; /* Name des Modes */
void (*Print) ( struct _DST * , int );
/*void (*Print) (); *//* Druck-Routine */
/* Member functions, die obige Flags auswerten, alle inline! */
/*BOOLEAN IsEpson () const { return Flags & pfIsEpson; } */
/*BOOLEAN Reverse () const { return Flags & pfReverse; } */
/*BOOLEAN SeparateBlack () const { return Flags & pfSeparateBlack; } */
/*BOOLEAN DoCompression () const { return Flags & pfDoCompression; } */
/*BOOLEAN HasPalette () const { return Flags & pfHasPalette; } */
};
#define IsEpson(x) (x->Flags & pfIsEpson)
#define Reverse(x) (x->Flags & pfReverse)
#define hasSeparateBlack(x) (x->Flags & pfSeparateBlack)
#define DoCompression(x) (x->Flags & pfDoCompression)
#define HasPalette(x) (x->Flags & pfHasPalette)
/* Der Zeiger auf die aktuelle DST*/
/* extern struct _DST *DSTPtr; */
/* Die Tabelle mit den Zeigern auf die Modi*/
extern struct _DST *DSTTable [MaxModes];
/* Groesse des Ausgabepuffers*/
#define PrintBufSize 1024
/*****************************************************************************/
/* Dot matrix printers related procedures */
/*****************************************************************************/
/* */
/* Die folgende Struktur enthaelt einen Device-Status-Block. Die ersten */
/* Werte muessen immer dieselben sein, da sie vom Grafik-Modul so erwartet */
/* werden. Im Anschluss kommen eigene Variablen, die von Drucker zu Drucker */
/* bzw. besser von Treiber zu Treiber verschieden sein koennen. */
/* */
/*****************************************************************************/
struct EpsonDST {
struct _DST DST; /* Orginal-DST */
BYTE ColBytes; /* Anzahl Bytes / Druckerspalte */
BYTE PassCount; /* Wie oft ueberdrucken */
char *LineFeed1; /* Normaler Linefeed */
char *LineFeed2; /* Linefeed zwischen Ueberdrucken */
char *GraphicsOn; /* Grafik einschalten (mit Init) */
char *GraphicsOff; /* Grafik ausschalten */
char *PreBytes; /* String vor Grafik-Daten */
char *PostBytes; /* String nach Grafik-Daten */
};
/****************************************************************************/
/* */
/* Universelle Ausgaberoutine fuer Nadeldrucker. */
/* */
/* Parameter: */
/* (keine) */
/* */
/* Ergebnisse: */
/* (keine) bzw. hoffentlich ein Ausdruck... */
/* */
/****************************************************************************/
void EpsonPrint ( struct _DST * DSTPtr , int PRNHandle );
/* Universelle Drucker-Routine fuer Nadeldrucker */
/****************************************************************************/
/* Laser and DeskJet printers related procedures */
/****************************************************************************/
/* */
/* Die folgende Struktur enthaelt fuer den LaserJet angepassten Device- */
/* Status Block. */
/* */
/****************************************************************************/
struct LJDST {
struct _DST DST; /* Orginal-DST */
char *GraphicsOn; /* Grafik einschalten (mit Init) */
};
void LaserPrint ( struct _DST * DSTPtr , int PRNHandle );
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,78 +0,0 @@
#include <string.h>
#include <grx20.h>
#include <stdio.h>
#include "grxprint.h"
static void displaytext (GrFont *font,char *text,int len);
int GRXMain (int argc , char * argv [])
{
int i, j, rc, mc, MaxX, MaxY;
unsigned AspX, AspY;
double Asp, r;
char * text = "Printing example from GRX";
GrFont * Fnt = GrBuildConvertedFont(
&GrDefaultFont,
(GR_FONTCVT_SKIPCHARS | GR_FONTCVT_RESIZE),
36,
72,
' ',
'z'
);
/* rc = GrPrintSetMode (LQ_180x180); mc = 2; */
/* rc = GrPrintSetMode (HPLJ_300x300); mc = 2; */
/* rc = GrPrintSetMode (HPLJ_1200x1200); mc = 2; */
/* rc = GrPrintSetMode (HPLJ_IV_600x600); mc = 2; */
/* rc = GrPrintSetMode (HPLJ_300x300_NC); mc = 2; */
rc = GrPrintSetMode (HPDJ500C_300x300x8_B); mc = 8;
printf ("GrPrintSetMode : rc=%d\n",rc);
MaxX = GrMaxX ();
MaxY = GrMaxY ();
GrPrintGetAspectRatio (&AspX,&AspY);
Asp = ((double) AspX)/AspY;
printf ("Size : (%d %d)\n",MaxX,MaxY);
GrBox (0,0,MaxX,MaxY,mc-1); /* Draw box around page */
GrLine (0,MaxY,MaxX,MaxY-30,mc-1);
r = (int) (MaxY/20);
GrEllipse ((int) (r*Asp), (int) r, (int) (r*Asp), (int) r, mc-1);
displaytext (Fnt,text,strlen(text));
if (mc>2) for (i=0; i<8; i++)
{
int x0 = 50*i;
GrFilledBox (x0,1,x0+30,31,i);
}
for (i=1; i<14; i++)
{
r = (double) (MaxY*(0.45-0.03*i));
for (j=0; j<(mc>2 ? 3 : 1); j++)
{
GrEllipse (MaxX/2-100,MaxY/2,
(int) (r*Asp), (int) r, i>=mc ? mc-1 : i);
r--;
}
}
GrPrintToFile ("test.pcl");
/* GrDoPrinting (); */
return 0;
}
void displaytext (GrFont *font,char *text,int len)
{
GrTextOption opt;
memset(&opt,0,sizeof(opt));
opt.txo_font = font;
opt.txo_xalign = GR_ALIGN_LEFT;
opt.txo_yalign = GR_ALIGN_TOP;
opt.txo_direct = GR_TEXT_RIGHT;
opt.txo_fgcolor.v = 1;
opt.txo_bgcolor.v = 0;
GrDrawString(text,len,100,100,&opt);
}

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -1,45 +0,0 @@
Printing from GRX
This is source of beta version of printing procedures for GRX.
These procedures are based on sources of printer BGI drivers
for Borland C++ and Pascal compilers. This BGI driver was
developed by Ullrich von Bassevitz (see copying.uz).
Only part of sources of printer BGI driver are used. I didn't port
drawing functions from BGI driver as they are already implemented in GRX.
I took only printing part which is now rather heavily modified to get
rid of Borland C++ specific features (e.g. inline assembler).
Current version is tested with DJGPP and Linux versions of GRX only.
I didn't even try to compile it with Borland C++ for real mode as
I think it is useless due to lack of memory needed for buffer where
to create image. To print from GRX under Linux one should install
printer filter that allows to send PCL output to printer.
Only some modes are tested:
Epson LQ printer : 180x180 dpi
LaserJet 4L : 300x300 dpi (with and without compression)
I also tried DeskJet 500C mode (300x300 dpi with separate black)
on DeskJet 690C and it worked.
Printing code is linked into executable only when it is really required.
Currently it's included as addon to GRX.
-------------------- Files -------------------------------------------
grxprint.c - main sources of printing code
grxprint.h - interface definitions for user
prndata.c - printer definitions
grxprn00.h - definitions used internally by grxprint only
printest.c - test example
copying.uz - original copyright notice from Ullrich von Bassevitz
printer.doc - original docs on printer BGI driver
------------------------------------------------------------------------
NOTE: Ullrich von Bassevitz is no more maintaining printer BGI driver.
Addresses mentioned in printer.doc are NO MORE USABLE
Andris Pavenis
e-mail: pavenis@latnet.lv

View file

@ -1,47 +0,0 @@
Das Paket enthaelt die komplette Distribution meines PRINTER BGI-Treibers mit
allen Quellen.
Bitte beachten:
* Fuer die Uebersetzung der Quellen wird Borland C++ in der Version
3.1 benoetigt.
* Die Adressen und Telefonnumern, die in README.TXT genannt sind, sind
nicht mehr gueltig.
* Ich will keine Anrufe, Briefe oder Mails bezueglich des Treibers
bekommen. Ich mache nichts mehr mit dem Treiber, und o.g. Dinge
stehlen mir nur meine Zeit. Eine Ausnahme mache ich nur, wenn mir
die anfallende Zeit bezahlt wird.
* Fuer die Quellen gilt folgendes Copyright:
Die Software (sowohl die Quellcodes, als auch die Binaries) werden
ohne jegliche Zusagen/Garantien bez<65>glich Funktionalit„t oder
Funktionsf„higkeit abgegeben. Weder die Autoren noch die Distributoren
<EFBFBD>bernehmen eine Verantwortung f<>r Sch„den, die durch die Benutzung der
Software verursacht werden.
Die Software darf frei verwendet und weitergegeben werden, wobei
"frei" ausdr<64>cklich auch eine kommerzielle Nutzung/Weitergabe
einschlieát, *vorausgesetzt* die folgenden Bedingungen werden
eingehalten:
1. Die Herkunft der Software muá - wenn <20>berhaupt - dann korrekt
angegeben werden. Es ist nicht erlaubt, die Software als Werk
eines anderen auszugeben. Wird die Software in Teilen oder als
Ganzes in einem Produkt benutzt, dann w<>rde ich mich <20>ber einen
Hinweis auf die Herkunft in der Dokumentation freuen. Ein solcher
Hinweis ist aber nicht zwingend notwendig.
2. Ge„nderte Quellcodes m<>ssen deutlich als solche gekennzeichnet
werden und d<>rfen nicht ohne einen expliziten Hinweis auf die
durchgef<65>hrten Žnderungen weiterverteilt werden.
3. Die Bedingungen <20>ber die Nutzung/Weitergabe d<>rfen nicht entfernt
oder ge„ndert werden.

View file

@ -1,32 +0,0 @@
rem We are not distributing Borland BGI fonts with GRX.
rem To add them to the library put .CHR files in this
rem directory (where this script is located) and run it
rem after building GRX
rem This file is for Borland C.
if "%1"=="" addfonts bold euro goth lcom litt sans scri simp trip tscr
del *.obj
del addfonts.rsp
bcc -O -ml -ebin2c.exe ..\src\utilprog\bin2c.c
:proc
if not exist %1.chr goto next
echo Processing %1.chr
bin2c %1.chr _%1_font %1.c
bcc -c -O -ml %1.c
echo +%1.obj & >> addfonts.rsp
del %1.c
:next
shift
if not "%1"=="" goto proc
:done
echo , >> addfonts.rsp
tlib ..\lib\bcc\grx20l.lib @addfonts.rsp
del *.obj
del addfonts.rsp
del ..\lib\bcc\grx20l.bak

View file

@ -1,21 +0,0 @@
#! /bin/sh
#
# We are not distributing Borland BGI fonts with GRX.
# To add them to the library put .CHR files in this
# directory (where this script is located) and run it
# after building GRX
#
rm -f *.o
gcc -O2 ../src/utilprog/bin2c.c -o bin2c.exe
for x in *.chr; do
echo "Processing $x ...";
name=`basename $x | sed -e 's,\.chr,,g'`
./bin2c $x _${name}_font $name.c
gcc -c -O2 $name.c
rm $name.c
done
ar rc ../lib/dj2/libgrx20.a *.o
ranlib ../lib/dj2/libgrx20.a
rm -f *.o

View file

@ -1,21 +0,0 @@
#! /bin/sh
#
# We are not distributing Borland BGI fonts with GRX.
# To add them to the library put .CHR files in this
# directory (where this script is located) and run it
# after building GRX
#
rm -f *.o
gcc -O2 ../src/utilprog/bin2c.c -o bin2c
for x in *.chr; do
echo "Processing $x ...";
name=`basename $x | sed -e 's,\.chr,,g'`
./bin2c $x _${name}_font $name.c
gcc -c -O2 $name.c
rm $name.c
done
ar rc ../lib/unix/libgrx20X.a *.o
ranlib ../lib/unix/libgrx20X.a
rm -f *.o

View file

@ -1,64 +0,0 @@
/**
** grx.h ---- GRX 2.0 -> 1.0x backward compatibility declarations
**
** Copyright (c) 1995 Csaba Biegl, 820 Stirrup Dr, Nashville, TN 37221
** [e-mail: csaba@vuse.vanderbilt.edu]
**
** This file is part of the GRX graphics library.
**
** The GRX graphics library is free software; you can redistribute it
** and/or modify it under some conditions; see the "copying.grx" file
** for details.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**
**/
#ifndef __GRX_H_INCLUDED__
#define __GRX_H_INCLUDED__
#ifndef __GRX20_H_INCLUDED__
#include "grx20.h"
#endif
/*
* old style context creation
*/
static char far *_context_memory_[4] = { 0 };
#ifdef GrCreateContext
#undef GrCreateContext
#endif
#define GrCreateContext(w,h,mem,where) ( \
_context_memory_[0] = (char far *)(mem), \
GrCreateFrameContext( \
GrCoreFrameMode(), \
(w),(h), \
(((GrCurrentFrameDriver()->num_planes == 1) && _context_memory_[0]) ? \
_context_memory_ : \
(char far **)0 \
), \
(where) \
) \
)
/*
* drawing stuff
*/
#define GR_MAX_POLY_VERTICES GR_MAX_POLYGON_POINTS
#define GrCircleArc(x,y,r,s,e,c) (GrCircleArc)((x),(y),(r),(s),(e),GR_ARC_STYLE_OPEN,(c))
#define GrEllipseArc(x,y,w,h,s,e,c) (GrEllipseArc)((x),(y),(w),(h),(s),(e),GR_ARC_STYLE_OPEN,(c))
#define GrFilledCircleArc(x,y,r,s,e,c) (GrFilledCircleArc)((x),(y),(r),(s),(e),GR_ARC_STYLE_CLOSE2,(c))
#define GrFilledEllipseArc(x,y,w,h,s,e,c) (GrFilledEllipseArc)((x),(y),(w),(h),(s),(e),GR_ARC_STYLE_CLOSE2,(c))
#define GrGetLastArcCoords GrLastArcCoords
/*
* text stuff
*/
#define GrLoadBIOSFont GrLoadFont /* I don't know whether this is a good idea */
#define GrFontWidth(opt) ((opt)->txo_font->h.width)
#define GrFontHeight(opt) ((opt)->txo_font->h.height)
#endif /* whole file */

View file

@ -1,88 +0,0 @@
/**
** mousex.h ---- GRX 2.0 -> 1.0x mouse backward compatibility declarations
**
** Copyright (c) 1995 Csaba Biegl, 820 Stirrup Dr, Nashville, TN 37221
** [e-mail: csaba@vuse.vanderbilt.edu]
**
** This file is part of the GRX graphics library.
**
** The GRX graphics library is free software; you can redistribute it
** and/or modify it under some conditions; see the "copying.grx" file
** for details.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**
**/
#ifndef __MOUSEX_H_INCLUDED__
#define __MOUSEX_H_INCLUDED__
#ifndef __GRX20_H_INCLUDED__
#include "grx20.h"
#endif
#ifndef M_MOTION /* "eventque.h" also defines these */
#define M_MOTION GR_M_MOTION
#define M_LEFT_DOWN GR_M_LEFT_DOWN
#define M_LEFT_UP GR_M_LEFT_UP
#define M_RIGHT_DOWN GR_M_RIGHT_DOWN
#define M_RIGHT_UP GR_M_RIGHT_UP
#define M_MIDDLE_DOWN GR_M_MIDDLE_DOWN
#define M_MIDDLE_UP GR_M_MIDDLE_UP
#define M_BUTTON_DOWN GR_M_BUTTON_DOWN
#define M_BUTTON_UP GR_M_BUTTON_UP
#define M_BUTTON_CHANGE GR_M_BUTTON_CHANGE
#define M_LEFT GR_M_LEFT
#define M_RIGHT GR_M_RIGHT
#define M_MIDDLE GR_M_MIDDLE
#endif /* M_MOTION */
#define M_KEYPRESS GR_M_KEYPRESS
#define M_POLL GR_M_POLL
#define M_NOPAINT GR_M_NOPAINT
#define M_EVENT GR_M_EVENT
#ifndef KB_SHIFT /* "eventque.h" also defines these */
#define KB_RIGHTSHIFT GR_KB_RIGHTSHIFT
#define KB_LEFTSHIFT GR_KB_LEFTSHIFT
#define KB_CTRL GR_KB_CTRL
#define KB_ALT GR_KB_ALT
#define KB_SCROLLOCK GR_KB_SCROLLOCK
#define KB_NUMLOCK GR_KB_NUMLOCK
#define KB_CAPSLOCK GR_KB_CAPSLOCK
#define KB_INSERT GR_KB_INSERT
#define KB_SHIFT GR_KB_SHIFT
#endif /* KB_SHIFT */
#define M_CUR_NORMAL GR_M_CUR_NORMAL
#define M_CUR_RUBBER GR_M_CUR_RUBBER
#define M_CUR_LINE GR_M_CUR_LINE
#define M_CUR_BOX GR_M_CUR_BOX
#define MouseEvent GrMouseEvent
#define MouseDetect GrMouseDetect
#define MouseEventMode GrMouseEventMode
#define MouseInit GrMouseInit
#define MouseUnInit GrMouseUnInit
#define MouseSetSpeed(s) GrMouseSetSpeed(1,s)
#define MouseSetAccel GrMouseSetAccel
#define MouseSetLimits GrMouseSetLimits
#define MouseGetLimits GrMouseGetLimits
#define MouseWarp GrMouseWarp
#define MouseEventEnable GrMouseEventEnable
#define MouseGetEvent GrMouseGetEvent
#define MousePendingEvent GrMousePendingEvent
#define MouseGetCursor GrMouseGetCursor
#define MouseSetCursor GrMouseSetCursor
#define MouseSetColors GrMouseSetColors
#define MouseSetCursorMode GrMouseSetCursorMode
#define MouseDisplayCursor GrMouseDisplayCursor
#define MouseEraseCursor GrMouseEraseCursor
#define MouseBlock GrMouseBlock
#define MouseUnBlock GrMouseUnBlock
#define MouseCursorIsDisplayed GrMouseCursorIsDisplayed
#endif /* whole file */

View file

@ -1,403 +0,0 @@
#!/bin/sh
# Configure script for GRX
#
# NOTE: This script is completely OPTIONAL. If you don't know what
# to do with it, just ignore it and follow the normal install
# instructions.
#
# Copyright (C) 2001-2002,2004 Frank Heckenbach <frank@pascal.gnu.de>
# Peter Gerwinski <peter@gerwinski.de>
#
# Parts copied from some version of GCC's configure script,
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
silent=n
default_prefix=/usr/local
prefix=$default_prefix
exec_prefix='${prefix}'
bindir='${exec_prefix}/bin'
datadir='${prefix}/share'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
infodir='${prefix}/info'
# "Detect" default target (wrong for cross-compiling)
if [ x"$COMSPEC" != x ]; then
default_target=DJGPP
else
default_target=x11
fi
target=$default_target
default_fontpath='${datadir}/grx/fonts'
fontpath=""
default_x11base=/usr/X11R6
x11base="$default_x11base"
default_x11lib='$(X11BASE)/lib'
x11lib="$default_x11lib"
default_unitspath='${exec_prefix}/units'
unitspath="$default_unitspath"
HAVE_LIBJPEG=n
HAVE_LIBPNG=n
NEED_ZLIB=n
HAVE_LIBTIFF=n
# if you are able to run this script you have (ba)sh
# we suppose you have other needed unix tools as well
HAVE_UNIX_TOOLS=y
INCLUDE_BMP_CODE=y
INCLUDE_PRINTING_CODE=y
INCLUDE_GPC_SUPPORT=n
INCLUDE_SHARED_SUPPORT=y
INCLUDE_BGI_SUPPORT=y
USE_DIRECT_MOUSE_DRIVER=n
USE_SVGALIB_DRIVER=y
USE_FRAMEBUFFER_DRIVER=y
SET_SUIDROOT=y
USE_INOUTP_FRAMEDRIVERS=y
BUILD_X86_64=n
lsocket=""
subst_EP=""
ac_prev=
for ac_option do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval "$ac_prev=\$ac_option"
ac_prev=
continue
fi
case "$ac_option" in
-*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'`;;
*) ac_optarg=;;
esac
case "$ac_option" in
-s | --silent | --silen | --sile | --sil | --si | --s)
silent=y;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix="$ac_optarg";;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix=$ac_optarg ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir=$ac_optarg ;;
-datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
| --da=*)
datadir=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target="$ac_optarg";;
# Don't complain about unknown enable, disable, with and without options
-enable-* | --enable-* | -en-* | --en-*)
case "`echo "$ac_option" | sed -e 's/^-*enable-//;s/^-*en-//'`" in
x86_64) BUILD_X86_64=y;;
jpeg) HAVE_LIBJPEG=y;;
png) HAVE_LIBPNG=y;;
z | zlib) NEED_ZLIB=y;;
png-z) HAVE_LIBPNG=y; NEED_ZLIB=y;;
tiff) HAVE_LIBTIFF=y;;
bmp) INCLUDE_BMP_CODE=y;;
print) INCLUDE_PRINTING_CODE=y;;
pascal | gpc) INCLUDE_GPC_SUPPORT=y;;
shared) INCLUDE_SHARED_SUPPORT=y;;
bgi) INCLUDE_BGI_SUPPORT=y;;
direct-mouse) USE_DIRECT_MOUSE_DRIVER=y;;
svgalib) USE_SVGALIB_DRIVER=y;;
framebuffer) USE_FRAMEBUFFER_DRIVER=y;;
suidroot) SET_SUIDROOT=y;;
io-framedrivers) USE_INOUTP_FRAMEDRIVERS=y;;
lsocket) lsocket=" -lsocket";;
esac;;
-disable-* | --disable-* | -di-* | --di-*)
case "`echo "$ac_option" | sed -e 's/^-*disable-//;s/^-*di-//'`" in
x86_64) BUILD_X86_64=n;;
jpeg) HAVE_LIBJPEG=n;;
png) HAVE_LIBPNG=n;;
z | zlib) NEED_ZLIB=n;;
png-z) HAVE_LIBPNG=n; NEED_ZLIB=n;;
tiff) HAVE_LIBTIFF=n;;
bmp) INCLUDE_BMP_CODE=n;;
print) INCLUDE_PRINTING_CODE=n;;
pascal | gpc) INCLUDE_GPC_SUPPORT=n;;
shared) INCLUDE_SHARED_SUPPORT=n;;
bgi) INCLUDE_BGI_SUPPORT=n;;
direct-mouse) USE_DIRECT_MOUSE_DRIVER=n;;
svgalib) USE_SVGALIB_DRIVER=n;;
framebuffer) USE_FRAMEBUFFER_DRIVER=n;;
suidroot) SET_SUIDROOT=n;;
io-framedrivers) USE_INOUTP_FRAMEDRIVERS=n;;
lsocket) lsocket="";;
esac;;
-with-* | --with-*)
case "`echo "$ac_option" | sed -e 's/^-*with-//'`" in
fontpath=*) fontpath="$ac_optarg";;
fontpath) fontpath="$default_fontpath";;
x11-base=*) x11base="$ac_optarg";;
x11-base) echo "$0: \`--with-x11-base' requires an argument" >&2; exit 1;;
x11-lib=*) x11lib="$ac_optarg";;
x11-base) echo "$0: \`--with-x11-lib' requires an argument" >&2; exit 1;;
unitspath=*) unitspath="$ac_optarg";;
unitspath) echo "$0: \`--with-unitspath' requires an argument" >&2; exit 1;;
esac;;
-without-* | --without-*)
case "`echo "$ac_option" | sed -e 's/^-*without-//'`" in
fontpath) fontpath="";;
esac;;
-h | -help | --help | --hel | --he)
cat << EOF
Usage: $0 [options]
Options: [defaults in brackets after descriptions]
--help print this message and exit
--version print version information and exit
--silent silent operation
--prefix=PREFIX install architecture-independent files in PREFIX
[$default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
--bindir=DIR user executables [EPREFIX/bin]
--datadir=DIR read-only architecture-independent data
[PREFIX/share]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--infodir=DIR info documentation [PREFIX/info]
--target=TARGET configure for TARGET [$default_target]
possible values: djgpp,x11,console,w32,sdlx,sdlw
or GCC-style ("i386-mingw32") for cross-compiling
--enable-x86_64 build for x86_64 architecture [no]
--enable-jpeg include JPEG support [no]
--enable-png include PNG support [no]
--enable-zlib use zlib [no]
--enable-png-z include PNG support and use zlib [no]
--enable-tiff include TIFF support [no]
--enable-bmp include BMP support [yes]
--enable-print include printing code [yes]
--enable-pascal or include Pascal support [no]
--enable-gpc
--enable-shared build shared libraries [yes]
--enable-bgi include BGI support [yes]
--enable-lsocket link lsocket [no]
--disable-FOO opposite of --enable-FOO
--with-fontpath=PATH set GRX font path to PATH
--with-fontpath set GRX font path to $default_fontpath
--without-fontpath use no GRX font path [default]
--with-x11-base=DIR use DIR as X11 base directory [$default_x11base]
--with-x11-lib=DIR use DIR as X11 lib directory [$default_x11lib]
--with-unitspath=PATH set GPC units path to PATH [$default_unitspath]
The following options apply to the Linux console (not X11) target only:
--enable-direct-mouse use PS/2 instead of svgalib mouse driver [no]
--enable-svgalib use svgalib driver [yes]
--enable-framebuffer use framebuffer driver [yes]
--enable-suidroot create suid root executables (required with svgalib
1.4.x) [yes]
--enable-io-framedrivers use frame drivers that require suid root
executables under newer versions of svgalib [yes]
Some options can be abbreviated, e.g. \`--p' for \`--prefix',
\`--en-FOO' for \`--enable-FOO' and \`--di-FOO' for \`--disable-FOO'.
NOTE: This script is completely OPTIONAL. If you don't know what to do with it,
just ignore it and follow the normal install instructions.
EOF
exit 0;;
-v | -version | --version | --versio | --versi | --vers)
echo "Optional GRX configure script"
exit 0;;
*) { echo "$0: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
;;
esac
done
case "`echo "$target" | tr A-Z a-z`" in
*djgpp*) cfgsection=GRXVDJ2; target_makefile=makefile.dj2;;
x | x11) cfgsection=GRXVX11; target_makefile=makefile.x11;;
console) cfgsection=GRXVLNX; target_makefile=makefile.lnx;;
*w32 | *mingw*) cfgsection=GRXVW32; target_makefile=makefile.w32;;
sdlx) cfgsection=GRXVX11; target_makefile=makefile.sdl; subst_EP="/^EP=/s/=.*/=x/";;
sdlw) cfgsection=GRXVW32; target_makefile=makefile.sdl; subst_EP="/^EP=/s/=.*/=/";;
*) echo "$0: invalid target" >&2; exit 1;;
esac
case "$target" in
*[A-Za-z0-9]-[A-Za-z0-9]*|mingw32)
CROSS_PLATFORM="`echo "$target" | tr A-Z a-z`-"
exec_prefix="$prefix/$target";;
*)
CROSS_PLATFORM=""
exec_prefix='${prefix}';;
esac
if [ $USE_SVGALIB_DRIVER != y ] && [ $USE_FRAMEBUFFER_DRIVER != y ]; then
echo "$0: either \`--enable-svgalib' or \`--enable-framebuffer' must be set" >&2
exit 1
fi
if [ $USE_SVGALIB_DRIVER != y ] && [ $USE_DIRECT_MOUSE_DRIVER != y ]; then
echo "$0: if \`--disable-svgalib' is unset then \`--enable-direct-mouse' must be set" >&2
exit 1
fi
if [ -r Makefile ]; then
if cmp Makefile makefile.lnx > /dev/null 2>&1 ||
cmp Makefile makefile.dj2 > /dev/null 2>&1 ||
cmp Makefile makefile.w32 > /dev/null 2>&1 ||
cmp Makefile makefile.x11 > /dev/null 2>&1 ||
cmp Makefile makefile.sdl > /dev/null 2>&1; then
rm -f Makefile
else
echo "$0: Makefile exists already. Not overwriting!" >&2
exit 1
fi
fi
if [ ! -r "$target_makefile" ]; then
echo "$0: $target_makefile not found (please run in source directory)" >&2
exit 1
fi
# On DJGPP, `ln -s' creates `makefile.exe', so copy in this case
{ ln -s "$target_makefile" Makefile && [ -r Makefile ]; } ||
{ rm -f makefile.exe; cp "$target_makefile" Makefile; }
[ $silent = y ] || echo "Created Makefile"
cfgfile="makedefs.grx"
cfgorigfile="makedefs.orig"
if [ ! -r "$cfgfile" ]; then
echo "$0: $cfgfile not found" >&2
exit 1
fi
if [ ! -r "$cfgorigfile" ]; then
cp "$cfgfile" "$cfgorigfile"
fi
if [ x"$fontpath" = x ]; then
subst_fontpath="/^#*GRX_DEFAULT_FONT_PATH=/s/^#*/#/"
else
subst_fontpath="/^#*GRX_DEFAULT_FONT_PATH=/{s/^#*//;s|=.*|=$fontpath|;}"
fi
if [ "$cfgsection" = GRXVLNX ] || [ "$cfgsection" = GRXVX11 ]; then
extra_unix="/^ifdef GRXVUNX\$/,/^endif\$/{/^prefix=/s|=.*|=$prefix|;$subst_fontpath;}"
else
extra_unix=
fi
if sed -e "/^BUILD_X86_64=/s/=.*/=$BUILD_X86_64/;
$subst_EP;
/^HAVE_LIBTIFF=/s/=.*/=$HAVE_LIBTIFF/;
/^HAVE_LIBJPEG=/s/=.*/=$HAVE_LIBJPEG/;
/^HAVE_LIBPNG=/s/=.*/=$HAVE_LIBPNG/;
/^HAVE_UNIX_TOOLS=/s/=.*/=$HAVE_UNIX_TOOLS/;
/^NEED_ZLIB=/s/=.*/=$NEED_ZLIB/;
/^INCLUDE_PRINTING_CODE=/s/=.*/=$INCLUDE_PRINTING_CODE/;
/^INCLUDE_BMP_CODE=/s/=.*/=$INCLUDE_BMP_CODE/;
/^INCLUDE_GPC_SUPPORT=/s/=.*/=$INCLUDE_GPC_SUPPORT/;
/^INCLUDE_SHARED_SUPPORT=/s/=.*/=$INCLUDE_SHARED_SUPPORT/;
/^INCLUDE_BGI_SUPPORT=/s/=.*/=$INCLUDE_BGI_SUPPORT/;
/^CROSS_PLATFORM=/s/=.*/=$CROSS_PLATFORM/;
/^USE_DIRECT_MOUSE_DRIVER=/s/=.*/=$USE_DIRECT_MOUSE_DRIVER/;
/^USE_SVGALIB_DRIVER=/s/=.*/=$USE_SVGALIB_DRIVER/;
/^USE_FRAMEBUFFER_DRIVER=/s/=.*/=$USE_FRAMEBUFFER_DRIVER/;
/^SET_SUIDROOT=/s/=.*/=$SET_SUIDROOT/;
/^USE_INOUTP_FRAMEDRIVERS=/s/=.*/=$USE_INOUTP_FRAMEDRIVERS/;
/^exec_prefix=/s|=.*|=$exec_prefix|;
/^bindir=/s|=.*|=$bindir|;
/^libdir=/s|=.*|=$libdir|;
/^datadir=/s|=.*|=$datadir|;
/^includedir=/s|=.*|=$includedir|;
/^unitsdir=/s|=.*|=$unitspath|;
/^infodir=/s|=.*|=$infodir|;
$extra_unix;
/^ifdef $cfgsection\$/,/^endif\$/{
/^prefix=/s|=.*|=$prefix|;
$subst_fontpath;
/^X11BASE=/s|=.*|=$x11base|;
/^X11LIB=/s|=.*|=$x11lib|;
/^X11LIBS=/s/\$/$lsocket/;
}" "$cfgorigfile" > "$cfgfile"; then
[ $silent = y ] || echo "Modified $cfgfile"
else
cp -f "$cfgorigfile" "$cfgfile"
exit 1
fi
if [ x"$INCLUDE_GPC_SUPPORT" = x"y" ]; then
for file in pascal/grx.pas pascal/bgi/graph.pas; do
if [ ! -r "$file" ]; then
echo "$0: $file not found" >&2
exit 1
fi
if sed -e "s/{.*\\\$define LINUX_CONSOLE}/{`if [ x"$target" != x"console" ]; then echo .; fi`\$define LINUX_CONSOLE}/;
s/{.*\\\$define SVGALIB}/{`if [ x"$target" != x"console" -o $USE_SVGALIB_DRIVER != y ]; then echo .; fi`\$define SVGALIB}/;
s/{.*\\\$define __SDL__}/{`if [ x"$target" != x"sdlx" -a x"$target" != x"sdlw" ]; then echo .; fi`\$define __SDL__}/;
s/{.*\\\$L socket}/{`if [ x"$lsocket" = x ]; then echo .; fi`\$L socket}/
" "$file" > "$file.new" &&
sed -e "s/{.*\\\$L tiff}/{`if [ $HAVE_LIBTIFF != y ]; then echo .; fi`\$L tiff}/;
s/{.*\\\$L jpeg}/{`if [ $HAVE_LIBJPEG != y ]; then echo .; fi`\$L jpeg}/;
s/{.*\\\$L png}/{`if [ $HAVE_LIBPNG != y ]; then echo .; fi`\$L png}/;
s/{.*\\\$L z}/{`if [ $NEED_ZLIB != y ]; then echo .; fi`\$L z}/;
" "$file.new" > "$file" &&
rm -f "$file.new" ; then
[ $silent = y ] || echo "Modified $file"
else
rm -f "$file.new"
exit 1
fi
done
fi

View file

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View file

@ -1,53 +0,0 @@
This is file "copying.grx".
This document describes the terms for distributing the source code of and any
derived work based on the GRX graphics library. Such source code is marked
with the next text:
** Copyright (c) [year] [author], [author information]
**
** This file is part of the GRX graphics library.
**
** The GRX graphics library is free software; you can redistribute it
** and/or modify it under some conditions; see the "copying.grx" file
** for details.
Source code with the above copyright is distributed under the following terms:
(1) The test programs for the graphics library (code in the 'test'
sub-directory) is distributed without restrictions. This code
is free for use in commercial, shareware or freeware applications.
(2) The GRX graphics library is distributed under the terms of the
GNU LGPL (Library General Public License) with the following amendments
and/or exceptions:
- Using the DOS versions (DOS only! this exception DOES NOT apply to
the Linux version) you are permitted to distribute an application
linked with GRX in binary only, provided that the documentation
of the program:
a) informs the user that GRX is used in the program, AND
b) provides the user with the necessary information about
how to obtain GRX. (i.e. ftp site, etc..)
(3) Fonts (in the 'fonts' sub-directory). Most of the fonts included with
the GRX library were derived from fonts in the MIT X11R4 distribution.
They are distributed according to the terms in the file "COPYING.MIT"
(X license). Exceptions are:
- The fonts "ter-114b.res", "ter-114n.fna" and "ter-114v.psf" are
Copyright (C) 2002 Dimitar Zhekov, but are distributed under the
X license too.
- The "pc" BIOS font family, which is distributed without restrictions.
A copy of the GNU GPL (in the file "COPYING") and the GNU LGPL (in
the file "COPYING.LIB") is included with this document. If you did
not receive a copy of "COPYING" or "COPYING.LIB", you may obtain one
from where this document was obtained, or by writing to:
Free Software Foundation
675 Mass Ave
Cambridge, MA 02139
USA

View file

@ -1,481 +0,0 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View file

@ -1,96 +0,0 @@
Software in this distribution of the X Window System is covered by copyrights;
see the file LABELS in this directory for a list.
The MIT distribution of the X Window System is publicly available, but is NOT
in the public domain. The difference is that copyrights granting rights for
unrestricted use and redistribution have been placed on all of the software to
identify its authors. You are allowed and encouraged to take this software and
build commerical products.
Individuals or organizations wishing to contribute software to the public
releases should use a copyright notice that is no more restrictive than
the sample given below. In particular,
o Do not place any restictions on what can be done with this software
(this includes using the GNU "copyleft").
o Do not include the words "All rights reserved" unless you have had a
lawyer verify that you have also explicitly given away all of the
necessary rights shown in the samples.
o Spell out the word "Copyright"; the phrase "(c)" is NOT a legal
alternative to the c-in-circle symbol.
o Put at least a one-line copyright at the top of EVERY source file, if
not the full copyright. Also, the copyright line or full notice MUST
physically appear in each file. Using the preprocessor to #include the
copyright from some other file has no legal meaning (it can be used to
incorporate common strings into the binary, but has no effect on the
status of the source code).
o Things that are copyrighted are, by definition, not in the public
domain.
A copyright notice similar to the following is strongly recommended (replacing
MIT with your organization's name and putting your name and address at the
bottom).
/*
* Copyright 1989 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Your Name, Name of your organization
*/
X Window System, Version 11
Release 4
contents copyrighted by
Massachusetts Institute of Technology
Adobe Systems, Inc.
Apollo Computer Inc.
Apple Computer, Inc.
AT&T, Inc.
Don Bennett
Bigelow & Holmes
Bitstream, Inc.
Adam de Boor
Cognition Corp.
Digital Equipment Corporation
Evans & Sutherland Computer Corporation
Franz Inc
Hewlett-Packard Company
IBM Corporation
Network Computing Devices, Inc.
O'Reilly and Associates, Inc.
Dale Schumacher
Marvin Solomon
Sony Corp.
SRI
Sun Microsystems, Inc.
Tektronix, Inc.
Texas Instruments Incorporated
UniSoft Systems
The Regents of the University of California
University of Wisconsin
Larry Wall
Wyse Technology, Inc.

View file

@ -1,116 +0,0 @@
******* 2.3 --> 2.3.4
- BCC2GRX is now part of the GRX graphics library.
******* 2.0 --> 2.3
- will use the floodfill() from GRX 2.25 or newer
- Linux: can be compiled as shared library (make SHARED=1 in src/)
- made all functions direct linkable (mostly for GPC support)
- Pascal (GPC) support by Sven Hilscher included
- updated for grx21 (patterns & custom lines)
- No more warnings using LIBBCC.H in C++ programs
******* 1.3 --> 2.0
- new copyright terms, see readme
- compiles with both grx v2.0 and v1.03
- text.c splitted
- added setactivepage(), setvisualpage() and helper func's
set_BGI_mode_pages(int p), get_BGI_mode_pages(),
getactivepage() and getvisualpage() (functional only with
grx v2.0 or newer)
- __gr_Y_page_offs disabled if compiled for grx 1.0x
- restrict RGB values in setrgbpalette() to 0..63
- added extended graphics modes from BC++ 4.5
- few experimental custom line hacks for grx 2.0 (lnestyle.c)
- more work on Makefiles, make in src or test subdir works
- Due to limited stack space with DJGPP v2, complete rewrite
of floodfill() to avoid deep recursions.
- DJGPP: libbcc2.a will work on v1 and v2 systems with grx10, no need
to keep libbccx.a any longer.
- Link test: create dummy executable using all library objects. Nice to
check grx20fix.h settings.
- Optimized makefiles and configuration
- getdrivername() will report GRX driver name with GRX2
- LINUX: saved some getpixel() calls for floodfill() under X11. Remains slow :-(
- LINUX: No need to keep a seperate X11 directory any longer, binaries
are just linked with -lgrx20X -X11 instead of -lgrx20 -lvga
- LINUX: Enhanced Linux support (svgalib && X11)
- rewrote bgi font loading
- libbcc.h won't include GRX stuff any more
- rewrote floodfill(): Will use it's own dumb monochrome
context to keep track of drawn points. Uses less memory but
seems to be a little slower in few cases.
- moved _ega_color, setrgbdefaults() and setrgbgray256() from libbcc?.a
to src/addons.a
- added four new functions getmodemaxcolor(), getmodemaxx(), getmodemaxy()
and setrgbcolor().
- added version check __BCC2GRX__ (equals to 0x21a for v2.1 alpha,
0x20b -> v2.0 beta, 0x230 -> v2.3 offical release, ...)
******* 1.2 --> 1.3 (1.3 didn't made it to public)
- Vector fonts may be plotted using the actual line style.
calling textlinestyle(1) enables and textlinestyle(0) disables
this feature.
- corrected getmodename() TrueColor definition, name of actual
graphics mode valid now, will display 32K/64K/16M instead of
huge numbers
- CGA/MCGA/ATT400 will be emulated by 16 color modes
- EGA64HI sets 16 color mode on non EGA cards
- named source files in a more functional way
- circle() will use GrCircle() in "round" cases
- graphdefaults(), setgraphmode() and initgraph() set up the
correct aspect ratio
- added __gr_ prefix to several library functions called
by other bcc2grx functions. Protects against interference
with other libraries (problem reported by Axel Rohde)
- updated for libgrx 1.03
- should work with .vdr drivers now
- uses GrGetLastArcCoords() instead of global variables
- BLACK changed into constant
- Pascal support improved. KeyPressed and ReadKey will
flush stdout first, updated Readme
- bccbgi now uses random() instead of RANDOM_TP() for correct
support of >32768 colors modes. (Bad news: random() is much slower)
- set_BGI_mode_whc translates 64K and 16M color values into
GRX internals 0xC010 and 0xC018 (grx1.0x only)
- added _ega_color for EGA color emulation in HiColor/TrueColor modes
- Corrected range check in setfillstyle() (bug found by Axel Rohde)
- Corrected bugs/problems reported by Antonio Carlos Moreirao de Queiroz:
- initgraph won't crash if pathtodriver == NULL
- When loading a font failed, DEFAULT_FONT size 1 will be used
- font switching should be faster now
- if a font can't be found, grFontNotFound error will be set.
- Correct name expansion in installuserfont()
******* 1.1 --> 1.2
- installuserfont() accepts GRX font names (name.fnt).
- getmodename() supports modes >32768 colors
- initgraph() has NATIVE_GRX driver entry. NATIVE_GRX supports
the default, biggest (noninterlaced), BGI_mode graphics and all valid
modes from .grn drivers
- set_BGI_mode()/set_BGI_mode_whc() routines to emulate BGI driver resolutions
- floodfill() doesn't uses second context in simple cases (much faster),
leaves viewport if no clipping required
- getmoderange(), getmaxmode() and getpalettesize() will call
__gr_set_up_modes() first -->> returned values are initialized
- closegraph() resets __gr_INIT flag
- cleardevice(), clearviewport(), imagesize(), graphresult(), getmaxcolor(), getgraphmode(), getpixel() and
putpixel() are checking __gr_INIT flag now
- setrgbpalette() check's initgraph(), moved from bccgrx.h -> bccgrx20.c
- drawpoly() always closed the polygon -- fixed.
- registerfarbgifont() now same as registerbgifont()
- setgraphbufsize() returns a defined value
- setwritemode() protects against setting color bits
- detectgraph() returns the correct graphdriver info
- graphdefaults() doesn't call setlinestyle() & setviewport() any more
- bccgrx.c/__gr_set_up_modes() executed once only (fixes memory waste)
******* 1.0 --> 1.1
- initgraph() will set the requested graphmode if graphdriver != DETECT.
- using GrHLineNC and GrPixelNC in bccgrx09.c / _floodfill()
- BCC2GRX should run correct with old style drivers (.grd)
(bccgrx.c/__gr_set_up_modes changed)
- Corrected detectgraph()/initgraph() problem calling Gr... funcs
before GrSetMode()
- Used normal filled / solid line commands where ever possible
- Text direction and justify setting compatible with Borland definition

View file

@ -1,728 +0,0 @@
This file lists the history of changes to the grx source files from
the 2.2 version.
-------------------------------------------------------------------
Date Changes
12/07/10 ----------- GRX v2.4.9 released (Maurice Lombardi)
12/07/04 Change configure script and makedefs.grx to conform to recent
GNU practice. Honours DESTDIR to ease building binary distributions.
INSTALLDIR is no more present in makedefs.grx, but prefix is there
to replace it. (Extension of a patch by Guillem Jover to all targets
by M. Lombardi)
11/11/23 All drivers generate button4 and button5 mouse events (the scroll
wheel scrolled up or down). Extended from MGRX by M. Lombardi.
11/11/18 Add GrFlush(). Useful only on X11 when when switching between
graphics and console windows open simultaneously. (M. Lombardi)
10/08/17 Add GrMsecTime(). Adapted from MGRX.
09/04/02 Synchronisation of windows and grx mouse cursors by Richard Sanders
<richard@dogcreek.ca>
08/12/12 Fix a race condition with the loadcolor SetDIBColorTable function
call, which happens sometimes on fast multiprocessor machines
This affects only 8 bpp modes (Peter Schauer <peterschauer@gmx.net>)
08/11/05 Added GrClearContextC function, by Richard Sanders.
08/08/01 fdrivers/fd_xwin.c: Sanitized pixel cache code.
New faster and specific for X11 putscanline function, this change
accelerates a lot displaying pnm, png and jpeg images.
Backports from MGRX of M.Alvarez <malfer@telefonica.net>
08/05/15 Fix a conflict between underline and XOR char writing reported by
Al-Junaid H. Walker (M. Lombardi)
07/12/27 Added GrFloodSpill functions, by Richard Sanders <richard@dogcreek.ca>
07/12/01 vd_xwin: go to fullscreen if w,h == X resolution, GR_biggest_graphics
is honored. Modes higher than X resolution are made no-present.
Added videomodes for wide monitors in x11 and w32 drivers.
Backports from MGRX of M.Alvarez <malfer@telefonica.net>
07/08/11 Fix a keyboard bug reported by A. Moreira. It was a bug produced by
the optimiser for gcc >= 4 when using asm: memory clobber.
If not corrected it could pop up at other places. (M. Lombardi)
07/08/29 ----------- GRX v2.4.8 released (Maurice Lombardi)
07/08/29 Sanitized win32, eliminating WM_SIZE events
07/08/27 Add Sleep(5) to setrgbpalette for win32 which sends WM_PAINT to
redraw whole screen. Compare PlayRGBpalette() in test/bgi/bccbgi.c
Add Sleep(1) when no more W32events queued to yield control
when looking for grx events by M. Lombardi.
07/08/21 Correction to WM_PAINT in vdrivers/vd_win32.c: GetUpdateRect() gave
wrong UpdateRect -> few missing chars in text drawing, by M. Lombardi
07/08/17 Change to text/fontpath.c and text/loadfont.c to allow the syntax
/dev/env/DJDIR in djgpp when loading fonts by M. Lombardi
07/08/07 Correction to test/test.h to enable test/scroltst to run as expected.
07/08/05 Eliminate WM_PAINT in mouse/w32inp.c to enqueue GR_OS_DRAW_REQUEST.
Too frequents, they produced saturation of the GRX event queue and
gobbling of keybord/mouse events. Compare responsivity of
test/mousetst.c, test/bgi/bccbgi.c, pascal/bgi/demo.pas by M. Lombardi
07/08/01 The X11 driver now responds to Expose events by using a pixmap
for backing store. But this slows it down. You can recover
previous behaviour (faster but no response to Expose) by editing
src/include/libxwin.h and setting USE_PIXMAP_FOR_BS to 0.
Backported from Mariano's MGRX by M. Lombardi.
07/07/30 various improvements in makefiles, demo.pas, test/speedtst.c
by M. Lombardi.
07/04/06 ----------- GRX v2.4.7 released (Maurice Lombardi)
07/04/06 updates in test/speedtst.c
07/04/05 change to bgi/bccgrx.c, so that all 32 bpp modes are considered
by BGI as 16M modes (the extra byte is only for padding): this was
the case for older drivers up to VESA which gave GrVideoMode->bpp=24
in these cases (see lines 246-258 in vdrivers/vesa.c).
07/03/25 SDL driver (sdl-rc4-support.zip) by Dimitar Zhekov 28 May 2004
with changes to makefiles/makedefs/configure
and pascal support by Maurice Lombardi
07/03/16 inclusion of various corrections submitted to the list
grx.diff-byteorder by Frank Heckenbach 31 May 2006
grx-exitprocess.diff GRX app termination bug (winXP)
by Mario Zagar 15 Feb 2005
grxfixes.zip by Dimitar Zhekov 24 Sep 2004
fontdemo-res-fix.diff
fontdemo-Y-fix.diff
test-changes.diff
win32-8bpp-cls-fix.diff (win32 setmode() clear screen problem)
xfdga-detect-once.diff (xfdga avoid double detection)
grx-w32events.diff (more W32 event handling)
by Peter Gerwinski 19 Jun 2004
graphresult.diff by Andris Pavenis 8 Jan 2004
07/01/05 introduction of GR_PtrInt (integer of same length as a pointer)
to suppress warnings (in fact errors) when compiling with
x86_64 platforms,
renaming sincos() to GrSinCos() in genellip.c to avoid
name conflict with builtin, by M. Lombardi.
06/09/19 correction to bgi/text4.c to correct update of graphics
pointer in vertical writing with outtext (was going in
the wrong direction. BP does not update it at all,
but this is stupid), by M. Lombardi.
06/09/11 correction to grx.pas (bar3d)
06/02/10 Better understanding of x86_64. Now by default an i386
library is built even on x86_64 platforms. If you set
BUILD_X86_64 to 'y' in makdefs.grx a x86_64 library is
built, and the install target go to the lib64 subdir
(backport from MGRX by M. Lombardi)
04/09/24 Added x86_64 support (backport from MGRX by M. Lombardi)
xx/09/05 Florian Xaver updated GRX to make it compatible with latest
DJGPP/GCC.
05/03/08 correction to polytest.pas
04/09/27 more changes to graph.pas, jpgtest.pas, imgview.pas,
by Frank Heckenbach.
04/09/17 more changes to grx.pas and graph.pas, by Frank Heckenbach.
04/06/06 more changes for same purpose by Peter Gerwinski.
04/04/25 changes to introduce:
HAVE_UNIX_TOOLS, CROSS_PLATFORM in makefefs.grx and configure
w32 (mingw32) target in configure
corresponding changes in makefiles,
by Frank Heckenbach and Peter Gerwinski.
04/03/28 changes in grx.pas to make it compile with recent versions of
gpc, by Frank Heckenbach.
03/12/27 Close the framebuffer if DGA is compiled with framebuffer
support, not without it, by Dimitar Zhekov.
03/12/27 Version 2 of the raw driver. Support for psf2. Better
support for RAW: up to 16x32, assuming width:height 1:2
(the previous code was always assuming width = 8),
by Dimitar Zhekov.
03/12/27 Small bug in grxprint.c, by Andris Pavenis.
03/12/27 Version 2 of the libGRX DGA2 driver. Features set mode
via DGA2 and rendering via Xlib or linear framebuffer,
by Dimitar Zhekov.
03/12/27 Up to 200 the possible modes in the DGA2 driver, by Dimitar
Zhekov.
03/12/27 A batch mode for speedtst. Usage: run speedtst to see the
mode numbers, then "time speedtst MODE" or [4dos] "timer ^
speedtst ^timer". Maybe "first" should be named "prompt",
by Dimitar Zhekov.
03/07/17 ----------- GRX v2.4.6 released (Mariano Alvarez Fernandez)
03/07/15 fdv_win.c: the resource header fields must be swapped,
not the data they "point" to, by Dimitar Zhekov.
03/07/15 Changed the default to 'n' for the USE_INOUTP_FRAMEDRIVERS
switch in makedefs.grx
03/06/25 In the svgalib driver don't re-setting the initial mode if
it's already set, by Dimitar Zhekov.
03/06/23 define alloca to __builtin_alloca in src/include/allocate.h
to avoid warnings in Mingw with gcc 3.x. src/makefile.lnx,
src/makefile.x11: don't link ADDON_LIBS for UTILP.
src/stdobjs.mak: remove any duplicate definitions and
trailing \-s. src/text/buildfnt.c: produce a more readable
bdump() DEBUG output, by Dimitar Zhekov.
03/06/23 The GRX raw keyboard I/O can't be safely used in text mode.
Fixed it in test/bgi/, by Dimitar Zhekov.
03/06/10 Small fixes, replaced some printf with DBGPRINTF, removed
GrKeyPressed test in debug mode, it can't be used in all
plattforms, by Dimitar Zhekov.
03/06/10 Small chamges to fdv_win.c, better name/family supportm, avoid
possible overflow, by Dimitar Zhekov.
03/06/10 More Pascal updates, by Frank Heckenbach.
03/05/31 Small fixes to fdv_fna.c and fdv_xwin.c, by Dimitar Zhekov.
03/05/31 Pascal demos updates, by Eike Lange.
03/05/03 Added a InvalidateRect in the loadcolor function in the Win32
videodriver, now the play-palette bgi demo works properly.
I think the Win32 driver is now very usable, not more in alpha.
03/05/03 Faster w32_drawpixel function in the Win32 framedrivers.
03/05/02 Small patch for the next GPC version, by Frank Heckenbach.
03/05/02 Small test fixes, by Dimitar Zhekov.
03/05/02 Added a cleanall target to the borland makefile,
by Dimitar Zhekov.
03/04/02 Added new video driver for Xfree86 DGA2 (Direct Graphics Access),
experimental, not compiled by default, you must activate it in
makedefs.grx, by Dimitar Zhekov.
03/03/31 New 8bpp frame driver (by Josu) and 24 bpp frame driver (by me)
for Win32. They use the standard GRX framedirvers plus the
necesary InvalidateRects. Now the Win32 version is faster and
reliable.
03/03/31 With the Thomas idea of using a DIB in the win32 video driver,
we can now use the DIB like a linear frame buffer, so the new
win32 framedrivers can take advantage of the standard GRX frame
drivers, by Josu Onandia.
03/03/31 Use a DIB for the hDCMem in the win32 video driver,
by Thomas Demmer
03/03/11 The alternate linux console input driver now calls
_LnxfbSwitchConsoleAndWait if _lnxfb_waiting_to_switch_console
is set.
03/03/11 Changes to the linuxfb driver. Added code to catch a signal
when user wants to change virtual terminals. The driver sets
_lnxfb_waiting_to_switch_console and the input driver must
calls _LnxfbSwitchConsoleAndWait then.
Previous function _SwitchConsoleLnxfbDriver renamed to
_LnxfbSwitchConsoleVt, not used,is here only for possible
future use.
03/03/10 Some more adjustments to GPC changes. This time, however,
there will be backward-incompatible changes (WRT …smname'
etc.). Therefore, I'm using a compiler version check, so it
should work with old and new GPC versions. At this occasion,
I'm also removing the old-style external variable syntax
(of GPC versions prior to 2000-04-12) from graph.pas, by
Frank Heckenbach.
03/03/10 Changes the x11 font driver to use it's own X11 display
and window. It allows X11 fonts to be loaded before GrSetMode()
and makes the font driver independent from the X11 video and
frame drivers, by Dimitar Zhekov.
03/03/10 Syncs ulheight/ulpos calculation in the X11 font driver with
all other drivers for which ulheight isn't known, by
Dimitar Zhekov.
03/02/27 Changes to the .fna font driver: undpos is not supported and
fix driver inability to read fonts with 2+ nonempty "note",
by Dimitar Zhekov.
03/02/26 Get rid of GRXMain in test programs, we use main now.
03/02/12 Sanitize the Thomas changes.
03/02/12 Changes to the win32 videodriver. Instead of begin with WinMain
and start a thread with the main GRX program, do it backward:
begin in main and start a thread to handle the Windows window.
With this change we get rid of the awful GRXMain special entry
point and GRX compiles now with CygWin, added the new platform
to grx20.h, by Thomas Demmer <TDemmer@krafteurope.com>
03/02/11 Some small bugfixes for the Pascal units, by Frank Heckenbach.
03/01/14 Pascal units rewritten, this is to make the formatting more in
line with the GPC conventions, by Frank Heckenbach.
02/12/29 The alternate linux console input driver now works with PS2 and
IMPS2 mice (but the whell is not used).
02/12/21 Added function to change virtual terminals in the linuxfb
driver, _SwitchConsoleLnxfbDriver to be called from the input
driver (it doesn't work yet).
02/12/21 Some cleanups to the linuxfb driver, now the text screen restart
ok on exit.
02/12/13 Added 8bpp paletted mode to the linuxfb driver,
by Josu Onandia.
02/11/24 In fdrivers/lfb8.c, lfbbltrv.c, lfbbltvr.c and lfbbltvv.c
there was a erroneous test on LBF_BY_NEAR_POINTER instead
LFB_BY_NEAR_POINTER, reported by <YaoXiaoxi@elong.com>.
02/11/24 Changes avoid some warnings given by `-W' in graph.pas, by
Frank Heckenbach.
02/11/24 The test program launcher, demogrx, has now two pages. Added
some fontdemos.
02/10/27 Modetest shows the actual resolution when in graphics mode.
02/10/26 Corrected bug in fdrives/ram4.c, if the GR_UNDERLINE_TEXT
flag was set colors were wrong, reported by Alex.
02/10/26 Corrected bug in draw/bitblt1b.c, bad source origin if the
destination origin was negative, by Alex <alexbodn@012.net.il>
Changed bb1test.c test program to see the efect.
02/10/20 ----------- GRX v2.4.5 released (Mariano Alvarez Fernandez)
02/10/18 Changed __MINGW32__ to _WIN32 in Pascal units, by
Frank Heckenbach.
02/10/16 Updated the configure script, by Frank Heckenbach.
02/10/02 Corrected bugs in GrFloodFill, before it didn't paint the
righter point (causing ocasionall aborts too) and didn't
work on subcontexts.
02/08/27 Updates to the fdv_raw font driver, the loadfont source
now does a cleanup to close the font file, fontdemo test
program updated, by Dimitar Zhekov.
02/08/10 Make the test/bgi programs depend of a unique file header
for input and delay functions.
02/08/10 New api functions with a unique color parameter in 0xRRGGBB
format:
GrColor GrAllocColor2(long hcolor);
GrColor GrAllocColor2ID(long hcolor);
void GrQueryColor2(GrColor c,long *hcolor);
void GrQueryColor2ID(GrColor c,long *hcolor);
02/08/06 Added 'setsuid' target to test/makefile.lnx and
test/bgi/makefile.lnx. Now you can run 'make -f makefile.lnx'
in the grx base directory an them become root and run
'make -f makefile.lnx setsuid'.
02/08/06 Use the SET_SUIDROOT variable in test/bgi/makefile.lnx,
by Dimitar Zhekov.
02/08/06 Fontdemo update, by Dimitar Zhekov.
02/08/02 Modifications to acomodate new options in makedefs.grx,
for the four standard platforms:
INCLUDE_BGI_SUPPORT, 'y' by default
for the linux console platform:
USE_SVGALIB_DRIVER, 'y' by default
USE_FRAMEBUFFER_DRIVER, 'y' by default
SET_SUIDROOT, 'y' by default
USE_INOUTP_FRAMEDRIVERS, 'y' by default
Added a note about "Suidroot in the Linux console platform"
in the readme file.
02/07/29 Revert some changes in the bgi test demos to compile again
with DJGPP.
02/07/29 Corrected an off-by-one error in the raw font driver, by
Dimitar Zhekov.
02/07/29 16-bit fix for BGI and GRX. __gr_WR must match GrColor, by
Dimitar Zhekov.
02/07/29 Changes to the BGI interface, by Dimitar Zhekov.
Inline functions defined as macro and non-inline versions.
BGI number of colors for DOS / BCC limited to < 15bpp.
BGI aspect ratio fixed for 16-bit systems (DOS / BCC).
_BGI_INLINE_ moved to fldfill.c, the only module that uses it now.
Inline functions in text4.c replaced with macros.
Test\bgi\colortst.c fixed to use getch() not getchar().
02/07/21 Make bccbgi works with Borland C, by Dimitar Zhekov.
02/06/17 Added fontdemo test program, by Dimitar Zhekov.
02/06/17 Added the GrDumpFnaFont fucntion, to save a fon in a ascii
fna file, by Dimitar Zhekov.
02/06/12 Three new font drivers by Dimitar Zhekov:
* RAW driver - for RAW data and Linux PSF (not PCF) files. RAW
data files must be 8 points wide. 512 character PSF files are
supported. For the PSF files contained in Linux systems to be
readable with GRX, you'll have to unzip them.
* FNA driver - for the ascii font format used by grx 1 font
read/write tool. A doc about this format was added to the doc
subdirectory.
* WIN driver - for MS Windows FNT and RES files. FNT versions 2
and 3 are supported, 32-bit RES and FON files are not. The first
resource from RES is used. As far as I know, all MS Windows-es
from 2.0 to NT 4.0 use FNT version 2 and 16-bit resources packed
into FON for raster fonts. To use the MS Windows .FON files,
split them into .FNT or .RES files using a resource editor.
Note. Big endian support is untested.
02/06/12 Fixes for src/makefile.bcc and test/makefile.bcc,
by Dimitar Zhekov <jimmy@is-vn.bg>
02/04/29 GrResizeSubContext uses now the parent context coordinates.
02/04/29 Reverted some 'const' that didn't make sense.
02/03/31 The win32 driver accepts arbitrary (user defined) resolution.
02/03/14 A new global switch _GR_textattrintensevideo (false by default)
permits the use (when true) of 16 background colors in
GR_ATTR_TEXT strings.
02/03/13 When the close icon is pressed in the w32 version a dialog
is issued warning it aborts the program.
02/03/12 Fixed some bugs introduced with the new win32 input queue.
02/02/11 The makefile install target installs the grxprint.h file
if printer support is activate
02/02/11 Inprovements to the win32 driver:
Now the GRX window is properly closed, so the previous app
gets the focus.
02/02/02 Inprovements to the win32 driver:
The w32 imput queue implemented as a circular queue.
All the input related code moved to w32inp.c from vd_win32.c
The main window is created in WinMain, so the grx program
can use other videodrivers like the memory one.
Now the printer stuff compiles and run, checked with the
DeskJet driver, printing to a file and them "copy file lpt1",
but the printout is not totally correct (?).
02/01/11 ----------- GRX v2.4.4 released (Mariano Alvarez Fernandez)
02/01/09 Modified the demogrx test program to center the image when
a mode bigger than 640x480 is selected
02/01/09 Added an alternate linux console input driver, it handles
the mouse directly openning /dev/psaux, but note only PS/2
mouses work by now. It must be activate explicitly by
uncomenting the switch "USE_DIRECT_MOUSE_DRIVER=y" in
"makedefs.grx"
02/01/09 The linux framebuffer video driver now set the console in
graphics or text mode when necesary. Now the text cursor is
not show, and the svgalib mouse input driver doesn't collide
with GPM, so, surprise!, it works!
02/01/09 Small changes to improve the linux console input driver
02/01/07 More patches to the Pascal interface, by Frank Heckenbach and
Maurice Lombardi
02/01/02 Go to full screen in the Win32 driver if the requested framemode
dimensions are equal to the screen dimensions (setting the
client start area at 0,0).
01/12/22 More patches to the Pascal interface, by Frank Heckenbach and
Maurice Lombardi
01/12/22 Added an optional configure script, by Frank Heckenbach
01/12/21 The linuxfb driver now open /dev/fb0 by default. An alternative
frame buffer device can be specified setting the environment
variable $FRAMEBUFFER
01/12/21 pascal ega colors are now functions, by Frank Heckenbach
01/12/21 fixed some borland bgi incompatibilities, by Frank Heckenbach
01/12/21 added 'const' (C) and 'protected' (Pascal) to some
function parameters, to make them a little "safer",
by Frank Heckenbach
01/12/16 Added imgview.pas and colortst.pas demo programs, by
Frank Heckenbach
01/12/16 Change in the pascal interface: GrAllocEgaColors, GrGetScanline,
etc. return a pointer to an array of GrColor, rather than to a
single GrColor, by Frank Heckenbach
01/12/16 Make installation of shared libraries optional on Linux/X11
by Frank Heckenbach
01/12/16 GrSaveContextToGrayJpeg added to the pascal interface, by
Maurice Lombardi
01/11/29 better w32 keyboard handling. Now most special keys with
shift, alt and control combinations works
01/11/29 added jpeg functions to grx.pas and jpgtest.pas demo, by
Maurice Lombardi
01/11/29 patch to define gpc-main in grx.pas and graph.pas, by
Frank Heckenbach
01/11/29 patch to remove warnings on unix in test/bgi programs, by
Frank Heckenbach
01/11/16 Added new function: GrSaveContextToGrayJpeg. Now
GrLoadContextFromJpeg can load grayscale jpeg files
01/11/08 jpgtest test program added. It works too without jpeg support
and shows a message
01/11/08 New jpeg functions (GrSaveContextToJpeg, GrLoadContextFromJpeg,
GrQueryJpeg, GrJpegSupport). Added dummy functions if there
isn't jpeg support
01/11/07 Added new targets to makefiles: install-info, unisntall-info.
Now install doesn't install info (readme file updated)
01/09/08 Applied additional patches to update Pascal interface, new
polytest.pas demo, by Maurice Lombardi
01/09/07 Applied patches to update the Pascal interface, by
Frank Heckenbach. Note, the "bgi2grx" unit was renamed to
"Graph", so it will be BP compatible and more natural to
Pascal programmers
01/06/28 ----------- GRX v2.4.3 released (Mariano Alvarez Fernandez)
01/06/27 Added new targets to makefiles: install-bin, uninstall-bin,
install-fonts and uninstall-fonts (readme file updated)
01/06/26 Moved bin2c, fnt2c, vesainfo, lfbinfo and modetest to
src/utilprog. They are build in the source makefile.
01/06/22 Except for the w32 version the install target installs the
info manual. As suggested by Maurice Lombardi and Waldemar
Schultz
01/06/21 pngtest test program added. It works too without png support
and shows a message
01/06/20 Changed BCCGRX cleardevice function to clear the screen to
the current BACKGROUND color instead of black. Suggested by
Waldemar Schultz
01/06/19 ctx2png functions (GrSaveContextToPng, GrLoadContextFromPng,
GrQueryPng, GrPngSupport) integrated in GRX. src/pnm subdir
renamed to src/gformats. Added dummy functions if there isn't
png support
01/06/18 New API functions: GrLoadContextFromPnmBuffer and
GrQueryPnmBuffer
01/06/15 ----------- GRX v2.4.2 released (Mariano Alvarez Fernandez)
01/06/12 Modified win32 input code for GrMouseGetEvent and GrKeyRead
work at the same time, when GrMouseEventEnable(1,0) is set
01/06/07 Merged makedefs.gnu, makedefs.x11, makedefs.dj2 and
makedefs.w32 in makedefs.grx (readme file updated)
01/06/06 Now we can use "GRXMain" for all GRX versions, grx20.h defines
it like "main" except for the win32 version. Deleted the ugly
"#ifdef __WIN32__ ..." in test programs (except for BGI tests)
01/06/05 Added the Linux framebuffer videodriver (vdrivers/vd_lnxfb.c)
alpha stage, only in 16 or 24 bpp. To use it set GRX20DRV to
"linuxfb" in the GRX Linux version. The mouse doesn't work
01/06/05 Some minimal changes to compile ok with gcc 2.96 and
Linux 2.4.x
01/05/30 Applied patch to sanity bgi code for gcc 3.0, by Andris
Pavenis
01/05/28 Modified makefiles for linux and x11. Now they build
shared and static libs at the same time. Added install and
uninstall targets.
01/05/16 Applied patch to add standard pascal makefiles for dj2, w32,
x11 and lnx. pascal/bgi/test and pascal/bgi/demo merged in
pascal/bgi. Pascal readme updated. By Maurice Lombardi
01/05/09 Applied patch to produce makefiles for mingw32 pascal tests
by Maurice Lombardi
01/04/26 ----------- GRX v2.4.1 released (Mariano Alvarez Fernandez)
01/04/25 User's guide (info) updated, by Vicente Fuentes Gea
01/04/20 User's guide (html) updated
01/04/19 Applied partially patches to make GRX compile with MS-VC
by Hartmut Schirmer
01/04/18 Added install and uninstall targets to src/makefile.dj2 and
src/makefile.w32
01/04/18 Patched src/bgi/text7.c to compile Ok with GCC 3.0
by Andris Pavenis
01/04/14 New API routine: GrBitBlt1bpp, contributed by Josu Onandia
Added bb1test.c test program
01/04/01 Changed compiler options from "-O6 -fomit-frame-pointer" to
"-O2" only. Suggested by Andris Pavenis.
01/03/27 drawpattern and bltr2v_24 added to fdrivers/fd_win32.c
01/03/26 Fixed a bug in pnm/ctx2pnm.c, when grx == NULL the actual context
must be used. Reported by Vicente Fuentes Gea
01/03/25 The dj2 version uses now "uclock" in mouse/input.h to get 1ms
resolution in input code. Because "uclock" can be unsafe in W3.1
when NO_REPROGRAM_TIMER is defined the old code is used. A
comment has been added to makedefs.dj2
01/03/25 Changed CLOCKS_PER_SECOND by CLK_TCK for linux in mouse/input.h
to get real ticks per second
01/03/24 New API routines: GrSetWindowTitle and GrSleep
01/03/22 Changed DJGPP test macro from __GO32__ to __DJGPP__
by Andris Pavenis
01/03/18 ----------- GRX v2.4 released (Mariano Alvarez Fernandez)
01/03/16 Win32 drivers improved again by Josu Onandia
01/03/15 Make bccbgi to use ../rand.h to work with the Win32 drivers
01/03/14 Added ifdef to demo programs to use GRXMain with the Win32 drivers
01/03/12 Fixed a bug in mouse/xwinkeys.c, preventing getkey & kbhit work
together (Now bccbgi demo works properly in X, except restoring
from text mode)
01/03/10 Support for DJGPP v1 removed (really only removed makefiles by now)
01/03/10 Optimized pnm/ctx2pnm.c, contributed by Josu Onandia
01/03/10 Improved frame and video drivers for win32, by Josu Onandia
<jonandia@fagorautomation.es>
01/03/06 Integrated the win32 version written by Gernot Graeff
<gernot.graeff@t-online.de>
01/03/05 Fixed bug in modetest.c preventing 32 bpp modes to work.
01/03/04 Applied patch to solve 32bpp problems, by Hartmut Schirmer
01/03/03 Applied patch to make GRX compile with gcc 3.0, by Andris Pavenis
01/03/03 Fixed bug in pattern/fillpatt.c
01/02/26 Modified setmode.c and svgalib.c to set frame pointer dinamicaly
and fix the svgalib video driver.
01/02/22 Applied some patches by Maurice Lombardi
<Maurice.Lombardi@ujf-grenoble.fr>
01/02/20 Fixed bug in pattern/patfbox.c
01/02/14 Fixed bug preventing GrLoadFont work with BGI fonts
01/02/12 ----------- GRX v2.3.4 released (Mariano Alvarez Fernandez)
01/02/06 user's manual in info format contributed by Vicente Fuentes Gea
<vfg@servidor.unam.mx>
01/02/01 new WIN32 Mingw32 target (memory driver only)
01/01/28 ctx2pnm functions added.
01/01/28 user's manual updated again.
01/01/28 new test programs added: pnmtest and demogrx.
01/01/28 some test programs bug fixes.
01/01/28 pascal subdirectory update contributed by Eike Lange
<eike.lange@uni-essen.de>
01/01/24 ----------- GRX v2.3.3 released (Mariano Alvarez Fernandez)
01/01/21 BGI test programs moved to test/bgi
01/01/21 Added the updated GRX user's guide.
01/01/20 BCC2GRX license comments changed to point to the GRX license.
01/01/20 Sources changed to point to the copying.grx file
01/01/10 Applied some patches by Andris Pavenis.
00/09/14 ----------- GRX v2.3.2 released (Peter Gerwinski)
00/06/21 ----------- GRX v2.3.1 released (Peter Gerwinski)
00/06/21 Some bug fixes (solved problems induced by the update).
00/05/20 ----------- GRX update released (Hartmut Schirmer)
00/05/20 Added AIX support in grx20.h, xwininp.c, allocate.h as
suggested by Andris Pavenis <pavenis@lanet.lv>.
Added BGI-Support from BCC2GRX.
00/05/19 Don't use GCC/i386 asm in highlow.h on gcc after v2.8.x
00/05/17 Added test/sbctest.c contributed by
Mariano Alvarez Fernandez <malfer@teleline.es>
Fixed additional subcontext bugs in GrPatternFilledLine
and GrPatternFilledPlot (reported by Mariano Alvarez
Fernández <malfer@teleline.es>)
Applied the 32bit X11 patch by Ulrich Leodolter
00/04/23 Applied some changes suggested by Josu Onandia
<jonandia@fagorautomation.es>
- pattern/patfbox.c: Context offset wasn't added
to drawing coordinates
- text/buildfnt.c: Fixed a typo, pointer to passed
free() not same as returned by malloc()
- mouse/drawcurs.c: Incorrect calculation of mouse
cursor work area
Applied asm bugfixes by Ian Miller <Ian@shelob.f9.co.uk>
required for EGCS/GCC compilers after v2.8.x
and for binutils after v2.9.1
Changed GRX internal version to 0x0231
Changed return type of main in test/textpatt.c to int
00/04/06 Fixed an uninitialized variable reported by Josu Onandia
<jonandia@fagorautomation.es>n wideline/drwcpoly.c
98/06/28 Updated addons/print test files
Added a note to DJGPP & BCC src/makefiles that command.com
is required as shell
98/06/08 GCC asm enhancements (arith.h,ioport.h,highlow.h)
98/06/07 fine tuning mach64 banking functions
98/06/06 Fixed a typo in addons/ctx2jpeg.c
DJGPP&BCC didn't cleanup the addons subdir's
DJGPP v1 failed on grxprint.c compilation
Added optimized GCC/i386 asm repfill_b code
98/06/03 ----------- GRX v2.3 released (Hartmut Schirmer)
98/05/26 Fixed a bug in gcc/highlow.h
98/05/24 Printing code synced with Andris
Some additional files needed memcopy.h
X11R6 driver was broken (XInitImage) -- fixed
98/05/20 DOS _GrUpdateInputs() still used getxkey -- fixed
ram3x8, ega4, herc1 & dosinput didn't include memcopy.h
System endian can now be defined by -D_BIG_ENDIAN or
-D_LITTLE_ENDIAN at compile time
98/05/19 GrSetFontPath() still used alloca -- fixed
Again fixed minor problems in printing code:
- some functions where declared extern but
implemented static
- signed / unsigned problem in RepeatByte()
98/05/18 Update printing support.
There were no RAM drivers for 1 & 4bpp in X11
build.
Fixed a bug on short hlines in ram1 & ram4
GRX uses it's own memcopy now
98/05/17 Watcom makefiles changed for DEBUG support and
.dat copy from test/ to bin/
98/05/14 Some code fixes to avoid warnings fron SUN cc
98/05/13 Minor changes to avoid warnings on several platforms
(eg, eliminated C++ style comments, non ASCII chars, ...)
98/05/11 Fixed LFB frame buffer address handling when
LFB_BY_NEAR_POINTER active
JPEG & TIFF save now use GrGetScanlineC() and
malloc() instead of alloca()
98/05/10 Fixed a typo in watcom/memfill.h
GCC v2.8.1 broke dependency file creation under
DJGPP v2, no subdir information was included for
the target. The gcc -MM output is now passed through
a new sed script and the created dep-file should be
ok on any version GCC. Same change for Linux and X11
makefile. This change makes Watcom makefile creation
by utils/watmake work again.
Again fixed Watcom makefiles
Added -DGRX_DEFAULT_FONT_PATH="...." configuration for
default font path when no GRXFONT environment entry
specified. This is mostly useful on Unix platforms.
Getting scanline changed for GrPixel / GrPixelC
like naming: GrGetScanline && GrGetScanlineC
98/05/07 Watcom updates (bmp/printing/makefiles)
Minor BMP & printing updates for better Unix support
98/05/06 Fixed a bug in _GrFrDrvGenericStretchBlt()
Fixed potential bug in GrImageFilledBoxAlign()
98/05/05 GrGetScanline && GrPutScanline functions added
98/05/04 GCC/i386 peek_24 was broken
Image streching fixes and imgtest prog
98/05/03 Added getindexscanline() and putscanline() to frame
drivers and implemented generic versions.
Added _GrFrDrvGenericStretchBlt() using integer
arithmetic and the new scanline functions.
Fixed dynamic memory allocation bugs im image code.
GrImageStretch() now uses _GrFrDrvGenericStretchBlt()
98/04/30 Pascal definition for GrGetLibrarySystem
Changed VBE2 memory mapped IO support so a buggy BIOS
won't break the code that easily
98/04/28 Pattern filling uses predefined _GrPatternFiller instead
of local initialized var
S3 drivers banking functions enhanced
Unified DJGPP & Watcom VBE2 code
98/04/27 Fixed problems in font loading code on big endian systems
Updated Watcom support
Again eliminated some empty macro args
Added GrGetLibrarySystem() returning GRX_VERSION for
portable runtime system check
98/04/26 Fixed a bug introduced when changing pattern filled text
code
98/04/22 (Pattern-) fill code unified & simplified.
Fixed a filling bug on big endian systems.
Makefiles updated (printing, zlib)
Configuration switches for 'noisy' compilers
Code cleanups and splitted some files
98/04/21 Better cooperation between X11 and GRX in Pseudocolor mode
Added GrAllocEgaColors() for allocation standard EGA colors
Borland-C++ 4bpp blit was broken.
Relaxed some macro argument handlings for older BCC versions
98/04/20 GRX should work on X11R5 systems now.
Added some new key definitions (shift left/right/up/down).
Changed inline -> INLINE for portability.
Removed empty arguments in clipping.h
Again fixed minor problems.
98/04/15 Added X11 driver changes by Ulrich. Fixes the XGetImage problem.
Fixed several portability problems, mainly removed cast
to (unsigned) int of assigned variables.
Fixed some bugs Thomas found in the ALPHA code
Changed temp. memory allocation. New function ALLOC()
will use malloc if SMALL_STACK defined of alloca otherwise.
Watcom assembler code didn't work. Changed the #pragma
definitions so they don't use macros.
Fixed several minor bugs
98/04/13 Fixed minor bugs in X11 driver.
98/04/06 Checked GNU-Pascal support (basic functions only)
98/04/05 Minor bugfixes and some GCC/386 speedups (copy & fill
loops aligned on 16byte boundary for optimal performance)
Changed the mouse timing information to real world time
instead of user process time (X11 & Linux)
GrMouseGetEventT will only return a valid ev.dtime if
any event occured
98/04/02 Faster VGA8X line drawing
The far (eg. to video ram) peek and poke operations
won't get optimized away any more (solves 4bpp blit bug)
98/03/31 Added 64 bit support (_h)
Fixed a bug in egavga1.c/drawvline
98/03/30 Integrated Gary's Watcom changes.
Watcom port now defined LFB_BY_NEAR_POINTER
Added _n as near/normal opposite of _f in macro names to
avoid empty arguments in macro calls
98/03/27 Borland port now uses RAM3x8 in 24bpp and 32bpp modes
Fast and robust colfill_... functions for Borland
Updated image support
98/03/19 24bpp mode changed:
- Added repfill_24 and optimized peek_24/poke_24
- dropped access24.h (only color component access left)
- LFB24 and RAM24 now use the same code.
- Optimization for black/grey/white filling: done by repfill_b
Fixed some Linux/386 shared lib problems (can't use EBX with -fPIC)
98/03/17 Major code rearrangement: (Watcom port may be broken :((
- A lot of frame driver now share code and use much
more optimized (!= generic) drawing functions
- Generic and asm fwdcopy/revcopy functions for blitting
- splitted header files to individual system files
(filling, copying, ...) for better maintaince and
easier optimization
- much work on BCC speed & stability
- Expect the Watcom port to be broken :((
Added Andris latest changes to the printing system
98/02/25 Fixed X11 keyboard handling
minor changes for BSD compilation
updates to printing system
98/02/24 Fixed a bug in GrDestroyPattern() when freeing the
bitmap planes (found&patched by Michal).
access24.h needed another fix for linux shared lib :(
98/02/20 Added BMP file read && image display contributed
by Michal Stencl
Added JPEG context save by Vincenzo Morello
98/02/19 Watcom makefiles, fixes to print system
Changed access24.h for shared library compilation
on Linux-i386 systems
98/02/17 Watcom fixes and addons by Gary
Fixed svga4, lfb8 and vga8x blit functions
Added color selection by bpp to GrSetMode
Added patterned text output by Stencl Peter
Added printing support (thanks again Andris!)
98/01/13 fast RAM to video blit to 16 color driver
fast hline for 16 color RAM driver
98/01/08 Watcom support integrated. Code cleanup (eg. gcc
multi line strings cleaned for other compilers)
Added platform dependent lib-subdirs
Fixed some Linux/svgalib keyboard bugs
98/01/01 Revised keyboard support as suggested by Andris and
Vincenzo. See new grxkeys.h file in include dir!
97/12/21 Updated DJGPP (v1&v2) makefiles again.
Fixed some GCC warnings with additional -W... switches
(WARNOPTS in makedefs.gnu)
Fixed a BCC problem with the new 16 color blit function
Some local functions didn't have a static :(
Fixed some Linux && X11 keyboard problems (input got
desynced on heavy load / high keyrates)
97/12/18 updated Pascal support
BCC allocates from heap instead of stack for big blocks
eliminated some unchecked malloc's
Splitted several code files for smarter linking
BCC arithmetic moved from assembler macro to optimized
function for more reliable results
97/12/16 ported the flood fill function from BCC2GRX. See grx20.h
for ...FloodFill
97/12/15 changed ulong, ushort, etc to GR_int32u, GR_int16u, etc
for better portability and to avoid warnings on Linux
97/12/08 Integrated code (variable X11 window size & memory driver)
and patches (genellip & SaveContextToTiff & other) by Andris
97/11/16 Updated Linux and X11 makefiles
97/11/02 Makefiles for DJGPP v1 compilation
New (much faster) 16 color video to video blit routine
97/11/01 Fixed some far pointers to RAM area in the video drivers
97/10/29 Added ALPHA processor support
97/10/01 Fixed DJGPP systag generation in SRC makefile
97/09/30 Updated makefiles and makedefs
Added the addons directory and the SaveContextToTiff
function
Fixed some BCC specific warnings
S3 driver banking doesn't work for 16 color modes, at
least for my card. Uses VESA banking for < 256 colors
Fixed BCC __emit__() code in arith.h (thanks, Andris)
------- grx v2.2 release

View file

@ -1,50 +0,0 @@
This is the original Csaba Biegl copying file, it will be here until
all source files will be updated to point to ../copying.grx
The license terms have not changed.
--------------------------------------------------------------------
This is file "copying.cb".
This document describes the terms for distributing the source code of and any
derived work based on the GRX graphics library. Such source code is marked
with the copyright notice:
"Copyright (c) 1995 Csaba Biegl, 820 Stirrup Dr, Nashville, TN 37221"
Source code with the above copyright is distributed under the following terms:
(1) The test programs for the graphics library (code in the 'test'
sub-directory) is distributed without restrictions. This code
is free for use in commercial, shareware or freeware applications.
(2) The GRX graphics library is distributed under the terms of the
GNU LGPL (Library General Public License) with the following amendments
and/or exceptions:
- Using the DOS versions (DOS only! this exception DOES NOT apply to
the Linux version) you are permitted to distribute an application
linked with GRX in binary only, provided that the documentation
of the program:
a) informs the user that GRX is used in the program, AND
b) provides the user with the necessary information about
how to obtain GRX. (i.e. ftp site, etc..)
(3) Fonts (in the 'fonts' directory) are distributed according to the
terms in the file "COPYING.MIT". Most of the fonts included with the
GRX library were derived from fonts in the MIT X11R4 distribution.
The exception is the "pc" BIOS font family, which is distributed
without restrictions.
A copy of the GNU GPL (in the file "COPYING") and the GNU LGPL (in
the file "COPYING.LIB") is included with this document. If you did
not receive a copy of "COPYING" or "COPYING.LIB", you may obtain one
from where this document was obtained, or by writing to:
Free Software Foundation
675 Mass Ave
Cambridge, MA 02139
USA

View file

@ -1,123 +0,0 @@
CONTRIB.DOC
===========
GRX was original written by Csaba Biegl <csaba@vuse.vanderbilt.edu>
for DJ Delorie's DOS port of the GCC compiler.
Michael Goffioul <goffioul@emic.ucl.ac.be> released GRX 2.1a
(first full API implementation).
Starting from version v2.2 GRX was maintained by Hartmut Schirmer
<hsc@techfak.uni-kiel.de>.
Peter Gerwinski <peter@gerwinski.de> released GRX 2.3.1 and 2.3.2.
Mariano Alvarez Fernandez (malfer@telefonica.net) released GRX 2.3.3,
2.3.4 and the 2.4.0-6 series.
Maurice Lombardi <Maurice.Lombardi@ujf-grenoble.fr> packed together
various contributions to release GRX 2.4.7-9
Credits for GRX > v2.0 in alphabetical order
============================================
Csaba Biegl <csaba@vuse.vanderbilt.edu> for the post v2.0 developers
source code (and of course: MANY THANKS FOR THE GREAT GRX LIB !).
N. D. Culver <ndc@alum.mit.edu> for suggesting the bpp based color
spec with GrSetMode().
Thomas Demmer <TDemmer@krafteurope.com> for inprovements and good ideas
with the win32 driver.
Frank Donahoe <fdonahoe@wilkes1.wilkes.edu> for bug reports and patches.
Vicente Fuentes Gea <vfg@servidor.unam.mx> for the info version of the
user's manual.
Michael Goffioul <goffioul@emic.ucl.ac.be> for his GREAT work:
- Pattern Filled functions
- Patterned Line functions
- Custom Line functions
- User Coordinates functions
Gernot Graeff <gernot.graeff@t-online.de> for the Win32 driver.
Thomas Hahn <hahn@itpaxp5.physik.uni-karlsruhe.de> for the ALPHA
processor patches (64bit support).
Frank Heckenbach <frank@g-n-u.de> for Pascal interface updates,
configure script and many others inprovements.
Sven Hilscher <Sven@rufus.lan-ks.de> for GNU-Pascal interface and
bug reports.
Eike Lange <eike.lange@uni-essen.de> for Pascal updates.
Andrzej Lawa [FidoNet: Andrzej Lawa 2:480/19.77] for linear framebuffer
support.
Maurice Lombardi <Maurice.Lombardi@ujf-grenoble.fr> for many patches
and bug reports.
Peter C. Mehlitz <peter@transvirtual.com> for his suggestions on
Linux and X11 event time handling
Vincenzo Morello <morellov@tin.it> continous using GRX as base
graphics API for his MGUI lib. He submitted many suggestions,
found lots of bugs and contributed the SaveContextToJpeg() code.
Josu Onandia <jonandia@fagorautomation.es> for patches, bug reports
and lot of inprovements to the Win32 driver.
Andris Pavenis <pavenis@acad.latnet.lv> for many suggestions, the
memory driver, printing support, variable X11 resolution, patches
and bug reports.
Gary Sands <gsands@stbni.co.uk> did the Watcom C++ port.
Daniel Skarda <0rfelyus@atrey.karlin.mff.cuni.cz> for Linux shared
libraries and bug reports.
Anton Norup Soerensen <norup@ursa.astro.ku.dk> for patches and bug reports.
Michal Stencl <stenclpmd@bratislava.telecom.sk> for the pattern text
output, BMP handling and image display functions.
Waldemar Schultz <schultz@mathematik.tu-muenchen.de> for bug reports.
Michael <mh@conrad.chem.uni-potsdam.de> for bug reports.
Dimitar Zhekov <jimmy@is-vn.bg> for three new font drivers, makefile
fixes for the bcc version, bgi updates, X11 fixes and the Xfree86 DGA2
video driver.
###########################################################################
This is the original contrib.doc by Csaba Biegl (csaba@vuse.vanderbilt.edu)
###########################################################################
This is a (far from complete) list of people who sent me ideas, bug reports
or useful code pieces during the development of GRX 2.0.
This file is under construction (I need to go back in my e-mail records to
see who sent me bug reports, ideas, etc...). Currently it has only the most
recent contributions. If you think you sent me something for which you should
be mentioned here, but you don't see your name in the list, drop me an e-mail.
I may have lost same of the older correspondence.
Hartmut Schirmer (hsc@techfak.uni-kiel.de) for many good ideas, bug reports,
the BGI font loader sources and the protected mode VESA paging code.
Christian Domp (alma.student.uni-kl.de) for bug reports, the 90x30, 94x30
90x34 and 94x34 text modes in the stdvga driver and for fixing the HiColor
and TrueColor modes in the et4000 driver.
Ulrich Leodolter (ulrich@lab1.psy.univie.ac.at) for the wonderful X11
video, frame and font drivers, bug reports and the DOS Hercules video
driver.
Daniel Skarda (DSKA4435@novell.karlin.mff.cuni.cz) for bug reports.
Mauro Condarelli (mc5686@mclink.it) for the Linux SVGA version keyboard
enhancements.

View file

@ -1,140 +0,0 @@
ASCII FONT FORMAT
This document describes the ascii font format, FNA, as found in GRX 1 font
read/write-tool and GRX 2 FNA driver.
FILE FORMAT
An ascii font file consists of lines. Each line consists of zero or more
8-bit characters and is terminated by a line feed, a carriage return or a
carriage return followed by a line feed, depending on the operating system.
Line length must not exceed 129 characters with the line terminators and 127
characters without them. Trailing blanks are allowed (and ignored), while
leading blanks are not allowed. Lines starting with semicolon are comments.
They are ignored, and so are the blank lines.
HEADER
An ascii font file starts with a header. The header must specify at least 8
font properties. Each property is on a separate line, can only be specified
once and has the general form:
<name><separator><value>
where separator consists of one or more blanks.
Required properties:
name <string>
Font name.
family <string>
Font family.
isfixed <0|1>
0 for proportional or 1 for monospaced fonts. Any non-zero value is treated
as 1.
width <number>
Font width for monospaced fonts.
avgwidth <number>
Average font width for proportional fonts.
Note: monospaced fonts should only specify width, and proportional fonts
should only specify avgwidth. The GRX FNA driver does not check for that. It
expects one width or avgwidth property for each font, no matter the spacing.
height <number>
Font height.
minchar <number>
The character with which the font starts. Usually 32 (ascii space).
maxchar <number>
The character with which the font ends. Must be > minchar. The number of
characters in an ascii font file equals to maxchar - minchar + 1.
baseline <number>
Font baseline. 1-based.
minwidth <number>
The narrowest character width (proportional fonts only). Must be non-zero.
Ignored by the driver.
maxwidth <number>
The widest character width (proportional fonts only). Must be <= 127. Ignored
by the driver.
Note: the driver does not require minwidth and maxwidth, but any proper ascii
font header should include them when describing a proportional font.
Optional properties:
undwidth <number>
Underline height in lines. The default is height / 15 rounded down, or 1 if
the font height is < 15.
note <string>
Comment. May be empty. Any number of comments may be specified. The usual
comments are the font XFDL name and copyright. Ignored by the driver.
Note: the comments starting with semicolon are always ignored, while the note
comments may be taken into account by a non-GRX driver or program.
DATA
The file header is followed by <height * number-of-characters> data lines.
Each <height> data lines describe one character scan line by scan line. These
lines must all be <width> characters long, where <width> is the width of the
character being described. Each line describes one character scan line bit by
bit from left to right: period for 0-bit, number sign for 1-bit. A blank line
and a comment are usually placed before each <height> lines to make the file
more readable. Hope my english was good enought, and here is an example:
; character 36 ($) width = 8
........
...#....
...#....
.#####..
#..#..#.
#..#....
#..#....
.#####..
...#..#.
...#..#.
#..#..#.
.#####..
...#....
...#....
If the character being described is less than 33 (exclamation) or greater
than 96 (asciitilde), the comment is shorter:
; character 255 width = 8
Note: both the blank line and the comment are ignored and DO NOT act as
character data separators. Do not let them fool you and check if there are
exactly <height> data lines for each character. The driver will not read a
file without enough data in it, but will silently ignore any extra data.
THE END
No non-blank lines should follow the data, except for semicolon comments. The
driver does not check for that. Placing one blank line after the data is not
a practice.
For a full ascii font example, see ter-114n.fna in the GRX fonts directory.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,511 +0,0 @@
THIS FILE IS UNDER CONSTRUCTION!!!!
After you un-zip the GRX archive you need to do the following things to
use it:
Set two environment variables:
1) SET GRX20DRV=<driver> gw <width> gh <height> nc <colors>
2) SET GRXFONT=<directory for the GRX fonts>
Available drivers are:
stdvga
stdega
et4000
cl5426
mach64
ati28800
VESA
After setting these you may run "bin/modetest" to see what modes you have.
To compile and link a program you need to make sure that the compiler
"sees" the "include" and "lib" directories of the GRX20 package. Either
use the -I and -L compiler switches with these directories or copy
the files from these dirs to a standard place.
====================== don't read after this ========================
Abstract
========
This document contains information necessary for rebuilding
the LIBGRX graphics library. Additionally, it describes some internal
details of the library associated with way it accesses the video RAM. This
info might be useful for adding support for new graphics adapter types.
How to rebuild the library
==========================
The LIBGRX library is built using the Turbo C MAKE. (TC++ 1.01
professional was used.) If an other MAKE has to be used it has to provide
some method for generating response files from long command lines. The
makefiles may have to be changed from the Turbo C MAKE response file
syntax to the syntax of the new MAKE. Additionally, the Turbo C MAKE
provides a C preprocessor-like conditional syntax. If the new MAKE utility
does not support this, the desired option has to be hard-coded.
The makefile in the base directory of the package (typically it is
....djgpp\contrib\libgrx) can be invoked as follows:
1) make build DJGPP libraries, and the drivers
2) make turboc build Turbo C libraries
3) make test (1+) build DJGPP test programs
4) make turbotst (2+) build Turbo C test programs
5) make install copy .h and .a files into DJGPP dirs
6) make clean clean up after recompiling
All graphics library sources are in the 'src' directory. The makefile
in that directory can also be used to build a customized version of the
library. Customized libraries (and the executable built using them) can be
smaller, because they don't include support for all video RAM access
methods. (see later) The makefile in the src directory can be used as
follows:
make -DPLANES=<value>
-- or --
make -DPLANES=<value> [-DMODEL=<memory model>] turboc
The value of the PLANES macro determines the included video RAM access
methods. This is a number obtained by OR-ing together the following
values:
1 monochrome (Hercules)
4 16 color EGA/VGA/SVGA
8 256 color VGA/SVGA
16 32768 color SVGA
32 256 color plane mode (mode X)
For example:
make -DPLANES=12
will build a DJGPP library which only includes support for 16 and 256
color video modes.
To rebuild the Turbo C version of the library a copy of TASM is also
needed, as the library contains a significant amount of in-line assembly
code.
Compiling the test programs
===========================
The makefile in the test directory accepts the following arguments:
1) make build all DJGPP test programs
2) make turboc build all Turbo C test programs
3) make <prog>. build a single DJGPP test program
4) make <prog>.exe build a single Turbo C test program
See the accompanying document "tests.doc" on how to run the test programs.
Low-level video RAM access support
==================================
When 'GrSetMode' is called it finally ends up making a call to the mode
set routine of the graphics driver which knows about the capabilities of
the card, and how to put the card into the desired mode. (This is card
dependent -- that's why there are so many drivers.)
Having done this, the driver returns a status word to the library
which specifies the MEMORY ORGANIZATION of the selected graphics mode.
There are MUCH FEWER possible memory organizations than video drivers. The
currently supported memory organizations in LIBGRX are the following:
256 color VGA
16 color EGA/VGA/SVGA
32768 color SVGA
8514/A and S3 hardware accelerated video RAM access
The following two memory organizations are not supported yet, but stubs
have been included for them in the library:
monochrome (Hercules, CGA 640x200 mode, EGA, VGA)
VGA 256 color plane-oriented (Mode X, Y...)
The driver status word is used to set up some global variables
describing the layout of the video memory, the number of colors, etc.. The
library contains different low-level video RAM access routines for the
different video RAM organizations. These low-level video RAM access
routines are called indirectly via function pointers. These function
pointers are set up when a graphics primitive first attempts to use them.
This means that an attempt to draw anything before the first call to
'GrSetMode' will fail miserably as the library will has no idea about the
video access method to be used.
The library source files containing the memory mode specific functions
are named as follows:
p1*.c - monochrome (currently dummies only)
p4*.c - EGA/VGA 16 color modes
p8*.c - VGA 256 color modes
ph*.c - VGA 32768 color mode
px*.c - VGA 256 color mode X (currently dummies only)
pi*.c - 8514/A and S3 256 color mode
ps*.c - a few additional S3 routines where its programming
differs from the 8514/A
Each memory mode access group contains ten files (one function in each)
which do the following:
p?init.c - global data and possibly an init function
p?pixset.c - set a single pixel
p?pixrd.c - read a single pixel
p?pixrow.c - set a pixel row
p?pixcol.c - set a pixel column
p?pixblk.c - set a rectangular pixel block
p?bitblt.c - copy a rectangular pixel block
p?line.c - draw a line
p?char.c - draw a character
p?fillp.c - fill a pixel row with a pattern
The library does all mode-specific video RAM access through these nine
functions. There is a small amount of mode specific code related to
setup and color management in the files "setmode.c", "layout.c",
"context.c" and "colors.c", other than these the rest of the library
(drawing functions, etc..) is video RAM organization independent.
If the library was built to support only a single memory organization
then the calls to the appropriate low-level functions are hard-coded into
the code (via preprocessor macros in "libgrx.h"). Additionally, in 256 and
32768 color modes some trivial pixel manipulations (read and set a single
pixel) are expanded in-line.
If the library supports more than one video RAM model then this
in-line expansion is not done, and all low-level access functions are
called via pointers. There is a dispatch routine for every low-level
service (in the files "sw*.c"). The pointers initially point to these
dispatch routines. When a dispatch routine is first called it puts the
address of the appropriate (i.e. corresponding to the current video mode)
low-level access function into the pointer and then calls it. This way the
dispatch routine gets called only the first time a video RAM access
function is used. A call to 'GrSetMode' resets the pointers to point to
the dispatch routines.
NOTE: The Turbo C low-level video RAM access routines do not support
paging. (Actually, the 32 bit routines do not support it either because it
is handled transparently by the 386's page fault mechanism and the DOS
extender.) For this reason the Turbo C version has a resolution
limitation: 320x200 in 256 color mode and 800x600 in 16 color mode. For
the same reason there is no support for the 32768 color modes in the
Turbo C version of the library. HOWEVER: the 8514/A and S3 accelerators
do not need direct video RAM access and paging. For this reason the
full resolution of these boards (1024x768x256) can be supported even in the
Turbo C version of the library.
Abstract
This document describes the graphics driver format used for DJGPP and the
LIBGRX graphics library. It also gives hints for creating a driver for an
unsupported display adapter.
Introduction
The DJGPP graphics drivers do two things:
(1) Invoke the BIOS INT 10 routine for setting up the desired graphics mode.
Different boards support different resolutions and use different mode
numbers -- that's why different drivers are needed for different boards.
(2) Implement page mapping for video modes which use more than 64K of video
memory. This is again board dependent.
Old driver format
The following C declarations describe the header of an old format DJGPP
graphics driver. Of course, real drivers are coded in assembly.
typedef unsigned short u_short;
typedef unsigned char u_char;
struct old_driver_header {
u_short mode_set_routine_offset;
u_short paging_routine_offset;
u_short paging_mode_flag; /* 0 if no separate R/W, 1 if yes */
u_short default_text_width;
u_short default_text_height;
u_short default_graphics_width;
u_short default_graphics_height;
};
The mode set routine does the following:
;--------------------------------------------------------------------------
; Entry: AX=mode selection
; 0=80x25 text
; 1=default text
; 2=text CX cols by DX rows
; 3=biggest text
; 4=320x200 graphics
; 5=default graphics
; 6=graphics CX width by DX height
; 7=biggest non-interlaced graphics
; 8=biggest graphics
; CX=width (in pixels or characters) (not always used -- depends on AX)
; DX=height
;
; NOTE: This runs in real mode, but don't mess with the segment registers.
;
; Exit: CX=width (in pixels or characters)
; DX=height
;--------------------------------------------------------------------------
The paging routine does the following:
;--------------------------------------------------------------------------
; Entry: AH=read page
; AL=write page
;
; NOTE: This runs in protected mode! Don't mess with the segment registers!
; This code must be relocatable and may not reference any data!
;
; Exit: VGA configured.
; AX,BX,CX,DX,SI,DI may be trashed
;--------------------------------------------------------------------------
The old style graphics driver structure remained unchanged for the first 16
color drivers developed for LIBGRX. The only difference is that the additional
15 bits in the third word of the header were given new meanings. (The 256
color DJGPP library only used one bit to encode the capability to map
different pages for reading and writing.) The values of these new bitfields
were assigned as to stay compatible with the existing 256 color drivers. (I.e.
the 0 value in every bitfield selects the 256 color VGA option.) The
definition of these bits (from "grdriver.h"):
#define GRD_NEW_DRIVER 0x0008 /* NEW FORMAT DRIVER IF THIS IS SET */
#define GRD_PAGING_MASK 0x0007 /* mask for paging modes */
#define GRD_NO_RW 0x0000 /* standard paging, no separate R/W */
#define GRD_RW_64K 0x0001 /* two separate 64K R/W pages */
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
/* THE FOLLOWING THREE OPTIONS ARE NOT SUPPORTED AT THIS TIME */
#define GRD_RW_32K 0x0002 /* two separate 32Kb pages */
#define GRD_MAP_128K 0x0003 /* 128Kb memory map -- some Tridents
can do it (1024x768x16 without
paging!!!)
#define GRD_MAP_EXTMEM 0x0004 /* Can be mapped extended, above 1M.
Some Tseng 4000-s can do it, NO
PAGING AT ALL!!!! */
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
#define GRD_TYPE_MASK 0xf000 /* adapter type mask */
#define GRD_VGA 0x0000 /* vga */
#define GRD_EGA 0x1000 /* ega */
#define GRD_HERC 0x2000 /* hercules */
#define GRD_8514A 0x3000 /* 8514/A or compatible */
#define GRD_S3 0x4000 /* S3 graphics accelerator */
#define GRD_PLANE_MASK 0x0f00 /* bitplane number mask */
#define GRD_8_PLANES 0x0000 /* 8 planes = 256 colors */
#define GRD_4_PLANES 0x0100 /* 4 planes = 16 colors */
#define GRD_1_PLANE 0x0200 /* 1 plane = 2 colors */
#define GRD_16_PLANES 0x0300 /* VGA with 32K colors */
#define GRD_8_X_PLANES 0x0400 /* VGA in mode X w/ 256 colors */
#define GRD_MEM_MASK 0x00f0 /* memory size mask */
#define GRD_64K 0x0010 /* 64K display memory */
#define GRD_128K 0x0020 /* 128K display memory */
#define GRD_256K 0x0030 /* 256K display memory */
#define GRD_512K 0x0040 /* 512K display memory */
#define GRD_1024K 0x0050 /* 1MB display memory */
#define GRD_192K 0x0060 /* 192K -- some 640x480 EGA-s */
#define GRD_M_NOTSPEC 0x0000 /* memory amount not specified */
An old style driver has the 'GRD_NEW_DRIVER' bit cleared. It can work with
previous versions of GO32. Of course for 16 color support the application has
to be linked with the LIBGRX library instead of the original 256 color
library.
The following additional old format graphics drivers are supplied with the
LIBGRX graphics library:
EGA16.GRD 16 color EGA driver (640x350x16 max. resolution)
VGA16.GRD 16 color standard VGA driver (640x480x16 max.
resolution)
TSENG4KN.GRD same as DJGPP's Tseng ET 4000 256 color driver, but
with added support for the 100x40 text mode. (max:
1024x768x256)
TSENG416.GRD Tseng ET 4000 16 color driver. (max: 1024x768x16)
TRID89N.GRD Trident 8900 256 color driver. This driver has an
updated paging routine which seems to fix some
previous problems on boards with recent enough
chipsets. (max: 1024x768x256)
TRID8916.GRD: Trident 8900 16 color driver (max: 1024x768x16)
New driver format
The disadvantage of the old driver format is that the number of colors is not
programmable. The new driver format solves this problem and it also gives the
application program a way to query the driver for a list of the supported text
and graphics modes. For this the driver header was extended as follows:
struct new_driver_header {
u_short mode_set_routine_offset;
u_short paging_routine_offset;
u_short driver_mode_flag; /* flag word, see bits below */
u_short default_text_width;
u_short default_text_height;
u_short default_graphics_width;
u_short default_graphics_height;
u_short default_color_number; /* NEW, may be set from environment */
u_short init_routine_offset; /* NEW, call once after drvr loaded */
u_short text_mode_table_offset; /* NEW, table of supported text modes */
u_short graphics_mode_table_offset; /* NEW, table of supported graphics modes */
};
'text_mode_table_offset' points to a table with entries as follows:
struct text_mode_entry {
u_short columns;
u_short rows;
u_short number_of_colors; /* in text mode it is mainly here to make
GCC happy with the alignments */
u_char BIOS_mode; /* BIOS mode number. Mode not available on
the current card if this field is 0xff. */
u_char special; /* if non zero then the driver does some
special hacks to set it up (like
the 50 row mode on a standard VGA) */
};
The end of the table is marked by an all 0 entry. The table entries are sorted
by increasing size. The field 'graphics_mode_table_offset' points to a table
with entries as follows:
struct graphics_mode_entry {
u_short width;
u_short height;
u_short number_of_colors;
u_char BIOS_mode; /* BIOS mode number. Mode not available on
the current card if this field is 0xff.
(This may happen for example if the card
is not fully populated with RAM) */
u_char special; /* if non zero then the driver does some
special hacks to set it up (like
setting up the 32768 color mode on
some ET4000 cards) */
};
The end of the table is marked by an all 0 entry. The table is sorted by
increasing color number and within the same color modes by increasing size.
If the driver is of the new type then it also supports an initialization
routine. This is called once after the driver is loaded. The initialization
routine can do one or more of the following:
(1) Check whether the video card is of the expected type
(2) Determine the amount of video memory on board.
(3) Determine which of the modes in the text and graphics mode tables are
actually available (due to video RAM and possibly DAC [32768 colors!!]
limitations) and mark the unavailable entries in the tables.
To use the new format drivers a recent version of GO32 (1.06, after the middle
of April 1992) has to be used. Such versions should recognize the "nc
<number>" option field in the GO32 environment variable which specifies the
default number of colors for the driver.
The following new format drivers have been included with the LIBGRX library
(new drivers have the ".GRN" extension):
STDEGA.GRN standard EGA 16 color driver
STDVGA.GRN standard VGA 16 and 256 color driver
ET4000.GRN Tseng ET 4000 16 256 and 32768 color driver
TR8900.GRN Trident 8900 16 and 256 color driver
ATIULTRA.GRN Driver for the ATI ULTRA board. This board actually
contains two graphics adapters: a 512 KByte SVGA board
and a 8514/A compatible accelerator. The driver was
programmed to use the VGA part for text, 16 color
graphics, and low resolution 256 color graphics modes
and the 8514/A part for high resolution 256 color
modes. This driver should work with any VGA+8514/A
(the 8514/A MUST have 1MB memory for 1024x768
resolution) combination as long as the ATI-specific
modes of the VGA part are not used.
STEALTH.GRN Driver for the Diamond Stealth S3 graphics accelerator
board. The driver was programmed to use VGA-style video RAM
access for text, 16 color graphics, and low resolution 256
color graphics modes and the S3 accelarator functions for
high resolution 256 color modes. Currently no 32768 color
modes are supported on S3 boards. This driver should work
with other S3-based boards which have a VESA BIOS.
Creating a driver for an unsupported board
You can only use EGA or VGA boards in 16 256 or 32768 color modes with the
graphics library. In the near future there will be support for Hercules boards
as well. SUPPORT IS NOT PLANNED FOR: BOARDS WITH ON-BOARD GRAPHICS PROCESSORS
(TIGA, 8514A, etc...) To create a driver for an unsupported EGA or VGA board
you will need the followings:
(1) An assembler (TASM or MASM), a linker (TLINK or LINK) and a utility to
convert .EXE files to the .COM format (EXE2BIN). See also the 'makefile'
in the 'drivers' sub-directory.
(2) A documentation of the board containing the supported BIOS mode numbers
and resolutions.
(3) If the driver needs to support modes which use a memory map bigger than
64K then you also need a piece of code which does page switching on your
board. (Any mode above 800x600 in 16 colors or 320x200 in 256 colors
DOES USE paging.) Possible sources:
- a working, tested 256 color original DJGPP driver (if you just
want to convert it to the new format).
- VGAKIT.ZIP (available from various archive sites, like wuarchive,
simtel, etc...)
- various books on the subject.
It is best to start with the source of a driver supporting similar resolutions
as your board. Use the proper format driver, i.e. if you want a new format
driver start with a new original, etc... Typically the driver sources are
relatively well commented. What you need to do is:
(1) possibly change the option word at the head of the driver to indicate
the number of colors (old format only), the amount of memory on board,
the memory mapping capabilities of the board.
(2) change the mode setting code to use the proper BIOS mode numbers. In the
old format drivers these are somewhat scattered throughout the code, in
the new format drivers you need to edit a few tables only.
(3) Replace the paging routine with the one suitable for your board. If your
driver supports 16 color resolutions beyond 800x600 then you have to
make sure that upon exit from the paging routine the graphics controller
port's (0x3ce) index register is reset to 8. (See the paging routine in
"TR8900.ASM".) If the paging mechanism does not use any register
accessed through the graphics controller port, then you don't need to
worry about this.

View file

@ -1,487 +0,0 @@
THIS FILE IS UNDER CONSTRUCTION!!!!!
DON'T READ IT. IF YOU WANT TO SEE THE INTERNALS OF GRX 2.0 CONSULT THE
SOURCE!
Abstract
========
This document describes contains information necessary for rebuilding
the LIBGRX graphics library. Additionally, it describes some internal
details of the library associated with way it accesses the video RAM. This
info might be useful for adding support for new graphics adapter types.
How to rebuild the library
==========================
The LIBGRX library is built using the Turbo C MAKE. (TC++ 1.01
professional was used.) If an other MAKE has to be used it has to provide
some method for generating response files from long command lines. The
makefiles may have to be changed from the Turbo C MAKE response file
syntax to the syntax of the new MAKE. Additionally, the Turbo C MAKE
provides a C preprocessor-like conditional syntax. If the new MAKE utility
does not support this, the desired option has to be hard-coded.
The makefile in the base directory of the package (typically it is
....djgpp\contrib\libgrx) can be invoked as follows:
1) make build DJGPP libraries, and the drivers
2) make turboc build Turbo C libraries
3) make test (1+) build DJGPP test programs
4) make turbotst (2+) build Turbo C test programs
5) make install copy .h and .a files into DJGPP dirs
6) make clean clean up after recompiling
All graphics library sources are in the 'src' directory. The makefile
in that directory can also be used to build a customized version of the
library. Customized libraries (and the executable built using them) can be
smaller, because they don't include support for all video RAM access
methods. (see later) The makefile in the src directory can be used as
follows:
make -DPLANES=<value>
-- or --
make -DPLANES=<value> [-DMODEL=<memory model>] turboc
The value of the PLANES macro determines the included video RAM access
methods. This is a number obtained by OR-ing together the following
values:
1 monochrome (Hercules)
4 16 color EGA/VGA/SVGA
8 256 color VGA/SVGA
16 32768 color SVGA
32 256 color plane mode (mode X)
For example:
make -DPLANES=12
will build a DJGPP library which only includes support for 16 and 256
color video modes.
To rebuild the Turbo C version of the library a copy of TASM is also
needed, as the library contains a significant amount of in-line assembly
code.
Compiling the test programs
===========================
The makefile in the test directory accepts the following arguments:
1) make build all DJGPP test programs
2) make turboc build all Turbo C test programs
3) make <prog>. build a single DJGPP test program
4) make <prog>.exe build a single Turbo C test program
See the accompanying document "tests.doc" on how to run the test programs.
Low-level video RAM access support
==================================
When 'GrSetMode' is called it finally ends up making a call to the mode
set routine of the graphics driver which knows about the capabilities of
the card, and how to put the card into the desired mode. (This is card
dependent -- that's why there are so many drivers.)
Having done this, the driver returns a status word to the library
which specifies the MEMORY ORGANIZATION of the selected graphics mode.
There are MUCH FEWER possible memory organizations than video drivers. The
currently supported memory organizations in LIBGRX are the following:
256 color VGA
16 color EGA/VGA/SVGA
32768 color SVGA
8514/A and S3 hardware accelerated video RAM access
The following two memory organizations are not supported yet, but stubs
have been included for them in the library:
monochrome (Hercules, CGA 640x200 mode, EGA, VGA)
VGA 256 color plane-oriented (Mode X, Y...)
The driver status word is used to set up some global variables
describing the layout of the video memory, the number of colors, etc.. The
library contains different low-level video RAM access routines for the
different video RAM organizations. These low-level video RAM access
routines are called indirectly via function pointers. These function
pointers are set up when a graphics primitive first attempts to use them.
This means that an attempt to draw anything before the first call to
'GrSetMode' will fail miserably as the library will has no idea about the
video access method to be used.
The library source files containing the memory mode specific functions
are named as follows:
p1*.c - monochrome (currently dummies only)
p4*.c - EGA/VGA 16 color modes
p8*.c - VGA 256 color modes
ph*.c - VGA 32768 color mode
px*.c - VGA 256 color mode X (currently dummies only)
pi*.c - 8514/A and S3 256 color mode
ps*.c - a few additional S3 routines where its programming
differs from the 8514/A
Each memory mode access group contains ten files (one function in each)
which do the following:
p?init.c - global data and possibly an init function
p?pixset.c - set a single pixel
p?pixrd.c - read a single pixel
p?pixrow.c - set a pixel row
p?pixcol.c - set a pixel column
p?pixblk.c - set a rectangular pixel block
p?bitblt.c - copy a rectangular pixel block
p?line.c - draw a line
p?char.c - draw a character
p?fillp.c - fill a pixel row with a pattern
The library does all mode-specific video RAM access through these nine
functions. There is a small amount of mode specific code related to
setup and color management in the files "setmode.c", "layout.c",
"context.c" and "colors.c", other than these the rest of the library
(drawing functions, etc..) is video RAM organization independent.
If the library was built to support only a single memory organization
then the calls to the appropriate low-level functions are hard-coded into
the code (via preprocessor macros in "libgrx.h"). Additionally, in 256 and
32768 color modes some trivial pixel manipulations (read and set a single
pixel) are expanded in-line.
If the library supports more than one video RAM model then this
in-line expansion is not done, and all low-level access functions are
called via pointers. There is a dispatch routine for every low-level
service (in the files "sw*.c"). The pointers initially point to these
dispatch routines. When a dispatch routine is first called it puts the
address of the appropriate (i.e. corresponding to the current video mode)
low-level access function into the pointer and then calls it. This way the
dispatch routine gets called only the first time a video RAM access
function is used. A call to 'GrSetMode' resets the pointers to point to
the dispatch routines.
NOTE: The Turbo C low-level video RAM access routines do not support
paging. (Actually, the 32 bit routines do not support it either because it
is handled transparently by the 386's page fault mechanism and the DOS
extender.) For this reason the Turbo C version has a resolution
limitation: 320x200 in 256 color mode and 800x600 in 16 color mode. For
the same reason there is no support for the 32768 color modes in the
Turbo C version of the library. HOWEVER: the 8514/A and S3 accelerators
do not need direct video RAM access and paging. For this reason the
full resolution of these boards (1024x768x256) can be supported even in the
Turbo C version of the library.
Abstract
This document describes the graphics driver format used for DJGPP and the
LIBGRX graphics library. It also gives hints for creating a driver for an
unsupported display adapter.
Introduction
The DJGPP graphics drivers do two things:
(1) Invoke the BIOS INT 10 routine for setting up the desired graphics mode.
Different boards support different resolutions and use different mode
numbers -- that's why different drivers are needed for different boards.
(2) Implement page mapping for video modes which use more than 64K of video
memory. This is again board dependent.
Old driver format
The following C declarations describe the header of an old format DJGPP
graphics driver. Of course, real drivers are coded in assembly.
typedef unsigned short u_short;
typedef unsigned char u_char;
struct old_driver_header {
u_short mode_set_routine_offset;
u_short paging_routine_offset;
u_short paging_mode_flag; /* 0 if no separate R/W, 1 if yes */
u_short default_text_width;
u_short default_text_height;
u_short default_graphics_width;
u_short default_graphics_height;
};
The mode set routine does the following:
;--------------------------------------------------------------------------
; Entry: AX=mode selection
; 0=80x25 text
; 1=default text
; 2=text CX cols by DX rows
; 3=biggest text
; 4=320x200 graphics
; 5=default graphics
; 6=graphics CX width by DX height
; 7=biggest non-interlaced graphics
; 8=biggest graphics
; CX=width (in pixels or characters) (not always used -- depends on AX)
; DX=height
;
; NOTE: This runs in real mode, but don't mess with the segment registers.
;
; Exit: CX=width (in pixels or characters)
; DX=height
;--------------------------------------------------------------------------
The paging routine does the following:
;--------------------------------------------------------------------------
; Entry: AH=read page
; AL=write page
;
; NOTE: This runs in protected mode! Don't mess with the segment registers!
; This code must be relocatable and may not reference any data!
;
; Exit: VGA configured.
; AX,BX,CX,DX,SI,DI may be trashed
;--------------------------------------------------------------------------
The old style graphics driver structure remained unchanged for the first 16
color drivers developed for LIBGRX. The only difference is that the additional
15 bits in the third word of the header were given new meanings. (The 256
color DJGPP library only used one bit to encode the capability to map
different pages for reading and writing.) The values of these new bitfields
were assigned as to stay compatible with the existing 256 color drivers. (I.e.
the 0 value in every bitfield selects the 256 color VGA option.) The
definition of these bits (from "grdriver.h"):
#define GRD_NEW_DRIVER 0x0008 /* NEW FORMAT DRIVER IF THIS IS SET */
#define GRD_PAGING_MASK 0x0007 /* mask for paging modes */
#define GRD_NO_RW 0x0000 /* standard paging, no separate R/W */
#define GRD_RW_64K 0x0001 /* two separate 64K R/W pages */
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
/* THE FOLLOWING THREE OPTIONS ARE NOT SUPPORTED AT THIS TIME */
#define GRD_RW_32K 0x0002 /* two separate 32Kb pages */
#define GRD_MAP_128K 0x0003 /* 128Kb memory map -- some Tridents
can do it (1024x768x16 without
paging!!!)
#define GRD_MAP_EXTMEM 0x0004 /* Can be mapped extended, above 1M.
Some Tseng 4000-s can do it, NO
PAGING AT ALL!!!! */
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
#define GRD_TYPE_MASK 0xf000 /* adapter type mask */
#define GRD_VGA 0x0000 /* vga */
#define GRD_EGA 0x1000 /* ega */
#define GRD_HERC 0x2000 /* hercules */
#define GRD_8514A 0x3000 /* 8514/A or compatible */
#define GRD_S3 0x4000 /* S3 graphics accelerator */
#define GRD_PLANE_MASK 0x0f00 /* bitplane number mask */
#define GRD_8_PLANES 0x0000 /* 8 planes = 256 colors */
#define GRD_4_PLANES 0x0100 /* 4 planes = 16 colors */
#define GRD_1_PLANE 0x0200 /* 1 plane = 2 colors */
#define GRD_16_PLANES 0x0300 /* VGA with 32K colors */
#define GRD_8_X_PLANES 0x0400 /* VGA in mode X w/ 256 colors */
#define GRD_MEM_MASK 0x00f0 /* memory size mask */
#define GRD_64K 0x0010 /* 64K display memory */
#define GRD_128K 0x0020 /* 128K display memory */
#define GRD_256K 0x0030 /* 256K display memory */
#define GRD_512K 0x0040 /* 512K display memory */
#define GRD_1024K 0x0050 /* 1MB display memory */
#define GRD_192K 0x0060 /* 192K -- some 640x480 EGA-s */
#define GRD_M_NOTSPEC 0x0000 /* memory amount not specified */
An old style driver has the 'GRD_NEW_DRIVER' bit cleared. It can work with
previous versions of GO32. Of course for 16 color support the application has
to be linked with the LIBGRX library instead of the original 256 color
library.
The following additional old format graphics drivers are supplied with the
LIBGRX graphics library:
EGA16.GRD 16 color EGA driver (640x350x16 max. resolution)
VGA16.GRD 16 color standard VGA driver (640x480x16 max.
resolution)
TSENG4KN.GRD same as DJGPP's Tseng ET 4000 256 color driver, but
with added support for the 100x40 text mode. (max:
1024x768x256)
TSENG416.GRD Tseng ET 4000 16 color driver. (max: 1024x768x16)
TRID89N.GRD Trident 8900 256 color driver. This driver has an
updated paging routine which seems to fix some
previous problems on boards with recent enough
chipsets. (max: 1024x768x256)
TRID8916.GRD: Trident 8900 16 color driver (max: 1024x768x16)
New driver format
The disadvantage of the old driver format is that the number of colors is not
programmable. The new driver format solves this problem and it also gives the
application program a way to query the driver for a list of the supported text
and graphics modes. For this the driver header was extended as follows:
struct new_driver_header {
u_short mode_set_routine_offset;
u_short paging_routine_offset;
u_short driver_mode_flag; /* flag word, see bits below */
u_short default_text_width;
u_short default_text_height;
u_short default_graphics_width;
u_short default_graphics_height;
u_short default_color_number; /* NEW, may be set from environment */
u_short init_routine_offset; /* NEW, call once after drvr loaded */
u_short text_mode_table_offset; /* NEW, table of supported text modes */
u_short graphics_mode_table_offset; /* NEW, table of supported graphics modes */
};
'text_mode_table_offset' points to a table with entries as follows:
struct text_mode_entry {
u_short columns;
u_short rows;
u_short number_of_colors; /* in text mode it is mainly here to make
GCC happy with the alignments */
u_char BIOS_mode; /* BIOS mode number. Mode not available on
the current card if this field is 0xff. */
u_char special; /* if non zero then the driver does some
special hacks to set it up (like
the 50 row mode on a standard VGA) */
};
The end of the table is marked by an all 0 entry. The table entries are sorted
by increasing size. The field 'graphics_mode_table_offset' points to a table
with entries as follows:
struct graphics_mode_entry {
u_short width;
u_short height;
u_short number_of_colors;
u_char BIOS_mode; /* BIOS mode number. Mode not available on
the current card if this field is 0xff.
(This may happen for example if the card
is not fully populated with RAM) */
u_char special; /* if non zero then the driver does some
special hacks to set it up (like
setting up the 32768 color mode on
some ET4000 cards) */
};
The end of the table is marked by an all 0 entry. The table is sorted by
increasing color number and within the same color modes by increasing size.
If the driver is of the new type then it also supports an initialization
routine. This is called once after the driver is loaded. The initialization
routine can do one or more of the following:
(1) Check whether the video card is of the expected type
(2) Determine the amount of video memory on board.
(3) Determine which of the modes in the text and graphics mode tables are
actually available (due to video RAM and possibly DAC [32768 colors!!]
limitations) and mark the unavailable entries in the tables.
To use the new format drivers a recent version of GO32 (1.06, after the middle
of April 1992) has to be used. Such versions should recognize the "nc
<number>" option field in the GO32 environment variable which specifies the
default number of colors for the driver.
The following new format drivers have been included with the LIBGRX library
(new drivers have the ".GRN" extension):
STDEGA.GRN standard EGA 16 color driver
STDVGA.GRN standard VGA 16 and 256 color driver
ET4000.GRN Tseng ET 4000 16 256 and 32768 color driver
TR8900.GRN Trident 8900 16 and 256 color driver
ATIULTRA.GRN Driver for the ATI ULTRA board. This board actually
contains two graphics adapters: a 512 KByte SVGA board
and a 8514/A compatible accelerator. The driver was
programmed to use the VGA part for text, 16 color
graphics, and low resolution 256 color graphics modes
and the 8514/A part for high resolution 256 color
modes. This driver should work with any VGA+8514/A
(the 8514/A MUST have 1MB memory for 1024x768
resolution) combination as long as the ATI-specific
modes of the VGA part are not used.
STEALTH.GRN Driver for the Diamond Stealth S3 graphics accelerator
board. The driver was programmed to use VGA-style video RAM
access for text, 16 color graphics, and low resolution 256
color graphics modes and the S3 accelarator functions for
high resolution 256 color modes. Currently no 32768 color
modes are supported on S3 boards. This driver should work
with other S3-based boards which have a VESA BIOS.
Creating a driver for an unsupported board
You can only use EGA or VGA boards in 16 256 or 32768 color modes with the
graphics library. In the near future there will be support for Hercules boards
as well. SUPPORT IS NOT PLANNED FOR: BOARDS WITH ON-BOARD GRAPHICS PROCESSORS
(TIGA, 8514A, etc...) To create a driver for an unsupported EGA or VGA board
you will need the followings:
(1) An assembler (TASM or MASM), a linker (TLINK or LINK) and a utility to
convert .EXE files to the .COM format (EXE2BIN). See also the 'makefile'
in the 'drivers' sub-directory.
(2) A documentation of the board containing the supported BIOS mode numbers
and resolutions.
(3) If the driver needs to support modes which use a memory map bigger than
64K then you also need a piece of code which does page switching on your
board. (Any mode above 800x600 in 16 colors or 320x200 in 256 colors
DOES USE paging.) Possible sources:
- a working, tested 256 color original DJGPP driver (if you just
want to convert it to the new format).
- VGAKIT.ZIP (available from various archive sites, like wuarchive,
simtel, etc...)
- various books on the subject.
It is best to start with the source of a driver supporting similar resolutions
as your board. Use the proper format driver, i.e. if you want a new format
driver start with a new original, etc... Typically the driver sources are
relatively well commented. What you need to do is:
(1) possibly change the option word at the head of the driver to indicate
the number of colors (old format only), the amount of memory on board,
the memory mapping capabilities of the board.
(2) change the mode setting code to use the proper BIOS mode numbers. In the
old format drivers these are somewhat scattered throughout the code, in
the new format drivers you need to edit a few tables only.
(3) Replace the paging routine with the one suitable for your board. If your
driver supports 16 color resolutions beyond 800x600 then you have to
make sure that upon exit from the paging routine the graphics controller
port's (0x3ce) index register is reset to 8. (See the paging routine in
"TR8900.ASM".) If the paging mechanism does not use any register
accessed through the graphics controller port, then you don't need to
worry about this.

View file

@ -1,104 +0,0 @@
****************
** README.NEW **
****************
Introduction
------------
This is an updated (beta) version of the GRX v2.0 graphics library.
New features are :
- Pattern Filled functions
ex.: GrPatternFilledCircle(xc,yc,r,p);
- Patterned Line functions
ex.: GrPatternedCircle(xc,yc,r,lp);
- Custom Line functions
ex.: GrCustomLine(x1,y1,x2,y2,lo);
- User Coordinates functions
ex.: GrUsrFilledEllipse(xc,yc,xa,ya,c);
These features have been ported to GRX v2.0 from previous versions
in the GRX v1.03. However some functions had to be entirely rewritten
for compatibility with the new version of the library.
For more informations on these functions, see the documentation located
in the 'doc/' subdirectory, or edit the 'grx20.h' file to see how to use
the functions.
Library
-------
A compiled version of the library (with Djgpp v2.01) is supplied with
this upgrade and is located in the lib/ subdirectory as the 'libgrx20.a'
file. The file 'libgrx20.bk2' also present is a backup of the library
of the previous version of GRX20 (without the new features).
The library can be recompiled by 'make' in the root directory :
make libs
If you don't want these new features, you can compile the previous
version of the library with the command line
make previous
In case of bugs, this can be useful.
After compiling the library, you can clean the directory (by deleting
all the objects files in the 'src/' subdirectory with the command line
make clean
so you keep only the archive file on your disk. It can save a little
amount of memory.
Installing
----------
With the line command
make install
in the root directory of GRX20 'make' will copy the include files in the
'include/' directory of DJGPP and the library file in the 'lib/' directory.
Testing
-------
For compiling the tests programs, just type the line command
make test
This will compile the library and the tests programs supplied in the
'test/' subdirectory of GRX20. These tests are those supplied with the
previous version. No tests are already available for the new features
of the library. But testing these shouldn't be very difficult ...
Check your bookmarks, maybe I can release some tests soon !
Conclusion
----------
I have not completely tested the library, but it passed all the tests
I made on it (and there were a lot of tests). However, if you encounter
some problems in using these new functions, you may contact me at this
address :
goffioul@emic.ucl.ac.be
Please send the most reduced code which shows the bug with your message,
so I can test it for myself.
I hope you'll enjoy these new features which I missed sometimes (and
I think I was not the only one ...).

View file

@ -1,157 +0,0 @@
Hi,
the official public release GRX v2.2 is available from
http://www.techfak.uni-kiel.de/~hsc/GRX/grx22.zip
and soon from any SimTel mirror in the DJGPP/v2tk
directory.
Thanks to a lot of work by
Csaba Biegl (csaba@vuse.vanderbilt.edu)
of course and
Mauro Condarelli (mc5686@mclink.it)
Christian Domp (alma.student.uni-kl.de)
Michael Goffioul (goffioul@emic.ucl.ac.be)
Sven Hilscher (Sven@rufus.central.de)
Andrzej Lawa [FidoNet: Andrzej Lawa 2:480/19.77]
Ulrich Leodolter (ulrich@lab1.psy.univie.ac.at)
Hartmut Schirmer (hsc@techfak.uni-kiel.de)
Daniel Skarda (0rfelyus@atrey.karlin.mff.cuni.cz)
and others (see doc/credits.doc) the GRX library is now
greatly enhanced.
Compared with the grx20.zip from DJ-dirs this release provides:
---------------------------------------------------------------
- user coordinates (by Michael)
- pattern filling (by Michael)
- custom lines (by Michael)
- Linux support [svgalib && X11 (Ulrich) support and other
things Csaba mentions in credits.doc ]
- reorganized font support (Csaba)
- linkable bitmap fonts (Csaba)
- Borland vector fonts (Csaba)
- VESA 2.0 and svgalib linear frame buffer support
- VESA 2.0 8bit DAC support
- various driver speed ups
- slightly changed color interface (by Michael for better
MGUI support)
- GNU-Pascal support (by Sven)
What's currently untested:
--------------------------
- LFB32H frame driver
- svgalib linear frame buffer support
- X11 driver is supposed to work but couldn't test this
- svgalib/X11 on non i386 platforms
What's missing:
---------------
- documentation
- VESA 2.0 protected mode virtual screen support
Installation for DJGPP:
-----------------------
Unpack the grx22.zip archive in your DJGPP v2 root directory
by 'pkunzip -d grx22.zip' or 'unzip grx22.zip'
Edit your DJGPP.ENV file.
a. delete all references to GRX v2.0 or v2.1
b. In the [cpp] section append
;%DJDIR%/contrib/grx22/include
to C_INCLUDE_PATH and CPLUS_INCLUDE_PATH variables
c. In the [gcc] section append
;%DJDIR%/contrib/grx22/lib
to the LIBRARY_PATH entry
d. GNU-Pascal users need to change [gpc-cpp] and
[gpc] sections too.
e. Make sure the GRXFONT environment variable is set,
otherwise add
+GRXFONT=%DJDIR%/contrib/grx22/fonts
at top of DJGPP.ENV
Check GRX v2.2
a. go to DJDIR/contrib/grx22 and check makedefs.gnu and
makedefs.dj2 for your system requirements (default
should work well on average system )
b. go to the test subdir and build the test files:
make -f makefile.dj2
c. run the tests
Recompile your own programs with GRX v2.2!
Installation for Linux:
-----------------------
Unpack the grx22.zip archive in a temporary directory
using 'unzip -L -a grx22.zip'. Make sure all .fnt
files where extracted in binary mode! Go to contrib
subdir and move the grx22 tree to /usr/src
Delete the DJGPP .a file in the grx22/lib subdir.
Many GRX based programs need to access the font file.
Either make the /usr/src/grx22/fonts subdir readable
to anyone running GRX programs or copy the fonts subdir
to a place where anyone can access it (I placed the
fonts in /usr/local/grx-fonts on my system)
Make sure the GRXFONT environment variable points to
the fonts directory.
In /usr/src/grx22 check the default settings in
makedefs.gnu and makedefs.x11
To build the SVGALIB based GRX v2.2 run
make -f makefile.lnx
To build the X11 based GRX v2.2 run
make -f makefile.x11
Check the by running the (static linked) test programs.
If everything works well, copy the .a and .so library
files to a system lib dir, eg. /usr/local/lib and
generate symbolic links for the shared libraries:
libgrx20.so -> libgrx20.so.2.2.0
libgrx20X.so -> libgrx20X.so.2.2.0
Copy the files from grx22/include and grx22/compat to
an include dir (eg. /usr/local/include)
Make sure all installed files are readable everyone
compiling/running GRX based programs.
Now GRX v2.2 should be ready for your programs !
Important:
----------
Due to slight changes in grx20.h you'll have to recompile
your programs. Just relinking it won't work in most cases.
Help:
-----
If you find a bug in GRX v2.2, if GRX doesn't work on
your system or if you have any other question concerning
GRX, please contact me by e-mail:
hsc@techfak.uni-kiel.de
For DJGPP based systems you might also check the DJGPP
news group:
comp.os.msdos.djgpp
Hartmut Schirmer

View file

@ -1,120 +0,0 @@
GRX installation instructions
=============================
Requirements:
-------------
The source files: grx23.zip
The fonts : grx23fnt.zip
This document : grx23rme.1st
Currently GRX directly supports the following platforms:
DOS / DJGPP v1.12 (GCC 2.6.3)
DOS / DJGPP v2.01 (GCC 2.6.3, 2.7.2 and 2.8.1)
DOS / Borland C++ (v2.0, v3.1 and v4.52 checked)
DOS / Turbo C (v1.0)
DOS / Watcom C++ (v11.0 checked, 32bit only)
Linux / svgalib (GCC 2.7.2, 2.8.1)
Linux / X11R6 (GCC 2.7.2, 2.8.1)
Solaris / X11R5 (GCC 2.7.2, SUN cc v4.1)
GRX should work on any X11R5 (or later) system after a few
changes in makedefs.gnu and makedefs.x11
Most makefiles (DJGPP and Unix systems) require GNU make
A. Unzip the GRX archives
-------------------------
1) create a directory for the GRX file tree. Examples:
DJGPP: eg. DJGPP/contrib/grx23
Linux: /usr/src/grx-2.3
2) unzip the GRX source archive in the GRX dir:
DOS : pkunzip -d grx23.zip
Unix : unzip grx23.zip
3) unzip the GRX font archive in the same base dir:
DOS : pkunzip -d grx2fnt.zip
Unix : unzip grx2fnt.zip
B. Set the environment variables
--------------------------------
1) set the default driver and graphics mode info:
SET GRX20DRV=<driver> gw <width> gh <height> nc <colors>
(very useful but not required)
Available drivers are for
DOS : stdvga, stdega, et4000, cl5426, mach64, ati28800, VESA,
memory
Linux: svgalib, memory
X11 : xwin, memory
2) set the GRX font dir.
SET GRXFONT=<directory for the GRX fonts>
This is required for GRX graphics text output. Path: <GRX base>/fonts
NOTE: You can define a default font directory when compiling GRX.
E.g, if you installed the fonts in /usr/local/lib/grx/fonts add
CCOPT += -DGRX_DEFAULT_FONT_PATH=\"/usr/local/lib/grx/fonts\"
to makedefs.gnu (Linux / GNU-make example)
C. Compiling GRX
----------------
This is only required if there's no pre-compiled GRX for your system
or you want to change GRX or the library configuration.
1) Go to GRX base dir and check the makefile and makedefs file
for your system setup
2) Switch to src sub dir and check the makefile
3) run make -f <your makefile>
(some system may need additional arguments here !)
4) if every thing worked fine go to <GRX base>/test, check the makefile
and build all test files / examples:
make -f <your makefile>
D. Testing GRX
--------------
1) go to <GRX base>/bin and run the modetest program. If you don't have
a modetest (or modtst16) binary, do step C4 first.
2) Build and run the other examples (see C4)
E. Installing GRX for your compiler
-----------------------------------
You'll either need to 1: copy some GRX files to places where your compiler
will find them or 2: change your compiler setup so it will find the GRX
files in there default place.
1) Copy the library from <GRX base>/lib/<your system> to the compiler
library directory.
Copy the header files from <GRX base>/include to your compiler include
directory
2) See compiler documentation. Either change the default compiler behaviour
(eg., change djgpp.env) or use command line switches to tell the
compiler where to find the GRX files.
F. Problems
-----------
If you have problems installing or running GRX check
http://www.techfak.uni-kiel.de/~hsc/GRX/
for updates, pre-compiled libs, ...
If this doesn't help, check your system/compiler FAQ (eg., the
DJGPP v2 FAQ is at http://www.delorie.com/djgpp/v2faq)
Check out the DJGPP newsgroup comp.os.msdos.djgpp (archive at
http://www.delorie.com/djgpp/mail-archives)
Send a problem report to comp.os.msdos.djgpp or me
(hsc@techfak.uni-kiel.de)

View file

@ -1,76 +0,0 @@
Introduction
============
This document gives a brief description of the test programs in the
'tests' sub-directory.
The test programs were not intended as a flashy demo of the capabilities
of LIBGRX. Their purpose is to test the various services of the library.
The general syntax of their usage is:
go32 <prog> [<width> <height> [<color>]] <additional arguments>
-- or for the Turbo C tests --
<prog> [<width> <height> [<color>]] <additional arguments>
The test programs typically display several screens, hitting any key
will advance to the next screen. In a few cases the keyboard is used
differently, these programs will be described below.
Description of the test programs:
=================================
MODETEST:
perform video adapter speed test and test the basic primitives
of the library.
WINTEST, WINCLIP, CLIPTEST:
test graphics contexts sub-contexts and clipping
FRAMTEST:
demo of the framed box primitive
BLITTEST:
test the bit block transfer function. First it tests the bitblt
primitive for 64 possible alignment cases in planar modes (8
possible alignments for the source and destination each). It does
this test both for forward and backward copy (it depends on
whether the source address is bigger than the destination) and
for a system RAM graphics context source. A wide and a narrow
test pattern is used. After finishing the basic tests the program
gives a demo of tiling the screen with a pattern similar to the
one in FRAMTEST.
RGBTEST:
tests the 256 color RGB mode.
COLOROPS:
tests the four write modes: SET, XOR, OR, AND
CURSTEST:
tests the graphics cursor drawing routines, Keyboard usage:
u U (up) \
d D (down) move the cursor
l L (left) capitals faster
r R (right) /
q exit program
MOUSETST:
test the mouse cursor and the rubberband cursor options.
POLYTEST:
test the polygon filling algorithm. It takes the coordinates
of the polygons from the data file "polytest.dat"
CIRCTEST:
test the circle drawing algorithm with a circle, horizontal and
vertical main axis ellipse. It draws the exact points (calculated
using FP arithmetics) in red. The 'q' key aborts the test.
TESTPATT:
tests the pattern filled graphics primitives.
NOTE: these programs can also be used as examples for the usage of the
library. As always: CONSULT THE SOURCE!!!!

View file

@ -1,80 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<h1>Known GRX problems and things that must be improved</h1>
<h2>General:</h2>
<ul>
<li>The memory driver allocates all planes in one chunk instead
of using real planes.
<p></p>
</li>
<li>Printing in 1200dpi on Laserjet supporting PCL6 doesn't work.
</li>
</ul>
<h2>Win32 driver:</h2>
<ul>
<li>Drawline can be faster. Now when we paint a long diagonal line,
the
invalidate rect is very big.
<p></p>
</li>
<li>Add a 16 bpp framedriver.
<p></p>
</li>
<li>The printing code doesn't work correctly.
</li>
</ul>
<h2>X11 driver:</h2>
<ul>
<li>Try to make GrPixel faster.
<p></p>
</li>
<li>The driver can't respond to PAINT events, so it has problems with
XFree86 v4 because the backing-store is not enabled by default. The
best solution is to have a context to save the actual window (and the
GrPixel problem can be solved too). The workaround is to add next lines
to the /etc/X11/XF86Config-4 file, in the Device section:
<p> Option "BackingStore"
</p>
<p> Option "SaveUnders"
</p>
</li>
</ul>
<h2>Linux console framebuffer driver:</h2>
<ul>
<li>Try to change modes if the underlaying framebuffer driver allow
it.
<p></p>
</li>
<li>Complete the alternate direct mouse driver (now it only handles
PS/2 and IMPS2 mice).
<p></p>
</li>
<li>Use the alternate input driver even when the Svgalib driver is
included,
so virtual consoles can be switched.
</li>
</ul>
<h2>Linux console SVGALIB driver:</h2>
<ul>
<li>Nedded alternate framedrivers for 1 and 4 bpp modes. The actual
ones are
using inport/outport instructions and doesn't work with svgalib 1.9.x
and
even with 1.4.x if the linux framebuffer is enabled.
<p></p>
</li>
</ul>
<h2>VGA DOS driver:</h2>
<ul>
<li>It can be improved a lot, replacing the generic funtions it uses.
<p></p>
</li>
<li>BitBlt to screen doens't work in 4bpp modes if the screen is not
set as the default context.
</li>
</ul>
</body>
</html>

View file

@ -1,326 +0,0 @@
BCC2GRX - Interfacing Borland based graphics programs to LIBGRX
Copyright (C) 1993-97 by Hartmut Schirmer
Copyright (C) 2002 by Dimitar Zhekov
This library is now part of the GRX graphics library.
Contact : grx@gnu.de
1. Introduction and overview
-----------------------------------------------------------------------------
The BCC2GRX was created to allow users of LIBGRX to compile graphics
programs written for Borland-C++ and Turbo-C graphics interface. C code
can be directly compiled and linked with BCC2GRX.
Using LIBGRX based graphics gives you some advantages :
- 32 bit linear memory model (except for Turbo-C and BCC / DOS)
- high resolution and high color graphics modes supported
- easy way to support new graphics adapters
- LIBGRX and BCC2GRX are free software
- most ported applications run faster
The current BCC2GRX (v2.3) does only a few error checks since it is
assumed the program was extensively tested before porting it to GRX.
BCC2GRX is not a convenient platform to develop new BGI programs. Of
course you should use native LIBGRX in such cases!
2. Differences between BGI and BCC2GRX
-----------------------------------------------------------------------------
BCC2GRX is based on LIBGRX instead of using an .bgi driver. This
introduces some differences compared with the Borland GI. The (known)
differences are listed below.
- Most LIBGRX platforms are 32 bit. An int will take 4 bytes instead of
2 with Turbo-C and BCC for DOS. If you need a 16 bit integer, change
the definition from int to short which is 16 bit on all systems.
- WHITE is a function not constant with BCC2GRX. This may cause
problems in switch () statements.
(You may use
#define WHITE 15
#include <libbcc.h>
to improve compatibility.)
- BCC2GRX can not use .bgi drivers. Installing an user driver and the
register(far)bgidriver will always cause an error.
- registerfarbgifont() and registerbgifont() are the same. Both take a
void* to the character font (whole file with header !)
- initgraph()/detectgraph() work slightly different. See below for
details.
- getmodenames() and other functions may be called before initgraph()
- character files won't be flushed at closegraph()
- NOT_PUT isn't supported.
- some constants may differ in value
- BCC2GRX's outtext() and outtextxy() do correct clipping
- some graphics primitives slightly differ in behaviour between BGI and
LIBGRX. Eg. the "saucer" in bccbgi.c putimage()/getimage() demo
looks a little different.
- the BCC2GRX header file is <libbcc.h>. You must change the #include
statements since BCC2GRX is incompatible with <graphics.h>. For
programs compatible with both Borland GI and BCC2GRX, conditional
compilation may be used:
#if defined(__MSDOS__) && defined(__TURBOC__)
# include <graphics.h>
#else
# include <libbcc.h>
#endif
and such programs should be linked with the respective library,
either Borland or GRX (but not both).
- the color constants like REG, GREEN, etc. won't work in graphics
modes with more than 256 colors. Use _ega_color(RED),
_ega_color(GREEN), etc to get the right colors
3. Some useful internals of BCC2GRX
-----------------------------------------------------------------------------
Since LIBGRX provides a flexible and powerful set of graphics primitives,
some of the basic routines are defined within bccgrx.h using "__inline__
static" functions when using a GNU-C compiler. It compiles these functions
like macros, but you can refer to their addresses. There is one exeption to
this rule: When compiling code based on a pascal program, a macro is used
for getaspectratio since the pascal and C graphics interfaces use different
calling types.
BGI has something called a 'viewport'. There are two very different
behaviors depending on the clipping flag:
If clipping is on, one introduces something like a subscreen where
(nearly) all drawing operations are done.
Otherwise the origin of the drawing coordinate system is shifted from
the top left corner to some other point on screen.
BCC2GRX always adds the origin shift to all operations. If clipping is
requested, GrSetClipBox() is called and LIBGRX restricts drawing to the
selected subscreen.
One may wonder why BCC2GRX has it's own drawpoly() function instead of
using the LIBGRX function. In BGI a polygon isn't really a polygon but may
be a union of several unconnected closed polygons. In more detail:
If the start point of a polygon is reached again, the next point
is the start point of a new polygon. No connection line is drawn.
So one may draw several closed polygons at once. I don't know whether this
behavior of the BGI is a bug or a feature, but BCC2GRX is at least
compatible ...
4. initgraph()/detectgraph()/closegraph()
-----------------------------------------------------------------------------
It's recommended to use something like the following code to
initialize the graphics interface :
int gd, gm, err;
gd = DETECT; /* or detectgraph(&gd,&gm); */
initgraph(&gd,&gm,PATH_TO_CHR_FILES);
err = graphresult();
if (err != grOk) ...
This code sets up the default graphics mode defined in the GO32 or GRX20DRV
environment variable. This code will work with Borland and GRX based BGI
code without change. BCC2GRX will treat all gd values as 'DETECT' and set
up the GRX default graphics mode.
BCC2GRX provides two new functions to select the graphics mode:
void set_BGI_mode(int *graphdriver, int *graphmode);
and
void set_BGI_mode_whc(int *graphdriver, int *graphmode,
int width, int height, int colors);
If your code requires one of the standard BGI modes, use set_BGI_mode()
with BCC2GRX:
gd = VGA; gm = VGAHI;
#ifdef __GNUC__
set_BGI_mode( &gd, &gm);
#endif
initgraph( &gd, &gm, "");
All resolutions including the SVGA modes may be set up by calling the
set_BGI_mode_whc() function:
#ifdef __GNUC__
set_BGI_mode_whc( &gd, &gm, 640, 480, 1<<24);
#else
/* BCC stuff invoking a SVGA mode, needs nonstd BGI driver */
#endif
initgraph( &gd, &gm, "");
The BCC2GRX requests the desired resolution from LIBGRX by calling
GrSetMode( GR_width_height_color_graphics, ...)
If there is no such mode in the current driver, a related one may be set up
by LIBGRX. If you program needs a special resolution (say eg. Hercules
720x348) you should check getmaxx() and getmaxy() after initgraph().
Please note that
- set_BGI_mode(HERCMONO, HERCMONOHI) uses 720x350x16 on VGA cards,
- all drivers != NATIVE_GRX behave like DETECT with BCC2GRX,
- set_BGI_mode[_whc]() sets up local variables used by initgraph() and
setgraphmode(). You may change the resolution after initgraph() done
by
gd = DETECT;
initgraph(&gd, &gm, "");
/* Default graphics mode */
....
#if defined(__TURBOC__) && defined(__MSDOS__)
/* Borland GI stuff to set up 1024x768x256 mode */
gm = ... ;
#else
set_BGI_mode_whc(&gd, &gm, 1024, 768, 256);
#endif
setgraphmode( gm);
/* Now in 1024x768x256 mode */
Starting with BCC2GRX v2.0 there are new functions:
getmodemaxcolor(int mode), getmodemaxx(int mode), getmodemaxy(int mode)
which may be called at any time, even before initgraph(). A program may
require true rgb support (32k colors or more) and at least 800x600 pixels.
The new getmodemax*() functions may be used for flexible setup:
int gd=DETECT, gm;
#if defined(__BCC2GRX__) && (__BCC2GRX__>=0x200)
#define XR 800
#define YR 600
#define CR (1<<15)
int lo,hi,x=0,y=0,c=0,i;
detectgraph(&gd,&gm);
getmoderange(gd, &lo, &hi); gm=-1;
for (i=hi;i>=lo;--i)
if (getmodemaxcolor(i)>=CR) {
if (getmodemaxx(i)==XR && getmodemaxy(i)==YR) {
gm = i; /* enough colors and exact geometry */
break; /* ==> done */
}
if (getmodemaxx(i)>=XR && getmodemaxy(i)>=YR)
gm = i;
} else break; /* no success */
if (gm<0) {
puts("Sorry, no sufficient video mode available\n");
exit(1);
}
#undef XR
#undef YR
#undef CR
#endif
initgraph(&gd,&gm,"");
The above example exploits the BCC2GRX ordering of modes:
less colors first, less total pixel count earlier, or
decide by horizontal width
Eg.:
640x480x16 // 16 < 256 available colors
320x200x256 // 64000 < 128000 total pixel
640x200x256 // 128000 < 172800 total pixel
360x480x256 // 360 < 480 horizontal pixel
480x360x256 // 172800 < 480000 total pixel
800x600x256 // 256 < 16M available colors
640x480x16M
closegraph() doesn't free any allocated memory (eg. vector fonts).
The paging routines setactivepage() and setvisualpage() are functional for
GRX v2 base BCC2GRX. Just call set_BGI_mode_pages() before calling
initgraph():
set_BGI_mode_pages(2); /* 1 or 2 valid ! */
initgraph(...);
if (graphresult() == grOk && get_BGI_mode_pages() > 1) {
/* Do cool paging stuff */
}
You can't check paging without switching into graphics mode!
Translating BCC modes by set_BGI_mode() will disable paging!
5. Using fonts
------------------------------------------------------------------------------
The BCC2GRX v1.2 or newer can link vector fonts into the .exe file.
The standard fonts are in the libbcc*.a:
_bold_font, _euro_font, _goth_font, _lcom_font
_litt_font, _sans_font, _scri_font, _simp_font
_trip_font, _tscr_font
Call registerbgifont() to enable font usage:
registerbgifont( &_bold_font);
registerbgifont( &_euro_font);
registerbgifont( &_goth_font);
registerbgifont( &_lcom_font);
registerbgifont( &_litt_font);
registerbgifont( &_sans_font);
registerbgifont( &_scri_font);
registerbgifont( &_simp_font);
registerbgifont( &_trip_font);
registerbgifont( &_tscr_font);
Of course you can also link non standard fonts:
- copy the .chr file(s) to bcc2grx/src
- goto bcc2grx and type 'make'
- add
extern int _<font_name>_font;
registerbgifont( &_<font_name>_font);
to your source
The actual BCC2GRX handels the 11 standard and up to 10 user fonts. If you
need more user fonts, you should change the definition of LastUserFont in
text.c!
Starting with BCC2GRX v1.2 you can also use the LIBGRX bitmapped fonts.
Just get a font handle and set the new text style. Eg. you may want to use
the 8x16 VGA font in high resolution graphics:
font_handle = installuserfont( "pc8x16.fnt");
settextstyle( font_handle, HORIZ_DIR, 1);
See test/ttext.c for more examples.
Please note that GRX 2.x can't scale bitmap fonts at drawing level any
longer. Before drawing a magnified DEFAULT_FONT, BCC2GRX will first set up
the required new font and keeps a pointer for later use. Due to this, you
might notice a slight delay the first time you request a magnified font.
The new GRX 2.x may use Borland vector fonts as native fonts. Managing the
resulting bitmap fonts would use much more memory than linking the font
rendering code twice, so I decided not to use the GRX font API.
Every font will be loaded only once and stay in (virtual) memory until the
program terminates. If this behaviour doesn't work with your program (eg.
something like a font editor) or you get short of memory loading hundreds
of fonts, please tell me about.
8. What's new in this release?
-----------------------------------------------------------------------------
New copyright terms: same license as the rest of GRX.
Updated for GRX 1.03 / .vdr drivers / 64K && 16M color modes
More robust library internal function naming
BLACK now is a constant
Several (minor) bug fixes
Updated for GRX v2
libbcc.h won't include GRX stuff any more
added version control __BCC2GRX__
Linux support
setactivepage()/setvisualpage() with GRX v2
For a more complete list of changes and new features check src/changes.
9. LIBGRX 2.4.5 and later
-----------------------------------------------------------------------------
Starting with LIBGRX 2.4.5, BCC2GRX supports Turbo-C and BCC. The
documentation has been updated accordingly.

View file

@ -1,31 +0,0 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename grx249um.inf
@settitle GRX 2.4.9 User's Manual
@c %**end of header
@dircategory Libraries
@direntry
* GRX: (grx). The GRX Graphics Library.
@end direntry
@setchapternewpage odd
@paragraphindent 0
@titlepage
@sp 10
@comment The title is printed in a large font.
@title GRX 2.4.9 User's Manual
@subtitle A 2D graphics library for DOS, Linux, X11 and Win32
@c The following two commands start the copyright page.
@page
@vskip 0pt plus 1filll
@end titlepage
@include grx2_0.tex
@contents
@bye

File diff suppressed because it is too large Load diff

View file

@ -1,7 +0,0 @@
makeinfo --no-split grx2.tex
makeinfo --html --no-split grx2.tex
d2u grx*
texi2dvi grx2.tex
dvips grx2
d2u grx2.ps
texi2dvi --pdf grx2.tex

View file

@ -1,2 +0,0 @@
Here are files I use to generate the grxvvvum.[inf/html/dvi/pdf] file before every release.
It is no necesary to do nothing with them.

View file

@ -1,53 +0,0 @@
WATCOM C++ 11.0 Port of GRX2.2x
Contact - Gary Sands (gsands@stbni.co.uk)
The port has been caried out for a 32-bit library for DOS4GW binaries.
Compilation
--------------------------------------------
NOW HAVE REAL MAKE FILES.
The project and target files were a real pain to maintain!
Run "WMAKE -F MAKEFILE.WAT" in the GRX base directory to
build the library and test executables. The library builds
to "LIB/WATCOM32" and the tests build to "BIN". Run
"WMAKE -F MAKEFILE.WAT CLEAN" to delete the object and
link files. You may see a few warnings from the test
programs - DON'T PANIC. The WATCOM compiler is just very
pedantic.
Running "WMAKE DEBUG=1 -F MAKEFILE.WAT" should make a
debug build of the library.
If you want to make your own .PRJ and .TGT files for the IDE
remember to compile everything with __MSDOS__ and
SMALL_STACK defined (-d option in source options). There
may be a few more definitions necessary. Check the top level
makefile to see what the compiler options are if you have
problems or see a large amount of warning messages.
What works
--------------------------------------------
All the test programs shipped with GRX2.29 should work.
VBE2 Protected Mode Interface and Linear Frame Buffer Support now
compile and work. Don't forget to copy any .DAT files the test
programs need to the "BIN" directory.
What does not work
--------------------------------------------
16-bit Real Mode Library - I have not looked at it yet.
// Added a few fixes for 16-bit mode but not finished. HSC
What needs to be done
--------------------------------------------
Speed enhancements - need Watcom versions of the DJGPP/GNU inline
assembly routines. In particular the line drawing and fill algorithms.
Some of the fills have been written by Hartmut. He has put a lot of
effort turning my hacks for Watcom into a structured part of GRX and
deserves most of the credit for this port.
** REMEMBER THAT THE DEFAULT STACK SIZE IS 3K SO YOU MAY HAVE TO
ADJUST THAT IN THE LINKER OPTIONS OF YOUR EXECUTABLE - This is less
of a problem now if you define SMALL_STACK **
And of course best of luck using GRX with Watcom!

BIN
thirdparty/grx249/fonts/char11.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char11b.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char11bi.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char11i.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char14.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char14b.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char14bi.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char14i.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char16.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char16b.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char16bi.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char16i.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char18.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char18b.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char18bi.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char18i.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char23.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char23b.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char23bi.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char23i.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char30.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char30b.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char30bi.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char30i.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char40.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char40b.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char40bi.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/char40i.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/cour11.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/cour11b.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/cour11bi.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/cour11i.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/cour12.fnt (Stored with Git LFS) vendored

Binary file not shown.

BIN
thirdparty/grx249/fonts/cour12b.fnt (Stored with Git LFS) vendored

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more