Skip to content

Commit

Permalink
v2.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
JulStrat committed Mar 6, 2021
1 parent 24d268c commit bc6b5c1
Show file tree
Hide file tree
Showing 44 changed files with 1,373 additions and 386 deletions.
16 changes: 7 additions & 9 deletions BUGS
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
BUGS
----

- visualisation problems on NVIDIA GK208BM (GeForce 920M) with
nvidia-driver-450 on GNU/Linux. As far as I can say, this is an NVIDIA
- automatic refresh does not work on NVIDIA GK208BM (GeForce 920M) with
nvidia-driver-* on GNU/Linux. As far as I can say, this is an NVIDIA
driver problem.

- In MSYS2 + Mingw-w64, the getch() function may hang. This is a
problem in MSYS2/Mingw-w64 console handling.
- In MSYS2 + Mingw-w64, the getch() function may hang. Apparently,
this is a problem in MSYS2/Mingw-w64 console handling.

- According to the original BGI documentation: "If a string is printed
with the default font using outtext or outtextxy, any part of the
string that extends outside the current viewport is truncated."
SDL_bgi follows this rule, but bgidemo.c running in Turbo C 2.01 does
not. This is a Turbo C bug; please see `tmp/truncate.c`.
- in Raspbian 10 for ARM, the 'p' letter is drawn incorrectly in
SCRIPT_FONT. The bug does not affect Raspbian 10 for i386.
Reported by Ioulianos Kakoulidis.

Please report bugs if you find any.
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# CMakeLists.txt for SDL_bgi
# GG, 2020-07-08
# GG, 2021-02-24

# --- Building, thanks to cmake

cmake_minimum_required (VERSION 3.5.0)

set (SDL_BGI_VERSION 2.4.2)
set (SDL_BGI_VERSION 2.4.3)

# Project name
project (SDL_bgi VERSION ${SDL_BGI_VERSION} LANGUAGES C)
Expand Down Expand Up @@ -56,6 +56,10 @@ install (FILES AUTHORS BUGS ChangeLog INSTALL_Linux.md INSTALL_macOS.md
file (GLOB docs doc/*)
install (FILES ${docs} DESTINATION ${CMAKE_INSTALL_DOCDIR}/doc)

# Install man page
file (GLOB man doc/graphics.3.gz)
install (FILES ${man} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)

# Install test programs
file (GLOB test test/*)
install (FILES ${test} DESTINATION ${CMAKE_INSTALL_DOCDIR}/test)
Expand All @@ -80,22 +84,23 @@ set (CPACK_DEBIAN_PACKAGE_NAME "sdl_bgi")
set (CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${ARCH_DEB})
set (CPACK_DEBIAN_PACKAGE_MAINTAINER ${CONTACT})
set (CPACK_DEBIAN_PACKAGE_DESCRIPTION "BGI-compatible, SDL2-based library")
set (CPACK_DEBIAN_PACKAGE_DESCRIPTION "SDL2-based 'GRAPHICS.H' implementation")
set (CPACK_DEBIAN_PACKAGE_SECTION "libs")
set (CPACK_DEBIAN_COMPRESSION_TYPE "gzip")
set (CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set (CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl2-dev (>= 2.0.0)")

# RPM (Fedora) package
set (CPACK_RPM_PACKAGE_SUMMARY "BGI-compatible, SDL2-based library")
set (CPACK_RPM_PACKAGE_SUMMARY "SDL2-based 'GRAPHICS.H' implementation")
set (CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
set (CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
set (CPACK_PACKAGE_ARCHITECTURE ${ARCH_RPM})
set (CPACK_RPM_PACKAGE_RELEASE "1")
set (CPACK_RPM_PACKAGE_LICENSE "zlib")
set (CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
set (CPACK_RPM_PACKAGE_VENDOR "GG")
set (CPACK_RPM_PACKAGE_DESCRIPTION "SDL_bgi is a Borland Graphics Interface (BGI) emulation library based on SDL2. This library strictly emulates most BGI functions, making it possible to compile SDL versions of programs written for Turbo/Borland C. ARGB extensions and basic mouse support are also implemented; further, native SDL2 functions may be used in SDL_bgi programs.")
set (CPACK_RPM_PACKAGE_DESCRIPTION "SDL_bgi is a Borland Graphics Interface ('GRAPHICS.H') implementation based on SDL2. This library strictly emulates BGI functions, making it possible to compile SDL2 versions of programs written for Turbo C/Borland C++. ARGB colours, vector fonts, mouse support, and multiple
windows are also implemented; further, native SDL2 functions may be used in SDL_bgi programs.")
set (CPACK_RPM_PACKAGE_REQUIRES "SDL2-devel >= 2.0.0")
set (CPACK_PACKAGE_CONTACT ${CONTACT})

Expand Down
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
---------

v. 2.4.3, 2021-02-24
- modified getscreensize() behaviour (suggested by Fanourios Attard)
- added setwintitle()
- added man page (graphics.3)
- documentation fixes and updates
- changed test/simple.c to avoid getch() bug on MSYS2
- updated Windows Makefiles to SDL2-2.0.14 and latest releases of
Code::Blocks and DevCpp

v. 2.4.2, 2020-11-11
- implemented native vector fonts, compatible with Borland .CHR fonts
- implemented long-forgotten graphics error checks!
Expand Down
14 changes: 9 additions & 5 deletions INSTALL_Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ you'll also need `make` and a C compiler; `gcc` or `clang` are fine.

To compile and install `SDL_bgi`, run the following commands:

$ VERSION=2.4.2
$ VERSION=2.4.3
$ tar zxvf SDL_bgi-$VERSION.tar.gz
$ cd SDL_bgi-$VERSION/src
$ make
$ sudo make install

Files will be installed in appropriate directories:

`SDL_bgi.h` -> `/usr/include/SDL2/`
`graphics.h` -> `/usr/include/`
`libSDL_bgi.so` -> `/usr/lib/`.
SDL_bgi.h -> /usr/include/SDL2/
graphics.h -> /usr/include/
libSDL_bgi.so -> /usr/lib/


### Using `cmake`
Expand All @@ -38,7 +38,7 @@ This only works if `cmake` and `cpack` are installed.

To compile the `SDL_bgi` library and make `.deb` or `.rpm` packages:

$ VERSION=2.4.2
$ VERSION=2.4.3
$ tar zxvf SDL_bgi-$VERSION.tar.gz
$ cd SDL_bgi-$VERSION
$ ./build.sh
Expand All @@ -54,6 +54,10 @@ If you prefer the usual way:
$ cmake ..
$ make && sudo make install

To uninstall:

$ make uninstall


## Test Programs

Expand Down
70 changes: 39 additions & 31 deletions INSTALL_Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,43 @@ The following sections were tested with:
Let's assume you installed SDL2 as native package, that is
`mingw-w64-x86_64-SDL2`.

Start the MSYS2 shell, unzip the `SDL_bgi` archive, then copy
`src/graphics.h` to `/mingw64/include/`, `src/SDL_bgi.h` to
`/mingw64/include/SDL2/`, and `bin/Mingw64/SDL_bgi.dll` to
`/mingw64/bin`.
Start the MSYS2 shell, unzip the `SDL_bgi` archive, then copy:

src/graphics.h -> /mingw64/include/
src/SDL_bgi.h -> /mingw64/include/SDL2/
bin/Mingw64/SDL_bgi.dll -> /mingw64/bin

Please note that to run a program compiled with `SDL_bgi` outside of
the MSYS2 environment, you will need to copy `SDL_bgi.dll` and
`SDL2.dll` to the same directory as the program.
the MSYS2 environment (e.g. in an ordinary command prompt), you will need
to copy `SDL_bgi.dll` and `SDL2.dll` to the same directory as the program.


## Installing the Code::Blocks Binaries

Let's assume that you installed CodeBlocks in `C:\CodeBlocks` and SDL2
development libraries in in `C:\SDL2-2.0.12`. Change the following
development libraries in in `C:\SDL2-2.0.14`. Change the following
instructions as needed for your installation.

Unzip `SDL_bgi` archive, then copy `src/graphics.h` to
`C:\CodeBlocks\MinGW\include`, `src/SDL_bgi.h` to
`C:\SDL2-2.0.12\i686-w64-mingw32\include\SDL2`, and
`bin/CodeBlocks/SDL_bgi.dll` to `C:\CodeBlocks\MinGW\bin`.
Unzip `SDL_bgi` archive, then copy:

src/graphics.h -> C:\CodeBlocks\MinGW\include
src/SDL_bgi.h -> C:\SDL2-2.0.14\i686-w64-mingw32\include\SDL2
bin/CodeBlocks/SDL_bgi.dll -> C:\CodeBlocks\MinGW\bin

To learn how to compile programs, please see `howto_CodeBlocks.md`.


## Installing the Dev-C++ Binaries

Let's assume that you installed Dev-C++ in `C:\DevCpp` and SDL2
in `C:\SDL2-2.0.12`. Change the following instructions as needed for
in `C:\SDL2-2.0.14`. Change the following instructions as needed for
your installation.

Unzip `SDL_bgi` archive, then copy `src/graphics.h` to
`C:\SDL2-2.0.12\i686-w64-mingw32\include`, `src/SDL_bgi.h` to
`C:\SDL2-2.0.12\i686-w64-mingw32\include\SDL2`, and
`bin/DevCpp/SDL_bgi.dll` to `C:\DevCpp\MinGW64\bin`.
Unzip `SDL_bgi` archive, then copy:

src/graphics.h -> C:\SDL2-2.0.14\i686-w64-mingw32\include
src/SDL_bgi.h -> C:\SDL2-2.0.14\i686-w64-mingw32\include\SDL2
bin/DevCpp/SDL_bgi.dll -> C:\DevCpp\MinGW64\bin

To learn how to compile programs, please see `howto_DevCpp.md`.

Expand All @@ -67,62 +70,67 @@ install `make`, `mingw-w64-x86_64-SDL2`, and `mingw-w64-x86_64-gcc`.

$ pacman -S make mingw-w64-x86_64-SDL2 mingw-w64-x86_64-gcc
# ...
$ # expand the $PATH variable
$ # expand the $PATH variable if necessary
$ echo export PATH=/mingw64/bin:$PATH >> $HOME/.bashrc


## MSYS2 + Mingw-w64

Start the MSYS2 shell, then run the following commands:

$ VERSION=2.4.2
$ VERSION=2.4.3
$ tar zxvf SDL_bgi-$VERSION.tar.gz
$ cd SDL_bgi-$VERSION/src
$ make
$ make install

Files will be installed in these directories:

`SDL_bgi_.h` -> `/mingw64/include/SDL2/`
`graphics.h` -> `/mingw64/include/`
`SDL_bgi.dll` -> `/mingw64/bin/`
SDL_bgi.h -> /mingw64/include/SDL2/
graphics.h -> /mingw64/include/
SDL_bgi.dll -> /mingw64/bin/

To uninstall:

$ make uninstall


## MSYS2 + Code::Blocks

Start the MSYS2 shell, then run the following commands:

$ VERSION=2.4.2
$ VERSION=2.4.3
$ tar zxvf SDL_bgi-$VERSION.tar.gz
$ cd SDL_bgi-$VERSION/src
$ PATH=/c/CodeBlocks/MinGW/bin/:$PATH && make -f Makefile.CodeBlocks
$ make install

Assuming that you installed CodeBlocks in `C:\CodeBlocks` and SDL2
development libraries in in `C:\SDL2-2.0.12`, files will be installed
development libraries in in `C:\SDL2-2.0.14`, files will be installed
in these directories:

`SDL_bgi_.h` -> `C:\SDL2-2.0.12\i686-w64-mingw32\include\SDL2`
`graphics.h` -> `C:\CodeBlocks\MinGW\include`
`SDL_bgi.dll` -> `C:\CodeBlocks\MinGW\bin`
SDL_bgi_.h -> C:\SDL2-2.0.14\i686-w64-mingw32\include\SDL2
graphics.h -> C:\CodeBlocks\MinGW\include
SDL_bgi.dll -> C:\CodeBlocks\MinGW\bin


## MSYS2 + Dev-C++

Start the MSYS2 shell, then run the following commands:

$ VERSION=2.4.2
$ VERSION=2.4.3
$ tar zxvf SDL_bgi-$VERSION.tar.gz
$ cd SDL_bgi-$VERSION/src
$ PATH=/c/CodeBlocks/MinGW/bin/:$PATH && make -f Makefile.DevCpp
$ make install

Assuming that you installed Dev-C++ in `C:\DevCpp` and SDL2
development libraries in in `C:\SDL2-2.0.12`, files will be installed
development libraries in in `C:\SDL2-2.0.14`, files will be installed
in these directories:

`SDL_bgi_.h` -> `C:\SDL2-2.0.12\i686-w64-mingw32\include\SDL2`
`graphics.h` -> `C:\SDL2-2.0.12\i686-w64-mingw32\include`
`SDL_bgi.dll` -> `C:\DevCpp\MinGW64\bin`
SDL_bgi_.h -> C:\SDL2-2.0.14\i686-w64-mingw32\include\SDL2
graphics.h -> C:\SDL2-2.0.14\i686-w64-mingw32\include
SDL_bgi.dll -> C:\DevCpp\MinGW64\bin


## Test Programs
Expand Down
14 changes: 9 additions & 5 deletions INSTALL_macOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The easiest way to install `SDL_bgi` requires the Terminal, the
Full Xcode is not needed.

- open the Terminal and type `clang`. If it's missing, you'll be
prompted to install it, as part of the Command Line Tools.
prompted to install it, as part of Xcode's Command Line Tools.

- go to <https://brew.sh> and install Homebrew using the provided
command. It will take a few minutes.
Expand All @@ -24,17 +24,21 @@ You're now ready to compile `SDL_bgi`.
To compile and install `SDL_bgi`, start Terminal and run the following
commands:

% VERSION=2.4.2
% VERSION=2.4.3
% tar xvf SDL_bgi-$VERSION.tar
% cd SDL_bgi-$VERSION/src
% make
% make install

Files will be installed in these directories:

`SDL_bgi.h` -> `/usr/local/include/SDL2`
`graphics.h` -> `/usr/local/include/`
`libSDL_bgi.so` -> `/usr/local/lib/`
SDL_bgi.h -> /usr/local/include/SDL2/
graphics.h -> /usr/local/include/
libSDL_bgi.so -> /usr/local/lib/

To uninstall:

% make uninstall


## Test Programs
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ZLib License

Copyright (c) 2014-2020 Guido Gonzato, PhD
Copyright (c) 2014-2021 Guido Gonzato, PhD

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ README

`SDL_bgi` is a multiplatform, SDL2-based `GRAPHICS.H` implementation.

Its name refers to BGI, the Borland Graphics Interface that was the
The name refers to BGI, the Borland Graphics Interface that was the
'de facto' standard in PC graphics back in DOS days; it was made
popular by Borland Turbo C/C++ compilers. I wrote `SDL_bgi` because
I wanted a simple to use but fast graphics library for my experiments
Expand All @@ -14,7 +14,7 @@ in Turbo C 2.01 and Borland C++ 1.0; for instance, it compiles and
runs the original `bgidemo.c`. `SDL_bgi` also provides nearly full
compatibility with another BGI implementation, WinBGIm (see links
below). One of the aims of `SDL_bgi` is the preservation of old
software written for BGI, but not only.
software written for BGI; but not only that.

`SDL_bgi` provides graphics primitives, and is much easier to use than
plain SDL2. It should be especially useful for beginners, i.e. in
Expand All @@ -26,8 +26,8 @@ programs, too.

`SDL_bgi` should compile on any platform supported by SDL2; it has
been tested on GNU/Linux, MS Windows (MSYS2 + Mingw-w64, CodeBlocks,
Dev-C++), macOS (High Sierra and Catalina), and Raspberry Pi. A few
example programs are provided in the `test/` directory.
Dev-C++), macOS (High Sierra and Catalina), and Raspios (ARM, i386). A
few example programs are provided in the `test/` directory.

If you don't need BGI compatibility, I suggest that you check out
`SDL_gfx`, a graphics library that is more complete and more powerful
Expand Down
2 changes: 2 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
TODO
----

Nothing at the moment.

Your suggestions are welcome!
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.2
2.4.3
1 change: 1 addition & 0 deletions bin/CodeBlocks/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Built with CodeBlocks 20.03 + Mingw64
Binary file modified bin/CodeBlocks/SDL_bgi.dll
Binary file not shown.
1 change: 1 addition & 0 deletions bin/Dev-Cpp/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Built with Orwell Dev-Cpp 5.11 and TDM64-GCC 9.2.0
Binary file modified bin/Dev-Cpp/SDL_bgi.dll
Binary file not shown.
1 change: 1 addition & 0 deletions bin/Mingw64/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Built with native Mingw64 tools in MSYS2
Binary file modified bin/Mingw64/SDL_bgi.dll
Binary file not shown.
Loading

0 comments on commit bc6b5c1

Please sign in to comment.