<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Tester for set_gfx_mode complete</title>
		<link>http://www.allegro.cc/forums/view/593767</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 06 Nov 2007 15:44:24 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
I&#39;ve completed a testing and logging program for the allegro function set_gfx_mode.<br />Since I&#39;ve been having problems setting more than one resolution in a row I figured I would write out a program that allows me to easily log how well it is working. If anyone else is having problems with set_gfx_mode then they should be able to use this to report their problems as well.</p><p>Feel free to use any of my source code in your programs if you like , as long as you give me credit for it somewhere and don&#39;t pass it off as your own.<br /><a href="http://www.allegro.cc/files/attachment/593557">Source code</a> zip file plus two batch files for compiling and linking with MinGW in a Windows cmd interpreter.<br /><a href="http://www.allegro.cc/files/attachment/593559">Windows Binary</a> (dynamic debug version , Allegro 4.2.2)<br /><a href="http://www.allegro.cc/files/attachment/593558">All example pictures and logs</a> (jpegs and text files)</p><p><u>What it does :</u><br />1. Sets up Allegro and an initial resolution for the program.<br />2. Draws and displays a pair of checkered bitmaps that alternate. The checkers are 100X100 for easy screen size reference.<br />3. (<b>Enter key</b>) Lets the user change into a different resolution , color depth and mode using gfx_mode_select_filter (nothing less than 320 X 240 , nothing bigger than the desktop resolution , and only 4:3,16:9,or 16:10 resolutions)<br />4. If the resolution or color depth changes , go back to step 2.<br />5. (<b>L key</b>) Lets the user log whether this was a success or not and enter any notes into the text log file through an Allegro gui interface.<br />6. (<b>P key</b>) Pause.<br />7. (<b>ESC key</b>) Quit.</p><p>Any time the resolution is changed a function called change_res is called. This is a wrapper for Allegro&#39;s set_gfx_mode function. Change_res is called with a mode argument that is either 1 , 2 , or 3. This is also the argument used to start the program with.<br /><b>SetGfxModeTest must be run from the command line with the argument of 1 , 2 , or 3.</b></p><p><u>Change_res modes :</u><br />Mode 1 : When changing resolutions , directly call set_gfx_mode for the requested resolution and mode.<br />Mode 2 : When changing resolutions , first change into GFX_TEXT mode , and then use set_gfx_mode to change into the requested resolution and mode.<br />Mode 3 : When changing resolutions , first change into GFX_TEXT mode , next use allegro_message to output a popup message to the screen , and then use set_gfx_mode to change into the requested resolution and mode.<br /><b>Mode 1 : No GFX_TEXT , No allegro_message , Set gfx mode</b><br /><b>Mode 2 : Set GFX_TEXT , No allegro_message , Set gfx mode</b><br /><b>Mode 3 : Set GFX_TEXT , Use allegro_message , Set gfx mode</b></p><p>Mode 3 is what I&#39;ve been using in my programs for some time when I need to change to another mode and resolution. It&#39;s not perfect , but it&#39;s a far cry better than the results I had been having in mode 1 or 2. (Note : Mode 3 always works to change  properly to the new graphics mode , even if the window looks a little funny during the allegro_message transition.</p><p>Here are some examples of what happens in each mode. Hopefully this can help the Allegro developers figure out what is going on. ( Please look at the associated logs as they have detailed descriptions of what happened to create the examples seen below )</p><p><u>Example 1 , Mode 1</u><br /><a href="http://www.allegro.cc/files/attachment/593547">Program Log</a> for examples 1 and 2<br /><a href="http://www.allegro.cc/files/attachment/593548">Allegro Log</a> for examples 1 and 2<br /><span class="remote-thumbnail"><span class="json">{"name":"593509","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/8\/e80ff040f9bd3f1d866c1d175ad8eda3.jpg","w":1024,"h":768,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/8\/e80ff040f9bd3f1d866c1d175ad8eda3"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/e/8/e80ff040f9bd3f1d866c1d175ad8eda3-240.jpg" alt="593509" width="240" height="180" /></span></p><p><u>Example 2 , Mode 1</u><br /><a href="http://www.allegro.cc/files/attachment/593547">Program Log</a> for examples 1 and 2<br /><a href="http://www.allegro.cc/files/attachment/593548">Allegro Log</a> for examples 1 and 2<br /><span class="remote-thumbnail"><span class="json">{"name":"593510","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/7\/871a7b68578c6b25dcb62dedc11d807a.jpg","w":1024,"h":768,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/7\/871a7b68578c6b25dcb62dedc11d807a"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/8/7/871a7b68578c6b25dcb62dedc11d807a-240.jpg" alt="593510" width="240" height="180" /></span></p><p><u>Example 3 , Mode 1</u><br /><a href="http://www.allegro.cc/files/attachment/593549">Program Log</a> for example 3<br /><a href="http://www.allegro.cc/files/attachment/593550">Allegro Log</a> for example 3<br /><span class="remote-thumbnail"><span class="json">{"name":"593511","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/3\/d32cc69a4f2c2adca0c75cb10e296cdd.jpg","w":1024,"h":768,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/3\/d32cc69a4f2c2adca0c75cb10e296cdd"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/d/3/d32cc69a4f2c2adca0c75cb10e296cdd-240.jpg" alt="593511" width="240" height="180" /></span></p><p><u>Example 4 , Mode 1</u><br /><a href="http://www.allegro.cc/files/attachment/593551">Program Log</a> for example 4<br /><a href="http://www.allegro.cc/files/attachment/593552">Allegro Log</a> for example 4<br />http://www.allegro.cc/files/attachment/593512</p><p><u>Example 5 , Mode 2</u><br /><a href="http://www.allegro.cc/files/attachment/593553">Program Log</a> for example 5<br /><a href="http://www.allegro.cc/files/attachment/593554">Allegro Log</a> for example 5<br />http://www.allegro.cc/files/attachment/593513</p><p><u>Example 6 , Mode 3</u><br /><a href="http://www.allegro.cc/files/attachment/593555">Program Log</a> for examples 6 and 7<br /><a href="http://www.allegro.cc/files/attachment/593556">Allegro Log</a> for examples 6 and 7<br /><span class="remote-thumbnail"><span class="json">{"name":"593545","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/8\/a866f9277e43e311db43c747bdf8b0e8.jpg","w":1024,"h":768,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/8\/a866f9277e43e311db43c747bdf8b0e8"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/a/8/a866f9277e43e311db43c747bdf8b0e8-240.jpg" alt="593545" width="240" height="180" /></span></p><p><u>Example 7 , Mode 3</u><br /><a href="http://www.allegro.cc/files/attachment/593555">Program Log</a> for examples 6 and 7<br /><a href="http://www.allegro.cc/files/attachment/593556">Allegro Log</a> for examples 6 and 7<br />http://www.allegro.cc/files/attachment/593546</p><p>To sum everything up , most of the problems encountered changing to a new graphics mode happen when changing from a non-desktop sized fullscreen resolution to any windowed mode. The monitor is forced to change its working resolution (I hear the monitor click inside) and then allegro sets a window the size of the desktop. The only portion of that window that is being drawn to is the requested size area in the upper left corner of the window.</p><p>Hope all this helps.:) Any questions?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 06 Nov 2007 15:44:24 +0000</pubDate>
	</item>
</rss>
