Silverfrost Forums

Welcome to our forums

Clearwin on Linux and Windows

4 Nov 2022 7:01 #29573

%cw is still supported for FTN95. I accesses the FTN95 I/O library so it can't be used with third party compilers. For example, when you issue WRITE for gFortran you are accessing the gFortran I/O library which is not connected to %cw.

I think that you should be able to write large amounts of data using %re, at least for 64 bit applications. If you encounter problems then let me know and I will check this out.

As I recall, %cw also has a limit which is configurable.

6 Nov 2022 8:23 #29590

Third party support for %cw has been restored (in the next release of the DLLs) in the sense that %cw will be available via cw_write$ rather than WRITE.

9 Nov 2022 4:31 #29607

Quoted from PaulLaidler There are some OpenGL demo programs in the FTN95 samples which by default are located in C:\Users\UserName\OneDrive\Documents\FTN95 Examples\OpenGL.

There is also some code in ftn95.chm at FTN95>ClearWin+>OpenGL>The conversion of a Red Book example.

Paul, The Help file warns about some potential changes which might be needed when calling OpenGL. So your adaptation of some Fortran OpenGL examples would help. As i wrote i have very compelling i think 3D plotting demos. The 3D became lately the major trend in numerical simulations specifically on supercomputers and of course in all current 3D games. I can send them to you and anyone. Some are relatively small files, and can be reduced more, and they also little bit use Clearwin.

14 Nov 2022 12:36 #29624

OK, how to compile Clearwin in batch and IDE Plato is clear. Now how to compile in BAT and Plato this simplest OpenGL demo with gFortran? It fails. With native FTN95 the compilation

FTN95 ooo.f90 /64 /link

works fine both with /64 or without, and no matter with $ or @ without any changes

      PROGRAM Simple 
!      INCLUDE <clearwin.ins>,nolist 
!      INCLUDE <opengl.ins>,nolist 
use clrwin$
use opengl$

REAL t1,t2 
INTEGER i, ctrl 

i=winio$('%es%ca[Simple OpengGL Sample]&') 
i=winio$('%sp%ww[no_border]%pv%og[static]%lw', 0, 0, 500, 500, ctrl) 

CALL glClearColor (0.0, 0.0, 0.0, 0.0) 
CALL glClear(GL_COLOR_BUFFER_BIT) 
CALL glColor3f(1.0, 1.0, 1.0) 
CALL glMatrixMode(GL_PROJECTION) 
CALL glLoadIdentity() 
CALL glOrtho(-1d0, 1d0, -1d0, 1d0, -1d0, 1d0) 
CALL glBegin(GL_POLYGON)      

CALL glColor3f(1.0,0.0,0.0) 
CALL glVertex2f(-0.5, -0.5) 
      
CALL glColor3f(0.0,1.0,0.0) 
CALL glVertex2f(-0.5, 0.5) 
 
CALL glColor3f(0.0,0.0,1.0)      
CALL glVertex2f( 0.5, 0.5) 
 
CALL glColor3f(1.0,0.0,0.0)      
CALL glVertex2f( 0.5, -0.5) 
CALL glEnd() 
CALL glFlush() 
    END 
15 Nov 2022 11:01 #29629

And on a side note, since with FTN95 all works with @ and $ may be it's good idea to get rid of @ for the Clearwin codes to be universally compatible with all other external software and become future proof. The @ bugged me from the day one like some foreign for Fortran symbol, the sign of incompatibility

8 Dec 2022 8:46 #29682

How do we include cw_write@ (and presumably we need to use cw_write$)? Is it in clrwin$?

On a slightly separate issue, I have not been able to get %bm to work with other compilers. Is there anything I should be doing differently?

9 Dec 2022 7:33 #29683

Simon

Yes. Use clrwin$ and the form

   call cw_write$(10,'Hello there!')

where 10 is the Fortran unit number used with %cw.

So normally you will do a internal WRITE to a CHARACTER variable followed by a call to cw_write$.

But note that %cw was disabled by mistake (for third party compilers) in a recent version of the library. So you may need use a different version of the DLLs.

Please provide a sample for %bm and say which compiler you used.

9 Dec 2022 5:33 #29687

Hi Paul,

I understand that %cw will soon be restored - if so, then I will wait for the new release.

My bitmap example is not working with NAGWare. Here is a simple example, which works as expected using FTN95:

Program p
   Use clrwin$
   Integer :: iw
!
   iw = winio$ ('%za&')
   iw = winio$ ('%bm[exampleBitmap]&')
   iw = winio$ ('%zz')
End Program p

and my resource file looks like this:

exampleBitmap BITMAP exampleBitmap.bmp

The error message I get is:

&') iw = winio$ ('%zz') End Program p

and my resource file looks like this:

exampleBitmap BITMAP exampleBitmap.bmp

The error message I get is: [quote:b95e5ef2cc]Bitmap exampleBitmap is not available as a resource

13 Dec 2022 9:04 #29698

The curly-brackets solution you mentioned here: https://forums.silverfrost.com/Forum/Topic/4223 solves this bitmap problem. Evidently something is not working with the resource script file, but that is no longer an issue I need to resolve for now.

14 Dec 2022 7:24 #29699

Simon

I have not tried using ClearWin+ with NAGWare so I don't know which resource compiler they use. It might be the same one as for GFortran which works OK for me. As I recall, you need to use the resource compiler to create a .res file from the .rc script and then link the .res file with the other object code using the native linker.

Please login to reply.