You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
People are often surprised and dismayed to find that the GPI can be
5
-
very slow if it is used naively. One of the biggest mistakes is to try to
6
-
write a large number of pixels using GpiSetPel(). To reassure people that
7
-
fast screen writes CAN be achieved with the GPI and without needing to
8
-
go to the MMPM direct-screen support (DIVE), I have provided this little
9
-
example. As a bonus, it also shows how to use bitmaps, how to write a
10
-
multi-threaded application, how to use semaphores, and how to set up a
11
-
gray-scale palette. Also, you can learn about classical wave behavior
1
+
Name: REVOLVE
2
+
Descripcion: Demonstrates Fast GPI Graphics
3
+
Date: 2023-05-07
4
+
Version: 1.07
5
+
----------------------------
6
+
7
+
DESCRIPTION
8
+
-----------
9
+
Method for Getting Fast Graphics through the OS/2 GPI.
10
+
11
+
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
12
12
and its difference equation representation!
13
13
14
-
The basic technique for fast screen writes is to make a bitmap that
15
-
corresponds to the screen. Then, using GpiSetBitmapBits(), this bitmap
16
-
is updated and then blitted to the screen. This requires only two GPI
17
-
calls to write an arbitrary number of pixels, instead of doing a call to
18
-
set the color and a call to write the pixel for EACH pixel.
14
+
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.
19
15
20
-
Here are miscellaneous notes.
16
+
Here are miscellaneous notes.
21
17
22
18
1) The example implements a simulation of two interfering circular wave
23
19
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.
28
24
applications. I have not tried this at other resolutions, but things
29
25
should work OK (or could be easily adjusted for).
30
26
31
-
3) Built with GCC/2 2.5.4.
27
+
3) Built with GCC 9.
32
28
33
29
4) The screens are written very fast [DisplayPlane()] but there is delay
34
30
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.
48
44
8) The example is multithreaded; one thread does the model, one does the main
49
45
window handling. Down with clock icons!!!
50
46
51
-
9) Thanks to George Thiruvathakal for providing the array support package.
52
-
It makes possible the highly efficient shifting of planes required at
53
-
each epoch update (an operation not possible with straightforward
54
-
3-dimensional C array syntax).
47
+
REQUIREMENTS
48
+
------------
49
+
- yum install git gcc make libc-devel binutils watcom-wrc watcom-wlink-hll
50
+
51
+
COMPILE INSTRUCTIONS
52
+
--------------------
53
+
This version of this sample was modified to compile on ArcaOS with GCC 9 compiler.
54
+
55
+
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"
56
+
57
+
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...
58
+
SET EMXOMFLD_LINKER=wl.exe
59
+
SET EMXOMFLD_TYPE=WLINK
60
+
SET EMXOMFLD_RC_TYPE=WRC
61
+
SET EMXOMFLD_RC=wrc.exe
62
+
63
+
3) Run "make" or "make 2>&1 |tee make.out" to get the log file.
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.
55
77
56
-
10) Permission to use as a guide for your own applications. Have fun!
57
-
Feedback to:
78
+
HISTORY
79
+
----------
80
+
- 1.07 - 2023-05-07
81
+
Changed version to compile on gcc and to run on ArcaOS 5.0.7.
58
82
59
-
Donald Graft dgraft@gate.net
83
+
- 1.06 - 1988
84
+
Original version by Charles Petzold
60
85
61
-
The following files make up the example application:
86
+
LICENSE
87
+
-------
88
+
The 3-Clause BSD License.
62
89
63
-
build.cmd -- command file to build the application. Assumes GCC/2 2.5.4.
0 commit comments