-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
98 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
NAME STDPRGM WINDOWAPI | ||
;----------------------------------- | ||
; BEZIER.DEF module definition file | ||
;----------------------------------- | ||
|
||
DESCRIPTION 'Skeleton Program' | ||
HEAPSIZE 1024 | ||
NAME FASTGPI WINDOWAPI | ||
|
||
DESCRIPTION '@#OS2World:1.01#@##1## 07 May 2023 20:00:00 ARCAOS-507::::::v1.01@@Getting Fast GPI Graphics Demo.' | ||
STACKSIZE 8192 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
Method for Getting Fast Graphics through the OS/2 GPI | ||
----------------------------------------------------- | ||
|
||
People are often surprised and dismayed to find that the GPI can be | ||
very slow if it is used naively. One of the biggest mistakes is to try to | ||
write a large number of pixels using GpiSetPel(). To reassure people that | ||
fast screen writes CAN be achieved with the GPI and without needing to | ||
go to the MMPM direct-screen support (DIVE), I have provided this little | ||
example. As a bonus, it also shows how to use bitmaps, how to write a | ||
multi-threaded application, how to use semaphores, and how to set up a | ||
gray-scale palette. Also, you can learn about classical wave behavior | ||
Name: REVOLVE | ||
Descripcion: Demonstrates Fast GPI Graphics | ||
Date: 2023-05-07 | ||
Version: 1.07 | ||
---------------------------- | ||
|
||
DESCRIPTION | ||
----------- | ||
Method for Getting Fast Graphics through the OS/2 GPI. | ||
|
||
People are often surprised and dismayed to find that the GPI can be very slow if it is used naively. One of the biggest mistakes is to try to write a large number of pixels using GpiSetPel(). To reassure people that fast screen writes CAN be achieved with the GPI and without needing to go to the MMPM direct-screen support (DIVE), I have provided this little example. As a bonus, it also shows how to use bitmaps, how to write a multi-threaded application, how to use semaphores, and how to set up a gray-scale palette. Also, you can learn about classical wave behavior | ||
and its difference equation representation! | ||
|
||
The basic technique for fast screen writes is to make a bitmap that | ||
corresponds to the screen. Then, using GpiSetBitmapBits(), this bitmap | ||
is updated and then blitted to the screen. This requires only two GPI | ||
calls to write an arbitrary number of pixels, instead of doing a call to | ||
set the color and a call to write the pixel for EACH pixel. | ||
The basic technique for fast screen writes is to make a bitmap that corresponds to the screen. Then, using GpiSetBitmapBits(), this bitmap is updated and then blitted to the screen. This requires only two GPI calls to write an arbitrary number of pixels, instead of doing a call to set the color and a call to write the pixel for EACH pixel. | ||
|
||
Here are miscellaneous notes. | ||
Here are miscellaneous notes. | ||
|
||
1) The example implements a simulation of two interfering circular wave | ||
sources in two dimensions. The output is displayed with a 32-level | ||
|
@@ -28,7 +24,7 @@ set the color and a call to write the pixel for EACH pixel. | |
applications. I have not tried this at other resolutions, but things | ||
should work OK (or could be easily adjusted for). | ||
|
||
3) Built with GCC/2 2.5.4. | ||
3) Built with GCC 9. | ||
|
||
4) The screens are written very fast [DisplayPlane()] but there is delay | ||
between the screen writes due to the many thousands of floating-point | ||
|
@@ -48,22 +44,50 @@ set the color and a call to write the pixel for EACH pixel. | |
8) The example is multithreaded; one thread does the model, one does the main | ||
window handling. Down with clock icons!!! | ||
|
||
9) Thanks to George Thiruvathakal for providing the array support package. | ||
It makes possible the highly efficient shifting of planes required at | ||
each epoch update (an operation not possible with straightforward | ||
3-dimensional C array syntax). | ||
REQUIREMENTS | ||
------------ | ||
- yum install git gcc make libc-devel binutils watcom-wrc watcom-wlink-hll | ||
|
||
COMPILE INSTRUCTIONS | ||
-------------------- | ||
This version of this sample was modified to compile on ArcaOS with GCC 9 compiler. | ||
|
||
1) Remember to have correct header files your path. For GCC the correct ones are the included on the "libc-devel", not the ones from the OS/2 Toolkit. Check your config.sys for "SET INCLUDE=C:\usr\include" | ||
|
||
2) Since I'm using the Watcom Resource Compiler (open source) instead of the classic rc.exe, and the the Watcom Linker, intead of the classic ilink.exe, add to your config.sys... | ||
SET EMXOMFLD_LINKER=wl.exe | ||
SET EMXOMFLD_TYPE=WLINK | ||
SET EMXOMFLD_RC_TYPE=WRC | ||
SET EMXOMFLD_RC=wrc.exe | ||
|
||
3) Run "make" or "make 2>&1 |tee make.out" to get the log file. | ||
|
||
|
||
TOOLS USED | ||
---------- | ||
- ArcaOS - Verion 5.0.7 | ||
- wrc - Watcom Resource Compiler version 2.0beta1 | ||
- wl - Watcom Linker | ||
- gcc - gcc (GCC) 9.2.0 20190812 (OS/2 RPM build 9.2.0-5.oc00) | ||
- make - Version 3.81 k2 (2017-11-10) | ||
|
||
TROUBLESHOOT | ||
------------ | ||
The compile produce will run by just executing make on the directory, but a compile.cmd file is includes to store the log in a file. If you want to save the log file you can run it as "nmake 2>&1 |tee make.out". The log will be saved into the "make.out" file. | ||
|
||
10) Permission to use as a guide for your own applications. Have fun! | ||
Feedback to: | ||
HISTORY | ||
---------- | ||
- 1.07 - 2023-05-07 | ||
Changed version to compile on gcc and to run on ArcaOS 5.0.7. | ||
|
||
Donald Graft [email protected] | ||
- 1.06 - 1988 | ||
Original version by Charles Petzold | ||
|
||
The following files make up the example application: | ||
LICENSE | ||
------- | ||
The 3-Clause BSD License. | ||
|
||
build.cmd -- command file to build the application. Assumes GCC/2 2.5.4. | ||
fastgpi.def -- module definition file | ||
fastgpi.c -- main file | ||
fastgpi.exe -- the executable | ||
fastgpi.doc -- this file | ||
a-float.h -- header for array package | ||
a-float.c -- array package code | ||
AUTHORS | ||
------- | ||
- Martin Iturbide (2023) | ||
- Donald Graft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
REM SET C_INCLUDE_PATH=c:/usr/include;%C_INCLUDE_PATH% | ||
REM SET INCLUDE=C:\usr\include | ||
REM SET EMXOMFLD_TYPE=WLINK | ||
REM SET EMXOMFLD_LINKER=wl.exe | ||
make 2>&1 |tee make.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# nmake makefile | ||
# | ||
# Tools used: | ||
# Compile::Watcom Resource Compiler | ||
# Compile::GNU C | ||
# Make: nmake or GNU make | ||
all : fastgpi.exe | ||
|
||
fastgpi.exe : fastgpi.obj fastgpi.def a-float.obj | ||
gcc -Zomf fastgpi.obj a-float.obj fastgpi.def -o fastgpi.exe | ||
|
||
fastgpi.obj : fastgpi.c | ||
gcc -Wall -Zomf -c -O2 fastgpi.c -o fastgpi.obj | ||
|
||
a-float.obj : a-float.c a-float.h | ||
gcc -Wall -Zomf -c -O2 a-float.c -o a-float.obj | ||
|
||
clean : | ||
rm -rf *exe *RES *obj *hlp |