Topic: how to draw a circle?

Trying to do some basic graphics.  Why does the code below now work?

program main
use appgraphics
implicit none
    integer::window   
    window = initwindow(800, 600, title="Example")
    call circle(400,300,100)   
    call loop()   
    call closewindow(window)
end program main

Re: how to draw a circle?

"now work?"  should have been "not work?".

Re: how to draw a circle?

Jack,

Did you add the following to the project linker?

!--- Project/Options/Compiler Flags/Linker:
-lappgraphics -lgdi32 -lcomdlg32 -lcomctl32 -luuid -loleaut32 -lole32

Re: how to draw a circle?

I just tried the code you posted on Windows 10, and it compiled and ran as expected.  I didn't even need to add any flags if I started with an empty project.  Can you be more specific about what doesn't work?  Does the code compile for you?  Does it fail when it runs?

Also, it helps to know what version of Simply Fortran you're using.  Can you report that as well?

Jeff Armstrong
Approximatrix, LLC

5 (edited by jackmitchener 2022-08-30 14:15:00)

Re: how to draw a circle?

My code compiles OK. When I hit "run", it shows the black window with a blinking cursor at top left.  But it makes no effort to draw a circle.  Simply Fortran version is 3.24 . Build is 3734.

Re: how to draw a circle?

Can you first try upgrading to the latest version of Simply Fortran (3.25)?  There have been AppGraphics updates.

Also, it sounds like the graphics window isn't opening.  What you've described is just a text window, and you must currently have some options set to open an external console for some reason.  Is this correct?  Could you send your code and project file to support@approximatrix.com for me to check?  Something seems off.

Jeff Armstrong
Approximatrix, LLC

Re: how to draw a circle?

I purchased the 3.25 version with build 3758.  Ran the same program again.  Same result. 
I was concerned that the file I was using to keep my fortran efforts was too far removed from where the Fortran language was kept (C/Program Files 86/Simply Fortran).  So I moved my Efforts file from: C/Users/Joe/Fortran Efforts  to: C/Program Files 86/Fortran 3/Fortran Efforts.

Wonder if the ' Title="Example" ' might be causing the program to believe that a character screen is needed?

Re: how to draw a circle?

Success!  All I did was remove the Title="Example".