Silverfrost Forums

Welcome to our forums

%pl guide

27 Aug 2025 11:11 (Edited: 12 Sep 2025 12:08) #32308

I have added further examples to my %pl guide/notes, (briefly mentioned in another post). The updated document can be found here.

https://www.dropbox.com/scl/fi/va5hwcuye466z8ek73es4/pl_guide_ver3.pdf?rlkey=rdpf5it8mamaqbdcra1fhrqky&st=oulgf60x&dl=0

The 30+ examples cover many of the basic %pl options including calls to simpleplot_redraw@ to update plots and now gets as far as using the %pl callback in various ways, and the final example gives a basic recipe for plotting a function z(x,y) as a simple coloured heat map.

I shall update this thread occasionally as I progress this further.

Updated 12/09/2025

27 Aug 2025 8:11 #32309

Ken, That was great guide to the art of 2D X-Y plotting with Clearwin! Congratulations!

Was always missing such systematic collection of examples from simple to complex, ideally in the form of clipbook library so that you scroll the real examples visually, choose the needed type and in one click it is added to the source code. There with the few touches you correct some minor details. Same with other Clearwin controls. Plato would be ideal for that i think

29 Aug 2025 5:43 #32312

If somebody also translated OpenGL book of examples on FTN95 that would be great. 25 years ago one guy (his nickname I think was djip) have done translation of so called OpenGL red book from C/C++ to some other Fortran compiler but I remember I still had some problems with that in FTN95. He was very helpful with some my stuff.

It's time to move to modern 2D/3D graphics (Ken have done ultimate in details and simplicity guide for that, so the majority have to stop being Luddites, essentially ignoring most of features FTN95 is capable of) , multithreading programming, multiprocessing, GPU acceleration, use GUI etc

30 Aug 2025 11:13 #32313

Dan,

I thought that you were the current OpenGL guru.

Ken's guide is terrific, and an excellent contribution. It is, however, a 'work in progress', as I think he'd admit. There are still things I don't get. For example, how %pl works to create a window without WINAPP, and why it doesn't need USE CLRWIN until you start to add in calls to WINOP@.

FTN95.CHM is a terrific guide when you know what you are doing and just consult it for reference (ditto the .ENH files), but none of them is a self-instruction text. What's more, despite reading everything on the subject I am only beginning to understand the differences between the original, included, simpleplot, the former, purchasable add-on, and 'native'.

30 Aug 2025 6:08 #32314

You don't need WINAPP to produce Clearwin windows.

30 Aug 2025 9:32 #32315

Robert,

Now I am confused.

My FTN95.CHM tells me that the compiler directive WINAPP:

'Creates a Windows executable for use with ClearWin+ (see the ClearWin+ documentation for further information).'

(sic)

Now I discover that I don't need WINAPP to use Clearwin+. It can't be an update since the v8.95 that I'm using, because Ken's examples work ....

Eddie

1 Sep 2025 7:30 #32317

WINAPP is used to create a Windows application rather than a console application. If you run a Clearwin+ application without WINAPP (or its equivalent) then you will get a DOS box first and the app is launched from the DOS box.

1 Sep 2025 7:37 #32318

FTN95 knows about winio@ so you don't need 'use clrwin' for winio@ on its own.

1 Sep 2025 11:02 #32319

Aha! I get it now. And for reasons of economy, the console window doesn't appear if there isn't any output for it - or hides itself somewhere, or I wasn't looking in the right place ...

3 Sep 2025 6:44 #32324

Eddie, I have 0.01% of needed knowledge of OpenGL to write any guide for everyone, I know only that absolute minimum about OpenGL which is barely needed to do what I do. And still have a lot of questions about it.

/** That all comes from the principle of good old Salford Fortran, expressed 35 years ago which I understood this way: you do not need to learn any other language besides Salford Fortran and you still will be able to do 99.9% of what you need, and often will achieve it much faster. That perfectly worked for me. Painfully missing there was parallelization but luckily for that from the end of 1990th I used third party parallel libraries, excluding last 3 years when other more standard and modern methods of parallelization - like MPI and GPU - became necessary)

Questions about OpenGL which I still have are of this sort:

  1. How the game developers succeed to create real time 4k 3D OpenGL games with 60-120 frames per second while my plots - though very attractive and simple - take 100-1000x more time?

  2. How come having 24GB or VRAM I can plot only 35 million polygons which require only 5-10% of that and more do not fit into videocard memory ? (Each polygon defined by 4 points (its corners) in 3D space, each point is 3 single precision numbers in Cartesian x,y,z coordinates)

12 Sep 2025 12:13 #32337

Thanks for the positive feedback. I have updated the link in the original post to include the more recent examples I have cobbled together. These use the %pl callback in various ways, and the final example give a basic recipe for plotting a function z(x,y) as a simple coloured heat map.

12 Sep 2025 4:44 #32338

Dan,

That's a pity. Thanks for being honest. There's still a need.

Ken,

Some amazing progress. Excellent, and very helpful. Of course it is a lot to do with Paul going 'native' and fixing the bugs that you have reported. A big thing about native %pl has to be using the absolutely latest version(s) of the software.

I suppose that the original %pl and the purchase-able extension to it must have some differences from native.

Eddie

13 Sep 2025 7:17 #32339

SIMPLEPLOT is a 32bit graphics library that was provided by Bradford University BUSS Ltd. As far as I know this company nolonger exists. Silverfrost does not have or own the source code so we are not able to port it to 64 bits.

SIMPLEPLOT is an extensive library that includes 3D surface imaging perhaps akin to OpenGL.

The 32bit interface to SIMPLEPLOT via winio@ and %pl is limited to 2D graphs.

The native 32/64bit %pl is also limited to 2D graphs and provides an extension to ClearWin+ graphics (%gr).

13 Sep 2025 8:57 #32340

Thank you Paul for a succinct explanation.

I note that I have a SIMPLE.DLL dated 09/10/1998 in my FTN95 installation. It is 952kB in size. What does that support? It can't be the native version (obviously).

That leaves it as necessary for the 32-bit only simple 2D graphs SIMPLEPLOT, or the full SIMPLEPLOT. In which latter case all that's missing for 32-bit apps is a copy of the BUSS manual. Does anyone out there have one?

Presumably the 1998 version of simple 2D graphs SIMPLEPLOT doesn't know anything about WINOP@ (or given where Bradford is, perhaps doesn't know owt).

Eddie

13 Sep 2025 11:44 #32341

Eddie, there is some BUSS documentation here:

https://www.silverfrost.com/23/ftn95/support/documentation.aspx

Clearly AI services have trawled the Silverfrost website and found these old documents, which is why asking AI to generate even simple %pl[native] i.e. 64 bit code is fraught with problems.

13 Sep 2025 11:52 #32342

Eddie

SIMPLE.DLL is still included in the installation in case it is needed for legacy code.

For new code and 3D graphics you could use OpenGL (via ClearWin+ %og say). Although there have been complaints about the learning curve for OpenGL, I suspect that SIMPLEPLOT would not be easier to use.

For 2D graphics you could use ClearWin+ %gr/%pl or %og.

There is also Bill Bardsley's SIMFIT library which can be accessed via Simdem.exe/x64_Simdem.exe and is described the help file under FTN95 then SIMFIT. This includes some 3D plotting.

The original (non_native) %pl does not use winop@.

13 Sep 2025 12:10 #32343

Brilliant, Ken. I missed that - or forgot about it!

So what is SIMPLE.DLL?

Eddie

13 Sep 2025 12:49 #32344

SIMPLE.DLL is the 32bit DLL for the SIMPLEPLOT library.

14 Sep 2025 10:12 #32345

Having peeked at the documentation Ken pointed me to, I think Paul's assertion that SimplePlot 3D is likely to be as difficult as OpenGL is very likely to be correct.

I think that I'll take the very broad hints and do something else!

Eddie

19 Sep 2025 10:06 #32348

Ken,

That final example is a bit of a revelation. I suppose that with a different algorithm the second pass could be configured to produce coloured bands rather than a continuous spectrum.

It seems that red to blue through green is the simplest colour sequence. Some years ago I asked if anyone knew others. No response!

Eddie

Please login to reply.