I use put_dib_block@(file_name,ImageDib,wid,hgt,0,0,wid,hhgt,24,ierr) to save content of OpenGL screen to BMP. Ideally would be great if put_dib_block@ recognized popular extentions like BMP, PNG in supplied file_name but may be there already exist other ways to save OpenGL graphics screen content from %og in PNG format? The BMP format is way too heavyweight
call put_dib_block@ and PNG
If the filename ends in '.JPG', you'll get a JPEG file. Is that a help?
JPG could be useful in some cases, good suggestion, thanks. Great would be to have lossless and one of the most popular in science and engineering and on the web royalty-free formats like PNG. Other lossless formats as BMP and PCX are now rarely used.
I never used these formats or seen anyone use them. May be SVG is interesting but i need to look and try.
By the way there are a lot of examples in this website. But i tried to compile one from OpenGL Animation and got this report
0118) CALL glBegin(GL_LINES)
0119) CALL glColor3fv(white_colour)
0120) CALL glVertex2d(-scale,0d0)
0121) CALL glVertex2d(scale,0d0)
0122) CALL glVertex2d(0d0,-scale)
0123) CALL glVertex2d(0d0,scale)
0124) k=-10
0125) WHILE(k .LE. 10) DO
*** Unpaired right bracket(s)
0296) CALL temporary_yield@()
0297) ENDWHILE
0298) END
*** Missing END PROGRAM
0130) k=k+1
0131) ENDWHILE
0132) CALL glEnd()
0133) CALL glColor3fv(red_colour)
0134) CALL glBegin(GL_LINE_STRIP)
0135) d=-10d0
0136) WHILE(d .LT. 10d0)DO
*** Variable NDWHILEALLGLEND follows another operand (possible unexpected
space?)
0139) d=d+0.05d0
0140) ENDWHILE
0141) CALL glEnd()
0142) CALL glColor3fv(green_colour)
0143) CALL glBegin(GL_LINE_STRIP)
0144) d=-10d0
0145) WHILE(d .LT. 10)DO
*** Variable NDWHILEALLGLEND follows another operand (possible unexpected
space?)
0168)
0169) IF(h.NE.0)THEN
*** Unexpected ',' in assignment
0186)
0187) IF(reason.EQ.'SETUP')THEN
*** Unexpected ',' in assignment
0192) CALL myreshape(w,h)
0193) ELSEIF(reason.EQ.'DIRTY')THEN
*** Unexpected character(s) following CALL statement
0195) window1_active=.true.
0196) ELSEIf(reason.EQ.'MOUSE_LEFT_CLICK')THEN
*** Variable LSEIF follows another operand (possible unexpected space?)
0197) CALL spinSlab(1)
0198) ELSEIF(reason.EQ.'MOUSE_RIGHT_CLICK')THEN
*** Unexpected character(s) following CALL statement
0212)
0213) IF(reason.EQ.'SETUP')THEN
*** Unexpected ',' in assignment
0218) CALL myreshape(w,h)
0219) ELSEIF(reason.EQ.'DIRTY')THEN
*** Unexpected character(s) following CALL statement
0221) window2_active=.true.
0222) ELSEIF(reason.EQ.'MOUSE_LEFT_CLICK')THEN
*** Variable LSEIF follows another operand (possible unexpected space?)
0223) CALL spinSlab(2)
0224) ELSEIF(reason.EQ.'MOUSE_RIGHT_CLICK')THEN
*** Unexpected character(s) following CALL statement
*** Too many errors
14 ERRORS [openGLAnim.FOR] - Compilation failed.
Can you try if this is because my browsers Opera, Chrome and Brave are crazy or all users are crazy no one but few reporting anything, or the sources are just corrupted
Are the line numbers '0118)' etc. in the source code or just in the listing? They should not appear in the source code.
Otherwise there must be invisible false characters in the source code.
Paul, see https://www.silverfrost.com/ftn95-help/clearwinp/opengl/call_backsandinitialisation.aspx for an example of fixed form code listings that contain three-digit line numbers, continuation marks in col-8, some statements beginning in col-8, other statements beginning in col-9, and use the nonstandard WHILE...ENDWHILE construct. Perhaps, a listing from the FTN77 era?
The code that Dan posted above is probably from https://www.silverfrost.com/ftn95-help/clearwinp/opengl/animationandmultiplewindows.aspx . This one does not have line numbers, but the statements start in col-6, and I don't see where to find the included file 'danimate.ins'.
mecej4
Thanks for the information. On my machine the samples appear in C:\Users\xxxx\Documents\FTN95 Examples\OpenGL.
Paul, the example gears.f95, installed among other OpenGL examples under ...\Documents\FTN95 Examples, requires a couple of corrections to make it work with /64:
1. The integer variable w1 is used as an actual argument in several OpenGL calls as well as in the WINIO@ call at line 493. On that line, please replace 'w1' by 'INT(w1,7)' .
2. On line 474, please remove ', handle' and add a separate declaration of 'handle' with type INTEGER(7).
Thank you. I will take a look at this.
Dan, since you mentioned SVG, I assumed you had a graphic that was line-oriented. If I am mistaken, enlighten me.
I personally like graphics using PDF as the media. It is portable, viewable by almost every computer on the planet (including phones), and has really good (and lossless) compression, and can be printed on printers, plotters, etc. The library I use is one I developed and use with FTN95. It is NOT image oriented, meaning if you are drawing contours in a graphic window, I don't have an interface for that. PDF does like images of certain types, however...
It is for line drawing but does have specialized calls to draw (filled or unfilled) arcs, rectangles, circles. It uses the basic CalComp calls for the line drawing, and is expanded by the primitives as mentioned, and permits changing colo(u)rs.
My software products also produce JPG, BMP, and AutoCAD outputs. JPG and BMP use the DIB routines, while AutoCad is produced as a DXF file.
Bill
Bill, as to Adobe PDF, one famous company few years back started big war against Adobe products. I thought it will go out of business. Who could withstand Apple's hatred and ban of Flash player for example in Apple products. But looked yesterday on stock ADBE and was shocked - it goes up and up. I need any popular graphics format which are lossless, compact, accepted with Microsoft Word, Powerpoint, FTN95 and publications journals and also ideally capable of animations (like GIF89 or AVI).
Dan, thanks for the explanation.