<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Simple Graphics Animation]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=240&amp;type=atom" />
	<updated>2013-09-16T11:24:20Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=240</id>
		<entry>
			<title type="html"><![CDATA[Re: Simple Graphics Animation]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=990#p990" />
			<content type="html"><![CDATA[<p>Greg,</p><p>It&#039;s my pleasure.&nbsp; I still have a few more functions to implement, and hopefully I can get to them this week.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2013-09-16T11:24:20Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=990#p990</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple Graphics Animation]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=989#p989" />
			<content type="html"><![CDATA[<p>Jeff,</p><p>I&#039;ve tested several of the basic procedure calls and everything seems to work fine.&nbsp; I&#039;ll let you know if I encounter any problems.</p><p>Thanks very much.&nbsp; This is a great help to me.</p><p>Greg</p>]]></content>
			<author>
				<name><![CDATA[howmiller]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3472</uri>
			</author>
			<updated>2013-09-16T06:40:10Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=989#p989</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple Graphics Animation]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=979#p979" />
			<content type="html"><![CDATA[<p>Another update (version 0.3) is now available that fixes the <em>initwindow</em> functionality.&nbsp; The function is declared as:</p><div class="codebox"><pre><code>function initwindow (width, height, title, left, top, dbflag, closeflag)</code></pre></div><p>The <em>width</em> and <em>height</em> parameters are mandatory, while the remaining parameters are now optional.&nbsp; For example, to specify a window position as (100, 100) in screen coordinates, the following call would work:</p><div class="codebox"><pre><code>w = initwindow(800, 600, left=100, top=100)</code></pre></div><p>There was previously a bug in the interface related to the two logical flags, <em>dbflag</em> and <em>closeflag</em> that caused the function to fail under all circumstances.&nbsp; It should be working fine now.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2013-09-09T16:14:43Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=979#p979</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple Graphics Animation]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=969#p969" />
			<content type="html"><![CDATA[<p>Greg,</p><p>I&#039;ve implemented the <em>COLOR</em> function (as <em>rgbcolor</em>) as well as some support functions.&nbsp; The update (version 0.2) is now available via the package manager.</p><p>Additionally, the list of supported functions is available at <a href="https://github.com/ArmstrongJ/WinBGI-Fortran/wiki/Supported-Functions">https://github.com/ArmstrongJ/WinBGI-Fo … -Functions</a>.</p><p>I&#039;ll continue working on supporting the remaining missing functions.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2013-09-06T12:54:03Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=969#p969</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple Graphics Animation]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=948#p948" />
			<content type="html"><![CDATA[<p>Greg,</p><p>You are correct that I&#039;ve only gotten a subset implemented thus far.&nbsp; As a rule of thumb, the only things missing are going to be functions that interact with C structures (just haven&#039;t gotten to them yet) or any preprocessor macros.&nbsp; Also, the text output isn&#039;t working yet.</p><p>The initwindow() function is implemented, but it requires all of its arguments at this time.&nbsp; You&#039;ll notice that the original definition is:</p><p>&nbsp; &nbsp; int initwindow(int width, int height, const char* title=&quot;Windows BGI&quot;, int left=0, int top=0, bool dbflag=false, closeflag=true);</p><p>At this time, it does require all arguments to be passed.&nbsp; I&#039;ll change this in the future as I find it quite annoying as well.&nbsp; </p><p>The COLOR() function is not yet implemented either.&nbsp; I believe it is an actual library function although it appears as a preprocessor macro.&nbsp; Another bit I haven&#039;t gotten to yet.</p><p>I plan on getting back to it in a week to finish it off completely.&nbsp; Sorry for the delay.&nbsp; It is a work in progress.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2013-08-25T02:03:12Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=948#p948</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple Graphics Animation]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=947#p947" />
			<content type="html"><![CDATA[<p>Jeff, </p><p>As I understand it, at this point you have implimented a subset of the features of WinBGI in your FORTRAN interface.</p><p>I tried the new example program that you provided and it works fine on my system.</p><p>I tried a couple of functions that had worked in the C version, but do not work for me in the FORTRAN version.&nbsp; Have I invoked these features incorrectly or do they remain unimplemented in the FORTRAN version so far?</p><p>Here are some detailed results:</p><p>(1) Call the &#039;initwindow&#039; function to specify display window size:</p><p>&nbsp; &nbsp; &gt;In the original C version of WinBGI:</p><p>&nbsp; &nbsp; &nbsp; &nbsp; initwindow(1800,1000);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; compiles and works as desired</p><p>&nbsp; &nbsp; &gt; In WinBGI-FORTRAN:</p><p>&nbsp; &nbsp; &nbsp; &nbsp; call initwindow(1800,1000)</p><p>&nbsp; &nbsp; &nbsp; &nbsp; Results in the following error messages:</p><p>C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gfortran.exe&quot; -c -o &quot;build\bgi_example.o&quot; -g -march=native -m32 -</p><p>IC:/Users/user/AppData/Local/sfpm/32/include&nbsp; -Jmodules &quot;.\bgi_example.f90&quot;<br />.\bgi_example.f90:2.4:</p><p>use bgi<br />&nbsp; &nbsp; 1<br />.\bgi_example.f90:28.30:</p><p>&nbsp; &nbsp; call initwindow(1800,1000)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2<br />Error: &#039;initwindow&#039; at (1) has a type, which is not consistent with the CALL at (2)<br />Error(E42): Last command making (build\bgi_example.o) returned a bad status<br />Error(E02): Make execution terminated</p><br /><p>(2) Call &#039;setcolor&#039; function to set the current drawing color to a specified RGB value:</p><p>&nbsp; &nbsp; &gt;In the original C version of WinBGI:</p><p>&nbsp; &nbsp; &nbsp; &nbsp; setcolor(COLOR(240,150,100));<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; compiles and produces the desired results<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &gt; In WinBGI-FORTRAN:</p><p>&nbsp; &nbsp; &nbsp; &nbsp; call setcolor(COLOR(240,150,100))</p><p>&nbsp; &nbsp; &nbsp; &nbsp; Returns the following error messages:</p><p>&quot;C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gfortran.exe&quot; -c -o &quot;build\bgi_example.o&quot; -g -march=native -m32 -</p><p>IC:/Users/user/AppData/Local/sfpm/32/include&nbsp; -Jmodules &quot;.\bgi_example.f90&quot;<br />&nbsp; &nbsp; &quot;C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gfortran.exe&quot; -o &quot;bar3d.exe&quot; -static -m32 &quot;build\bgi_example.o&quot; -</p><p>LC:/PROGRA~2/SIMPLY~1/MINGW-~1/lib/ -LC:/Users/user/AppData/Local/sfpm/32/lib -lbgif -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32 -</p><p>lstdc++<br />build\bgi_example.o: In function `bgi_example&#039;:<br />C:\Users\user\Documents\Fortran\A -Greg Source\Win BGI&nbsp; Fortran/./bgi_example.f90:29: undefined reference to `color_&#039;<br />collect2.exe: error: ld returned 1 exit status<br />Error(E42): Last command making (bar3d.exe) returned a bad status<br />Error(E02): Make execution terminated</p><br /><p>If this is simply a matter that these&nbsp; particular features have not yet been implemented in WinBGI-FORTRAN, that&#039;s fine.&nbsp; I&#039;ll be happy to wait until you have a chance to complete the interface&nbsp; -- it&#039;s really great that you are willing to try to provide these useful extensions to the basic language.</p><p>If it would be helpful, I can supply a list of the WinBGI functions that would be of most use for my particular applications.</p><p>Once again, thanks for your help in this matter.&nbsp; </p><p>Greg M.</p>]]></content>
			<author>
				<name><![CDATA[howmiller]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3472</uri>
			</author>
			<updated>2013-08-25T00:01:56Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=947#p947</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple Graphics Animation]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=943#p943" />
			<content type="html"><![CDATA[<p>Okay, the Fortran interface is now available (with example) from:</p><p><a href="http://packages.simplyfortran.com/package/47.html">http://packages.simplyfortran.com/package/47.html</a></p><p>The interface isn&#039;t yet complete.&nbsp; There is more work to be done, but most simple graphics functions should be working fine.&nbsp; I&#039;ll add a bit more later, but it might be a week or two.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2013-08-22T20:54:11Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=943#p943</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple Graphics Animation]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=942#p942" />
			<content type="html"><![CDATA[<p>I have a preliminary interface up and running.&nbsp; You can see the source code at:</p><p><a href="https://github.com/ArmstrongJ/WinBGI-Fortran">https://github.com/ArmstrongJ/WinBGI-Fortran</a></p><p>I should have a package ready shortly as well.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2013-08-22T20:33:29Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=942#p942</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple Graphics Animation]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=941#p941" />
			<content type="html"><![CDATA[<p>Jeff,</p><p>I&#039;d like to accept your kind offer.&nbsp; As I indicated, I&#039;m pretty much a beginner-- I would not know where to begin. </p><p> Hopefully, such a &quot;wrapper&quot; will be of use for other FORTRAN users.</p><p>Thanks very much.</p><p>Greg</p>]]></content>
			<author>
				<name><![CDATA[howmiller]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3472</uri>
			</author>
			<updated>2013-08-22T02:26:30Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=941#p941</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple Graphics Animation]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=940#p940" />
			<content type="html"><![CDATA[<p>Greg,</p><p>I think WinBGI seems like it would work well for what you&#039;re describing.&nbsp; However, WinBGI is a C library.&nbsp; It is rather simple, however, so creating a Fortran wrapper shouldn&#039;t be too difficult.&nbsp; Unless you&#039;d like to tackle it personally, I&#039;ll try to put together a thin wrapper in Fortran around WinBGI that will make it a bit more usable.&nbsp; Does that sound like it might work to you?</p><p>When complete (a day or two, probably) the wrapper will be available through the package manager.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2013-08-22T00:39:24Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=940#p940</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Simple Graphics Animation]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=935#p935" />
			<content type="html"><![CDATA[<p>I&#039;m a beginner FORTRAN programmer.&nbsp; I am really enjoying the excellent programming environment<br />provided by Simply FORTRAN. However, I&#039;ve run into a bit of a roadblock with regard to <br />graphics.&nbsp; I&#039;m hoping someone can point me in the right direction.</p><p>I&#039;d like to develop some numerical simulations and plot the results as the simulation proceeds <br />as a simple 2-dimensional animation on my monitor.&nbsp; The planned program flow would be roughly <br />as follows:</p><p>(1) Initialize the simulation<br />(2) Initialize a display window (preferably 1920x1080 with full RGB colors).<br />(3) Advance the simulation a time step<br />(4) Convert the updated model state into a set of pixel coordinates which will be plotted as<br />points or used as endpoints of simple line segments.<br />(5) Clear a display write buffer and draw an updated set of 2-D points or lines <br />(6) Update display window with the new graphic page<br />(7) Loop back to step (3).</p><p>I&#039;ve looked through the various graphics-related FORTRAN packages.&nbsp; The Open GL interfaces <br />would probably work, but I think the complexity of the interface greatly exceeds my current <br />needs and programming ability.</p><p>The Win BGI package seems more appropriate. I played around with the parameters in the example <br />program provided for Simply FORTRAN and&nbsp; I was able to get the screen resolution and colors I <br />want.&nbsp; Unfortunately, the example is a C routine.&nbsp; It is not clear to a beginner like myself <br />how I can invoke the various Win BGI routines and pass data (such as display&nbsp; coordinates and<br />colors) from my FORTRAN main program.</p><p>Thanks,</p><p>&nbsp; &nbsp; Greg M (howmiller)</p>]]></content>
			<author>
				<name><![CDATA[howmiller]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3472</uri>
			</author>
			<updated>2013-08-20T03:25:22Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=935#p935</id>
		</entry>
</feed>
