<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blogs &#187; Judy Hartley (Intel)</title>
	<atom:link href="http://software.intel.com/en-us/blogs/author/judy-hartley/feed/" rel="self" type="application/rss+xml" />
	<link>http://software.intel.com/en-us/blogs</link>
	<description></description>
	<lastBuildDate>Fri, 25 May 2012 22:49:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Intel® vPro™ Enabling Tools for Now and the Future</title>
		<link>http://software.intel.com/en-us/blogs/2011/04/15/intel-vpro-enabling-tools-for-now-and-the-future/</link>
		<comments>http://software.intel.com/en-us/blogs/2011/04/15/intel-vpro-enabling-tools-for-now-and-the-future/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 20:23:30 +0000</pubDate>
		<dc:creator>Judy Hartley (Intel)</dc:creator>
				<category><![CDATA[Manageability & Security]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2011/04/15/intel-vpro-enabling-tools-for-now-and-the-future/</guid>
		<description><![CDATA[Hi everyone!  This is my first blog for the Manageability site, so let me introduce myself.  My name is Judy Hartley and I am a Software Applications Engineer.  I have been working for Intel for over 10 years and have spent my first five years in hardware (set top box chips) and now with software.  [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone!  This is my first blog for the Manageability site, so let me introduce myself.  My name is Judy Hartley and I am a Software Applications Engineer.  I have been working for Intel for over 10 years and have spent my first five years in hardware (set top box chips) and now with software.  I’ve written or collaborated on many tools since switching to the software side of things.</p>
<p>One tool that I have written or owned that you may know about is the Intel® Manageability Checker v2.0.  Released just last month, it is a great tool to confirm your program’s application of the Intel® AMT Use Cases.  There are a few new features that make using this tool easier than the v1.0 tool.  With version 1.0 you could save your packet capture session into a .pcap file for use with other tools.  Now, Intel Manageability Checker v2.0 can import those previously saved files and analyze the loaded packets.  You can also create the packet file with another tool and then use Intel Manageability Checker to analyze it.  When a file is loaded, the tool will tell you how many packets have been imported.  If you use the custom search string, it also informs you how many of the loaded or collected packets contained the search string.  Each time you reach the last page you have an opportunity to create a report file that will save the results.  Also, this version of the tool supports the newer features in Intel AMT 6.0 and 7.0.  In addition, there are new links inside the tool to get support if needed or to submit a report file when you are ready.  Check it out here: <a href="http://software.intel.com/partner/home">http://software.intel.com/partner/home</a></p>
<p>Ok, this is one tool that is out there to help you enable one Intel® vPro™ feature.  Now, it’s your turn. :-)  What other tools would you like to see?  Is there some gadget or application that would really help you incorporate Intel vPro abilities?  What is your special focus right now?  It doesn’t have to be Manageability &lt;keeping my head low and looking around cautiously&gt;.  It might be Intel® AES New Instructions (AESNI) or maybe Intel® Anti-Theft Technology. Respond to this blog and let everyone in on the secret.  Who knows, in no time you could be an Intel vPro “Hero” for thinking of the tool that makes the “Top 10 Hot Tool” list.  Ok, I don’t know if that list actually exists, but you get the general idea. Speak up!  I’ll be back in a while to recap the ideas you submitted.  Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2011/04/15/intel-vpro-enabling-tools-for-now-and-the-future/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One Step Forward, Two Steps Back</title>
		<link>http://software.intel.com/en-us/blogs/2009/12/08/one-step-forward-two-steps-back/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/12/08/one-step-forward-two-steps-back/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 18:25:31 +0000</pubDate>
		<dc:creator>Judy Hartley (Intel)</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/12/08/one-step-forward-two-steps-back/</guid>
		<description><![CDATA[It’s been a while since I’ve written a blog. I’ve wanted to, but when I blog I want to have something relevant to say. Makes sense, right? I’ve written 6 previous blogs on the same topic as this one, specifically, porting a DirectX demo to OpenGL with an eye on running it on a netbook [...]]]></description>
			<content:encoded><![CDATA[<p>It’s been a while since I’ve written a blog. I’ve wanted to, but when I blog I want to have something relevant to say. Makes sense, right? I’ve written 6 previous blogs on the same topic as this one, specifically, porting a DirectX demo to OpenGL with an eye on running it on a netbook eventually. You can find links to my previous blogs at the end of this one in case you want to start at the beginning or catch one you missed.<br />
I was going gangbusters on implementing the animation and collision detection code in the DirectX code. I was able to get both Open Steer and ODE to compile as libraries in the project, and to get the main code to compile. Where I got stuck was in Linking. Originally, I got one error. One of the libraries couldn’t be found. When I fixed that, all of a sudden I had 11 linkage errors. Fixed some of them and got 3 more linkage errors than I had before. And so it went. After two weeks of intermittently fixing errors, searching for error meanings on the web, or generally trying things to fix the errors without success, I took two steps back and took another look at what I was attempting to accomplish.<br />
I wanted to get approximately 100 bugs to run in and out and around the castle while it is being destroyed. I also want to be able to move the blocks that make up the castle as they are being hit by cannonballs. Thirdly, I want the bugs to avoid running “through” the blocks that have fallen down. If a cannonball or a block hits a bug, I want them to “die” and flatten as if they were smashed. Additionally, I want the cannonballs to act properly under the influence of “gravity”.<br />
I was pretty much unfamiliar with both ODE and Open Steer, and although I did delve into the code a bit to figure out how it worked, I ran into trouble because the old version of code used in the DirectX “Castle” demo was significantly different from the newer versions available on the web. Using the older code exclusively seemed to work except for the linking difficulties.<br />
I finally asked myself why I was trying to use other libraries when OSG has some API already in place for creating animation paths and handling collisions. The only thing I’m not sure it can do is handling the gravity. I’ve just looked it up on the site and there is a reference to gravity in the particle sections that may do what I need. I’ll just have to see.<br />
So, what I’ve done now is to create one animation path that travels around the castle. The bug pauses at intervals and then moves on. I’ve tried it with more than one bug and because I set random times, it does pretty well. My plan is to develop at least 3 more paths and randomize their usage. That should make the bugs look fairly realistic. I took the picture below while the demo was running.</p>
<div id="attachment_12527" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/12/castle001.jpg"><img class="size-medium wp-image-12527" src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/12/castle001-300x235.jpg" alt="With One Animation Path Running With A Few Bugs" width="300" height="235" /></a><p class="wp-caption-text">With One Animation Path Running With A Few Bugs</p></div>
<p>Update 12/7/09: I’ve now completed a second animation path and restructured the code so that the paths are now read from individual files. This allows me to easily change directions and angle percentages on the fly. I've posted a second picture below this paragraph. I’m currently working on a third path, and soon I will start putting in the collision code. It is very interesting work, but I’m finding it more and more difficult to set aside time to work on this project. I’m hopeful that I’ll be able to complete it near the start of 2010. I’ll blog again…</p>
<p>For those of you who missed the previous blogs, here are some links:</p>
<p><a href="http://software.intel.com/en-us/blogs/2009/05/26/threaded-graphics-to-mid-a-new-journey/">Blog 1:</a> "Threaded Graphics to MID: A New Journey"<br />
<a href="http://software.intel.com/en-us/blogs/2009/08/04/from-directx-to-opengl-wheels-up/">Blog 2: </a> "From DirectX to OpenGL - Wheels Up"<br />
<a href="http://software.intel.com/en-us/blogs/2009/08/18/opengl-graphic-formats-and-conversion/">Blog 3:</a> "OpenGL Graphic Formats and Conversion"<br />
<a href="http://software.intel.com/en-us/blogs/2009/09/09/scene-graphs-and-instancing/">Blog 4:</a> "Scene Graphs and Instancing"<br /><a href="http://software.intel.com/en-us/blogs/2009/09/29/load-follow-or-get-out-of-the-way/">Blog 5:</a> "Load, Follow, or Get Out of the Way"<br />
<a href="http://software.intel.com/en-us/blogs/2009/10/13/round-and-round-in-and-out/">Blog 6:</a> "Round and Round, In and Out"
 </p>
<div id="attachment_12529" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/12/castle006.jpg"><img class="size-medium wp-image-12529" src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/12/castle006-300x235.jpg" alt="With 3 Animation Paths Going" width="300" height="235" /></a><p class="wp-caption-text">With 3 Animation Paths Going</p></div>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/12/08/one-step-forward-two-steps-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Round and Round, In and Out</title>
		<link>http://software.intel.com/en-us/blogs/2009/10/13/round-and-round-in-and-out/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/10/13/round-and-round-in-and-out/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 21:30:18 +0000</pubDate>
		<dc:creator>Judy Hartley (Intel)</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[Graphics & Media]]></category>
		<category><![CDATA[Mobility]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[OSG]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Visual Adrenaliine]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/10/13/round-and-round-in-and-out/</guid>
		<description><![CDATA[If you have been following my blogs, you know that I am porting a DirectX-based demo application to OpenGL as the first phase in the project to play the app on a netbook with an Atom processor. If you’ve missed a few or would like to read all of my blogs pertaining to this project, [...]]]></description>
			<content:encoded><![CDATA[<p>If you have been following my blogs, you know that I am porting a DirectX-based demo application to OpenGL as the first phase in the project to play the app on a netbook with an Atom processor.  If you’ve missed a few or would like to read all of my blogs pertaining to this project, I have provided links to the previous entries at the end of this blog.<br />
As of the last blog, I have the objects rendering and the cannon moving in conjunction with the mouse movements.  Writing this reminds me that there is one more bit of code I put into the project that I should mention.  I don’t want the user being confused as to the slight difference between the cannon position and the mouse cursor, so I inserted the last line shown in the code snippet below:<br />
<div id="attachment_10657" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/hidecursor.jpg"><img src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/hidecursor-300x92.jpg" alt="code used to hide the cursor" width="300" height="92" class="size-medium wp-image-10657" /></a><p class="wp-caption-text">code used to hide the cursor</p></div></p>
<p>As you can see, I create a pointer to a Graphics Window object and I set the “useCursor” option to false.  This hides the cursor so the user can focus on where the cannon is positioned, rather than the cursor.  Another bit of code I added sets the starting position of the cursor to the middle of the screen.  Because I start the application with a window that is 800x600, the beginning position is (400, 300).  I originally set this position to (0,0) since when you are setting angles, the center point is (0,0).  However, it turns out that this is not correct for setting this function.  Here’s the line that sets the cursor:</p>
<div id="attachment_10658" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/centercursor.jpg"><img src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/centercursor-300x45.jpg" alt="code used to center the cursor" width="300" height="45" class="size-medium wp-image-10658" /></a><p class="wp-caption-text">code used to center the cursor</p></div>
<p>One thing I discovered is that you have to set this cursor position AFTER the window is realized, even though you hide the cursor previous to this.<br />
Now that I have the cannon moving with the mouse and the camera following the cannon, I want to be able to move the cannon to the right and left as well as backwards and forwards.  Although the cannon will move to the “right” or “left”, the actual movement I want to generate is a circular movement around the central object which is the castle.  So the center of this circle is (0, 0, 0).  The cannon is originally positioned at (2000, 9000, 180).  At first I was thinking that the radius of the circle would be 9000.  Remember, in OSG the ‘z’ axis is up, so the ‘y’ axis is the “distance” direction (for lack of a better description).  The actual radius of my circle, then, is found by use of the Pythagorean Theory.  The equation is below:<br />
<a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/equation.jpg"><img src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/equation.jpg" alt="" width="242" height="38" class="aligncenter size-medium wp-image-10659" /></a></p>
<p>The radius then turns out to be approximately 9219.544.  Using the radius as the distance from the Castle leaves me with the following code:<br />
<div id="attachment_10661" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/rightandleft.jpg"><img src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/rightandleft-300x182.jpg" alt="Moving the Cannon Right and Left" width="300" height="182" class="size-medium wp-image-10661" /></a><p class="wp-caption-text">Moving the Cannon Right and Left</p></div></p>
<p>The change in location around the diameter of the circle with a radius of 9219.544 is determined by dividing 2PI by  one less than an arbitrary number (g_scnNumCircleDivisions).  The sin of this value is then multiplied by the radius found in the global “g_fDistanceFromCastle” .  The height above ground is retained from the original position of the cannon.  This vector is added to the circle center vector to obtain the correct position around the circle.  I use  “g_v3TerrainPos” as the center mark because it is centered on (0, 0, 0).  To circle right, I add the delta amount to the total angle and to circle left I subtract it from the total.<br />
 The code for moving forward and backward is pretty much the same as above except that the changing value is the distance from the Castle (g_fDistanceFromCastle).  This section also clamps the distance value so that the cannon cannot get too close or too far away from the castle.  The code follows:</p>
<p><div id="attachment_10662" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/frontandback.jpg"><img src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/frontandback-300x167.jpg" alt="Code used to move the Cannon Forward and Back" width="300" height="167" class="size-medium wp-image-10662" /></a><p class="wp-caption-text">Code used to move the Cannon Forward and Back</p></div><br />
Now the cannon is pretty flexible so the time has come to animate the bugs in their various paths.  That will be the subject of my next blog.  </p>
<p>For those of you who missed the previous blogs, here are some links:</p>
<p><a href="http://software.intel.com/en-us/blogs/2009/05/26/threaded-graphics-to-mid-a-new-journey/">Blog 1:</a> "Threaded Graphics to MID: A New Journey"<br />
<a href="http://software.intel.com/en-us/blogs/2009/08/04/from-directx-to-opengl-wheels-up/">Blog 2: </a> "From DirectX to OpenGL - Wheels Up"<br />
<a href="http://software.intel.com/en-us/blogs/2009/08/18/opengl-graphic-formats-and-conversion/">Blog 3:</a> "OpenGL Graphic Formats and Conversion"<br />
<a href="http://software.intel.com/en-us/blogs/2009/09/09/scene-graphs-and-instancing/">Blog 4:</a> "Scene Graphs and Instancing"<br /><a href="http://software.intel.com/en-us/blogs/2009/09/29/load-follow-or-get-out-of-the-way/">Blog 5:</a> "Load, Follow, or Get Out of the Way" </p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/10/13/round-and-round-in-and-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Load, Follow, or Get Out of the Way</title>
		<link>http://software.intel.com/en-us/blogs/2009/09/29/load-follow-or-get-out-of-the-way/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/09/29/load-follow-or-get-out-of-the-way/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 17:01:51 +0000</pubDate>
		<dc:creator>Judy Hartley (Intel)</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[Graphics & Media]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gamming]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[OSG]]></category>
		<category><![CDATA[Visual Adrenaliine]]></category>
		<category><![CDATA[Visual Computing]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/09/29/load-follow-or-get-out-of-the-way/</guid>
		<description><![CDATA[Hi again, everyone. This is my 5th blog on my project of porting a DirectX interactive demo to OpenGL. The name of the demo I am porting is “Destroy the Castle”. I call it “OpenGL Castle Destruction” in the OpenGL version. A list of my previous blogs on this topic can be found at the [...]]]></description>
			<content:encoded><![CDATA[<p>Hi again, everyone. This is my 5th blog on my project of porting a DirectX interactive demo to OpenGL. The name of the demo I am porting is “Destroy the Castle”. I call it “OpenGL Castle Destruction” in the OpenGL version. A list of my previous blogs on this topic can be found at the bottom of this blog.</p>
<p>If you have been following along with me as I continue to develop this application, you know that I have started using <a href="http://www.openscenegraph.org/projects/osg">OpenSceneGraph </a>(OSG) as a method for loading and displaying all of the many objects I need to have for the demo. I mentioned in the last blog that I was able to load all of the object files into my OpenGL application with the use of OSG. What I didn’t tell you was that the time to load all of these files was terrible. In this case, it was taking upwards to 10 minutes before the scene was drawn and the application ready. I had to find a better way to load my objects.</p>
<p>After doing some research on loading the .x files directly with OSG (yes, this is possible, although I found that the .x files I have are not compatible with the .x file loader that OSG currently has), I found another tool provided by OSG called <a href="http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/osgconv">osgconv</a>. This tool converts other formatted graphics files into “.ive” files, which is an OSG proprietary native binary format. Another neat thing about the tool osgconv is that you can convert many .obj files into one .ive file. Oh, it’s so easy to say that, but it did take me a while to figure out how to do it. I have over 400 separate blocks that make up the castle, and osgconv is a command line tool. I tried opening a text file and setting up the command in the file first, then copying and pasting to the command line. It didn’t work the first time. It didn’t work the second time I tried, either, after making some adjustments. There were just too many files. Finally, I decided to convert 10 blocks at a time. That resulted in almost 50 files. Then I combined those files into one big .ive file. That did the job. Now, with all my objects converted into .ive files, guess how long it takes my application to start? Less than 2 seconds! Awesome!</p>
<p>Ok, so the objects are loading fast and I now have the home view I want (see previous blog). Next step was to anchor the scene so that first the cannon was centered in the scene and then fix it so the cannon rotates and move up and down based on the movements of the mouse.</p>
<p>I solved this step in two sections. First, by setting up my camera so that it follows the cannon as it moves. OSG has quite a few camera manipulators in its API, and hundreds of functions. While my main irritation with OSG remains the lack of references WITH EXAMPLES, they do have some tutorials that are useful to help you learn how to use all the tools available within OSG. One of those tutorials shows how to set up a manipulator to follow a particular node or object. I used this implementation to set the camera to follow the cannon. Now all I had to do was get the cannon moving.</p>
<p>My first rudimentary implementation was simply to find the X and Y locations of the mouse and split the screen in half in both directions. It the mouse’s X location was greater than the half the screen length plus 10 percent, then I rotated the cannon a very small amount ( one tenth of a degree) in that direction. So then the cannon would move to the right if the mouse was clicked on the right-hand side of the screen and move to the left if the mouse was clicked on the left-hand side of the screen. If you clicked in the middle of the screen, the motion stopped. It worked, but it didn’t fulfill all of my requirements. Also, it would continue to move in the direction of the last click until the middle was clicked.</p>
<p>One of the really nice things about OSG is that it is open source. I was able to dip down into the manipulator code and see how mouse movement was handled there. This helped me to develop my second implementation. In this version, I calculate the angle that the cannon needs to be moved based on the X and Y coordinates of the mouse location (when it is moved or pushed, not just clicked ). To do this requires that you translate the X and Y mouse location into x, y and z coordinates and then get the angle that the cannon needs to be moved to face that location. It took me a while to figure out how it was done and even more time to take what I learned and adapt it to my code so the cannon follows the mouse. The code I am now using is in three parts (from three different files) and is shown below:</p>
<div id="attachment_10331" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/in-the-node-maxtrix-manipulator.jpg"><img class="size-medium wp-image-10331" src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/in-the-node-maxtrix-manipulator-300x136.jpg" alt="From the Matrix Manipulator Handle" width="300" height="136" /></a><p class="wp-caption-text">From the Matrix Manipulator Handle</p></div>
<p>&lt;</p>
<div id="attachment_10333" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/from-the-pick-handler.jpg"><img class="size-medium wp-image-10333" src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/from-the-pick-handler-300x118.jpg" alt="From the Handler function of PickHandler.cpp" width="300" height="118" /></a><p class="wp-caption-text">From the Handler function of PickHandler.cpp</p></div>
<div id="attachment_10335" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/from-the-cannon-callback-function.jpg"><img class="size-medium wp-image-10335" src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/from-the-cannon-callback-function-300x294.jpg" alt="And Finally, the Code from the Cannon Callback Function" width="300" height="294" /></a><p class="wp-caption-text">And Finally, the Code from the Cannon Callback Function</p></div>
<div id="attachment_10337" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/final-snippet.jpg"><img class="size-medium wp-image-10337" src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/10/final-snippet-300x47.jpg" alt="Last little section also from Cannon Callback Function" width="300" height="47" /></a><p class="wp-caption-text">Last little section also from Cannon Callback Function</p></div>
<div id="attachment_10185" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/09/castle.jpg"><img class="size-medium wp-image-10185" src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/09/castle-300x235.jpg" alt="OpenGL Castle Destruction as it stands now" width="300" height="235" /></a><p class="wp-caption-text">OpenGL Castle Destruction as it stands now</p></div>
<p>Until next time....</p>
<p>For those of you who missed the previous blogs, here are some links:</p>
<p><a href="http://software.intel.com/en-us/blogs/2009/05/26/threaded-graphics-to-mid-a-new-journey/">Blog 1:</a> "Threaded Graphics to MID: A New Journey"<br />
<a href="http://software.intel.com/en-us/blogs/2009/08/04/from-directx-to-opengl-wheels-up/">Blog 2: </a>"From DirectX to OpenGL - Wheels Up"<br />
<a href="http://software.intel.com/en-us/blogs/2009/08/18/opengl-graphic-formats-and-conversion/">Blog 3:</a> "OpenGL Graphic Formats and Conversion"<br />
<a href="http://software.intel.com/en-us/blogs/2009/09/09/scene-graphs-and-instancing/">Blog 4:</a> "Scene Graphs and Instancing"</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/09/29/load-follow-or-get-out-of-the-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scene Graphs and Instancing</title>
		<link>http://software.intel.com/en-us/blogs/2009/09/09/scene-graphs-and-instancing/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/09/09/scene-graphs-and-instancing/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 16:24:54 +0000</pubDate>
		<dc:creator>Judy Hartley (Intel)</dc:creator>
				<category><![CDATA[Graphics & Media]]></category>
		<category><![CDATA[Mobility]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[computer graphics]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Software application]]></category>
		<category><![CDATA[Visual Computing]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/09/09/scene-graphs-and-instancing/</guid>
		<description><![CDATA[This is the fourth blog I’ve written on the subject of porting a DirectX demo over to OpenGL. The first blog details what my project is about. The second and third blogs talk about some of the areas I have been working on and the troubles I’ve been having with the conversion of .x files [...]]]></description>
			<content:encoded><![CDATA[<p>This is the fourth blog I’ve written on the subject of porting a DirectX demo over to OpenGL.  The <a href="http://software.intel.com/en-us/blogs/2009/05/26/threaded-graphics-to-mid-a-new-journey/">first</a> blog details what my project is about.  The <a href="http://software.intel.com/en-us/blogs/2009/08/04/from-directx-to-opengl-wheels-up/">second</a> and <a href="http://software.intel.com/en-us/blogs/2009/08/18/opengl-graphic-formats-and-conversion/">third</a> blogs talk about some of the areas I have been working on and the troubles I’ve been having with the conversion of .x files into a format I can use for OpenGL.  COLLADA files were suggested and I’ve spent quite a bit of time working on files in various mesh or graphic programs to get a consistent way to convert .x files.  I think I’ve mentioned that I wrote a Perl script to convert .x files into .obj files.  I also wrote a draw function for an .obj file loader I found on the web.  The problem was that some of the obj files would render correctly and some wouldn’t.  I was also dealing with having quite a few objects to load and I wanted an easier way to handle all of the objects.</p>
<p>When I explained my issues with one of the graphics gurus I’m very fortunate to work around, he said that there were two main ways to handle the objects: Scene Graphs and Instancing.  We took a look at the DirectX code and discovered that the writers of this code used Instancing for the bugs and the castle blocks.  In case you haven’t seen the Destroy the Castle demo, here is a screen shot:</p>
<a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/09/graphics02-sep-04-0932.jpg"><img src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/09/graphics02-sep-04-0932-300x233.jpg" alt="The Original &quot;Destroy the Castle&quot; demo" width="300" height="233" class="size-medium wp-image-9669" /></a><br />
Naturally, my first instinct was to use Instancing for my OpenGL program as well.  It turns out, however, that there is no function for instancing in OpenGL without extensions.  Yes, you can do it with glDrawElementsInstancedEXT if you have a high-end graphics card that supports the use of these functions.  But since I am creating my code to be ported to smaller devices, it isn’t likely that these functions will work for my purposes.  You can use a technique called <a href="http://http.download.nvidia.com/developer/SDK/Individual_Samples/DEMOS/OpenGL/src/glsl_pseudo_instancing/docs/glsl_pseudo_instancing.pdf">GLSL Pseudo-Instancing</a> which Nvidia demonstrated.  I haven’t gotten into shaders as yet, and I could only find one example of this use, so I decided to look into Scene Graphs.</p>
<p>According to <a href="http://www.wikipedia.org/">Wikipedia</a>, A <a href="A%20scene%20graph%20is%20a%20general%20data%20structure%20commonly%20used%20by%20vector-based%20graphics%20editing%20applications%20and%20modern%20computer%20games.%20Examples%20of%20such%20programs%20include%20AutoCAD,%20Adobe%20Illustrator,%20Acrobat%203D,%20OpenSceneGraph%20and%20CorelDRAW.">scene graph </a>is a general data structure commonly used by vector-based graphics editing applications and modern computer games.   They have links to several commonly used programs.  I went to the <a href="http://www.openscenegraph.org/projects/osg">Open Scene Graph </a>(OSG) website.  After reading about what they could do and seeing tutorials available to help, I decided to install it on my system and try it out.  It was fairly easy to install in onto my system with the help of an article or two.  I ended up changing some of the environment variables from ones using a reference to another environment variable to a direct reference to the file.  But it compiled on the first try, and I think that is a major accomplishment all by itself!  After using it for over a week, I’m impressed but also a little frustrated. Well, that’s par for the course, isn’t it?  The great thing is that OSG was able to load and texture my .obj files with no trouble.  All of my .obj files!   So I think I can say that my Perl script works.  In OSG, I have recognizable landscape and objects.  See the picture below:<br />
<a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/09/graphics01-sep-09-0827.jpg"><img src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/09/graphics01-sep-09-0827-300x235.jpg" alt="OpenGL &quot;Castle Destruction&quot; so far." width="300" height="235" class="size-medium wp-image-9668" /></a>
<p>The lighting isn’t right yet, and I still don’t pivot the view with the cannon, but the castle is there and several bugs are stationed on the left side.  Notice the “break” in the castle that you don’t see in the original?  It actually exists there as well, but we don’t see it because the original angle of the cannon is set so it doesn’t show.  Take a look at these side by side shots after I move the camera.</p>
<table border="1">
<tr>
<td><div id="attachment_9676" class="wp-caption alignleft" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/09/graphics01-sep-09-08271.jpg"><img src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/09/graphics01-sep-09-08271-300x235.jpg" alt="OpenGL program once the view is moved." width="300" height="235" class="size-medium wp-image-9676" /></a><p class="wp-caption-text">OpenGL program once the view is moved.</p></div></td>
<td><div id="attachment_9677" class="wp-caption alignright" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/09/graphics02-sep-09-0833.jpg"><img src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/09/graphics02-sep-09-0833-300x237.jpg" alt="Original program showning break in castle." width="300" height="237" class="size-medium wp-image-9677" /></a><p class="wp-caption-text">Original program showning break in castle.</p></div></td>
</tr>
</table>
<p>Another thing I’ve discovered is that OSG can be easily attached to your OpenGL/GLUT code.  They have some example code to show you how to do it, and that makes incorporating OSG into your program fairly easy.  The thing I do find frustrating is that the reference documentation list those functions that are available, but in many cases don’t even tell you what they should be used for.  For instance, I was having a hard time changing the initial view in the window.  The default view shows objects with the standard backdrop blue behind them.  My sky object (a hemisphere with the sky material used on the inside ) displays as a black object against the blue background. See the picture below:<br />
<div id="attachment_9679" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/09/graphics03-sep-04-1144.jpg"><img src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/09/graphics03-sep-04-1144-300x235.jpg" alt="Original Camera Position for OpenGL program." width="300" height="235" class="size-medium wp-image-9679" /></a><p class="wp-caption-text">Original Camera Position for OpenGL program.</p></div></p>
<p>What happens is that you have to use the mouse to scroll INTO the hemisphere and there you can see the scene as rendered above.  I will not tell you how long it took me to set the code so it would start inside the globe, but take it from me, it was a long time.<br />
Here are a couple of lines of the original code:</p>
<p>
Global:<br />
osgGA::TrackballManipulator *Vman = new osgGA::TrackballManipulator();</p>
<p>Inside Main:<br />
viewer = new osgViewer::Viewer;<br />
window = viewer-&gt;setUpViewerAsEmbeddedInWindow(100,100,800,600);<br />
viewer-&gt;setSceneData(root);<br />
viewer-&gt;setCameraManipulator(Vman);</p>
<p>And here are the ammended lines :</p>
<p>Global:<br />
osgGA::TrackballManipulator *Vman = new osgGA::TrackballManipulator();<br />
Inside Main:<br />
osgGA::TrackballManipulator *Vman = new osgGA::TrackballManipulator();</p>
<p>viewer = new osgViewer::Viewer;<br />
window = viewer-&gt;setUpViewerAsEmbeddedInWindow(100,100,800,600);</p>
<p>Vman-&gt;setHomePosition(osg::Vec3d( -500, 12150, 380),osg::Vec3d(-500,0,0), osg::Vec3d( 0, 0, 1 ), false );</p>
<p>viewer-&gt;setSceneData(root);<br />
viewer-&gt;setCameraManipulator(Vman);</p>
<p>The one new line tells the Camera Manipulator where to start. Notice, too that the “z” direction is “up” rather than the standard “y”.  From what I understand, this is specific to OSG.  It does kind of throw you for a loop at first, though. </p>
<p>All in all, I am finally beginning to see how to go about completing this project.  My next job is to get the lighting right, and get the view pivoting about the camera.  Keep your chin up, and I’ll let you know soon how it goes. Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/09/09/scene-graphs-and-instancing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenGL Graphic Formats and Conversion</title>
		<link>http://software.intel.com/en-us/blogs/2009/08/18/opengl-graphic-formats-and-conversion/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/08/18/opengl-graphic-formats-and-conversion/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 18:49:36 +0000</pubDate>
		<dc:creator>Judy Hartley (Intel)</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[Graphics & Media]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Application development]]></category>
		<category><![CDATA[computer graphics]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[OpenGL]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/08/18/opengl-graphic-formats-and-conversion/</guid>
		<description><![CDATA[I’m back again to share with you some of the things I am working on currently. If you’ve been following, you know that I have started a project to convert a DirectX interactive demo over to OpenGL. My first blog about this subject is Threaded Graphics to MID - a New Journey. This blog talks [...]]]></description>
			<content:encoded><![CDATA[<p>I’m back again to share with you some of the things I am working on currently. If you’ve been following, you know that I have started a project to convert a DirectX interactive demo over to OpenGL. My first blog about this subject is <a href="http://software.intel.com/en-us/blogs/2009/05/26/threaded-graphics-to-mid-a-new-journey/">Threaded Graphics to MID - a New Journey</a>. This blog talks about the project plan and the different phases I expect to go through. The second blog, <a href="http://software.intel.com/en-us/blogs/2009/08/04/from-directx-to-opengl-wheels-up/">From DirectX to OpenGL - Wheels up</a>, talks about the differences between DirectX and OpenGL and the compromises I’ve had to make so far. It also mentions some of the OpenGL tools and libraries I’ve found.</p>
<p>At this point I have a menu bar that works fairly well and I’m able to load the background sky and parts of the terrain. The way I’ve been doing this is to take the DirectX object files (.x files) and use my own Perl script to convert them into .obj files. I am able to get this to work, but some of the files I have converted have issues when they are drawn in the window. If I load the .obj file into a mesh processing program (such as <a href="http:////www.blender.org/">Blender</a> or <a href="http:////meshlab.sourceforge.net/">MeshLab</a> ) it displays just fine. Take a look at this bug object in MeshLab:</p>
<div id="attachment_8959" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/graphics02-aug-18-0729.jpg"><img class="size-medium wp-image-8959" src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/graphics02-aug-18-0729-300x271.jpg" alt="Bug object in MeshLab" width="300" height="271" /></a><p class="wp-caption-text">Bug Object in MeshLab</p></div>
<p>Now, after loading it into the OpenGL window, take a look at the object. Yes, the texture shown is not actually for this bug object. Try to look beyond the texture. See the incorrect rendering?</p>
<div id="attachment_8966" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/graphics16-aug-18-0940.jpg"><img class="size-medium wp-image-8966" src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/graphics16-aug-18-0940-300x272.jpg" alt="Object Rendered in OpenGL Window" width="300" height="272" /></a><p class="wp-caption-text">Object Rendered in OpenGL Window</p></div>
<p>Yes, the legs on one side of the bug do not connect the way they should. This is the same .obj file, but for some odd reason, it has trouble rendering correctly in the OpenGL window. I have the correct object for the material, by the way. It loads just fine in MeshLab and, with the debugger attached, it displays fine in the window as well. Pretty gruesome bug, isn't it?:</p>
<table border="1">
<tbody>
<tr>
<td>
<div id="attachment_8969" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/graphics11-aug-18-0823.jpg"><img class="size-medium wp-image-8969" src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/graphics11-aug-18-0823-300x204.jpg" alt="A Different Bug Object in MeshLab" width="300" height="204" /></a><p class="wp-caption-text">A Different Bug Object in MeshLab</p></div></td>
<td>
<p><div id="attachment_8971" class="wp-caption aligncenter" style="width: 310px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/graphics06-aug-18-0804.jpg"><img class="size-medium wp-image-8971" src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/graphics06-aug-18-0804-300x270.jpg" alt="Second Bug Rendered in OpenGL Window" width="300" height="270" /></a><p class="wp-caption-text">Bug Rendered in OpenGL Window</p></div></td>
</tr>
</tbody>
</table>
<p>But if you run the application without debugging (staying with the debug configuration), the application won’t display at all. So, is it my conversion script? Or something I am doing when I draw the objects? I’m not sure yet. If you have an idea, let me know.</p>
<p>I don’t know if this is standard practice with .x files or not, but the .x files I have include a few or many different objects in each one. For instance, I have a castle.x file which has 493 different objects included in that one file. I modified my conversion script to put each object into its own file, just so I could see each item individually. Found some interesting surprises during this process. Check out object number 263 below:</p>
<p><div id="attachment_8984" class="wp-caption aligncenter" style="width: 259px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/graphics13-aug-18-0837.jpg"><img class="size-medium wp-image-8984" src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/graphics13-aug-18-0837-249x300.jpg" alt="Surprise Object in .X File" width="249" height="300" /></a><p class="wp-caption-text">Surprise Object in .X File</p></div>
<p>Just recently I talked with another engineer here who had done a lot of work with OpenGL just last winter. He suggested that rather than going to .obj files, I should create <a href="http://www.khronos.org/collada/">Collada</a> files. Blender will import a .x file and you can export that object into a .dae file, which is the extension for Collada files. If you download Collada, there are several examples included along with both a dll producing project and a static library producing project. One of the samples is a "rubber ducky" complete with texture file. I can load this file into MeshLab and it adds the texture to the object. So now I'm trying to figure out how to insert a material into a Collada file so that it will load the texture as well. There are two different Collada based c++ APIs for loading and saving Collada files; <a href="https://collada.org/mediawiki/index.php/Portal:COLLADA_DOM">Collada DOM </a>and <a href="http://www.feelingsoftware.com/content/view/62/76">FCollada</a>. I chose the Collada DOM API. If you want to use the Collada DOM, you have to pay special attention to the instructions on the site about compiling and setting up your links in the project properties and don't do what I unintentionally did at first and try to connect both the static library and the dll library. After a great deal of work, I was able to get one of the samples to load successfully. I haven’t managed to actually display it in the window yet, but I’m working on it now.</p>
<p>The same engineer who suggested Collada files also thought that eventually I would need to use VBOs (Vertex Buffer Objects) to hold all of the objects I will be drawing in the window. I can see already that my code is going to need to load lots of different objects to make up the castle, all of its blocks, the bugs, the cannon and finally the cannonballs. I’m not sure how that’s all going to come together, but I’m certain that I’ll figure out a way. Well, that’s all for right now. I’ll write again in a couple of weeks and let you know what progress I’ve made.</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/08/18/opengl-graphic-formats-and-conversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>From DirectX to OpenGL – Wheels Up</title>
		<link>http://software.intel.com/en-us/blogs/2009/08/04/from-directx-to-opengl-wheels-up/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/08/04/from-directx-to-opengl-wheels-up/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 15:40:02 +0000</pubDate>
		<dc:creator>Judy Hartley (Intel)</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[Graphics & Media]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Application development]]></category>
		<category><![CDATA[DirectX]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[OpenGL]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/08/04/from-directx-to-opengl-wheels-up/</guid>
		<description><![CDATA[The first phase of my project to take a DirectX demo to a MID begins with porting DirectX code to OpenGL. In the past several weeks I have spent a lot of time preparing for this phase. I’ve read about half of the OpenGL Programming Guide, often called the “Redbook”, and spent a significant amount [...]]]></description>
			<content:encoded><![CDATA[<p>The first phase of my project to take a DirectX demo to a MID begins with porting DirectX code to OpenGL.  In the past several weeks I have spent a lot of time preparing for this phase.  I’ve read about half of the OpenGL Programming Guide, often called the “Redbook”, and spent a significant amount of time examining the code for the demo I am porting.  I was a little uncertain exactly where to start the porting process, but began at the start of the program.  This is a fairly complex, interactive demo with a substantial amount of code.  Just the entry point code is unbelievably mired in DirectX variable types and functions.   There are also Windows specific functions which I’m not using as this project is intended to run on Linux-based OSs.  So all of that has to be eliminated or replaced with standard C or C++ code and/or OpenGL variables and functions.  The process wouldn’t be that hard if there was a one-to-one relationship between DirectX and OpenGL.  Of course, that isn’t the case.  Now, I’m not an expert in either DirectX or OpenGL, so there may be better ways to accomplish my tasks.  Feel free to comment and let me know any shortcut or work-around you may have found.</p>
<p>     Take the first DirectX element I came to in the code: D3DXVECTOR2.  This should be a fairly easy transistion, right?   Just replace it with the OpenGL variable and move on.   Hmmm….I wish it was that easy.  You see, OpenGL doesn’t really have special variables for vectors.  OpenGL has commands, glVertex2f, glVertex2i, etc,  that are used inside another set of commands, glBegin() and glEnd() to form a primative.  But they won’t work as stand alone variables.  So, to replace D3DXVECTOR2 you use a GLfloat array, such as this:</p>
<p>	GLfoat  fVariableName[2];</p>
<p>     You could create your own struct which has two floats( or 3 or 4) and use the structs instead.  That is perfectly acceptable.  It really doesn’t alter the fact that the coder has to break down the DirectX variables into their basic types.  In some cases that is fairly easy, as in the example shown above.  But in other cases the methods used vary so greatly that there isn’t a reliable substitute.  There is a whole interface in DirectX that is used to manipulate various resources: IDirect3DResource9.  The code I am porting from creates a pointer to this interface type, like this:</p>
<p>	IDirect3DTexture9* pTexture;</p>
<p>     There are no texture variables in OpenGL.  If you look at the references for this interface in DirectX, there are a lot of associated methods that help the developer achieve the look they want.  OpenGL also has methods to help the developer, but they aren’t all packaged up together as they are in DirectX.    </p>
<p>     Try this variable: CDXUTDialog from the DX Utility Toolkit.  There are no dialogs in OpenGL, and there aren’t any in GL Utility Toolkit either.  Yes, there are sub-windows, but even using sub-windows you don’t have any of the typical control elements you might expect to find, such as buttons, text boxes and entry boxes.  To display a menu box, I found a user interface library called GLUI which does have many of the control devices you might need.  There are other libraries available.  I looked at several of them, and chose GLUI based on three factors: First, it had most of the controls that I wanted to use ; Second, it was most recently updated, indicating that there was still some interest in improving the code and keeping it updated; Third, it has a clearly indicated license.  I can’t speak for others, but I have spent way too much time searching for a license for some bit of code I used when working on the release of a project.  Now before I use code from another source I make sure I have the license information.  But, I digress.  GLUI does a fairly good job.  It works well with GLUT and that makes my life easier.  The menu is not as “pretty” as the original menu, but it has the essential control elements and it interacts well with the main window.  You can see a picture of my GLUI menu beside the original DirectX menu below.  Several of the original controls have been removed because they were deemed un-needed for the new application.</p>
<table align="center">
<tr>
<td>
<div id="attachment_8546" class="wp-caption aligncenter" style="width: 158px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/castle02-aug-04-08001.jpg"><img src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/castle02-aug-04-08001-148x300.jpg" alt="Menu using GLUI" width="148" height="300" class="size-medium wp-image-8546" /></a><p class="wp-caption-text">Menu using GLUI</p></div></td>
<td>
<div id="attachment_8540" class="wp-caption aligncenter" style="width: 129px"><a href="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/xmenu.jpg"><img src="http://software.intel.com/en-us/blogs/wordpress/wp-content/uploads/2009/08/xmenu-119x300.jpg" alt="Menu on DirectX application" width="119" height="300" class="size-medium wp-image-8540" /></a><p class="wp-caption-text">Menu on DirectX application</p></div></td>
</tr>
</table>
<p>     The next step in the porting process deals with models and meshes.  DirectX uses a file format with the extension “.x”.  I would like to use these same models if I can, but wasn’t sure about how to go about loading a .x file into my OpenGL program.  What I ended up doing was writing a script in Perl that would convert a .x file into a .obj file.  There are several different implementations available to open an .obj file in a OpenGL program.  I took what I considered to be the best of them and incorporated it into my code (carefully checking the license information first!).  Although the imported code read in the vertex information, it didn’t handle any of the material information in the .obj file, so I modified it to be able to load the material information as well.  Finally, I wrote an additional function to draw the object on the OpenGL screen.  In the process I have found and fixed two bugs in the original code and sorted the faces from the .obj file by the material type they use.  That last is to reduce  the number of times that glBegin() and glEnd() need to be called.  So far, the code is working for objects having only one material.  Which seems to indicate that my sorting material code isn’t helping.  Well, more on that in my next blog.  I’ve been sitting on this one for a while, so I want to go ahead and post this.  I should be back soon with some more insights.  Until then…</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/08/04/from-directx-to-opengl-wheels-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Threaded Graphics to MID - A New Journey</title>
		<link>http://software.intel.com/en-us/blogs/2009/05/26/threaded-graphics-to-mid-a-new-journey/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/05/26/threaded-graphics-to-mid-a-new-journey/#comments</comments>
		<pubDate>Tue, 26 May 2009 16:00:39 +0000</pubDate>
		<dc:creator>Judy Hartley (Intel)</dc:creator>
				<category><![CDATA[Graphics & Media]]></category>
		<category><![CDATA[Mobility]]></category>
		<category><![CDATA[DirectX]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[MID]]></category>
		<category><![CDATA[OpenGL]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/05/26/threaded-graphics-to-mid-a-new-journey/</guid>
		<description><![CDATA[Hi Everyone. It’s been a while since I did any blogging. The reason is that I’ve been mostly wrapping up my work on several different projects. Now, I’m finally getting to move on to a new challenge. A few years ago a team of people developed an application to demonstrate the threading capabilities of Intel’s [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Everyone.  It’s been a while since I did any blogging.  The reason is that I’ve been mostly wrapping up my work on several different projects.  Now, I’m finally getting to move on to a new challenge.  A few years ago a team of people developed an application to demonstrate the threading capabilities of Intel’s desktop technologies.  This application is known as the “Destroy the Castle” demo.  In the demo, a user can shoot cannonballs at a castle and w My new project utilizes this application and will be divided into four phases.  </p>
<p>The first phase is to translate the graphics code in the demo to use OpenGL.  I’ve never used OpenGL before, so that is going to be a steep learning curve for me.  I’ve also done very little with DirectX code, but since that is already in place, my task will be to find the corresponding functions in OpenGL.  The good news here is that I have plenty of experts in groups near me to help me out if I get stuck.  I’ve already started looking at the DirectX code in the application and it uses the utility toolkit DXUT.  While that might initially be considered a difficulty, OpenGL now has GLUT, its own utility toolkit.  So, finding replacement functions may not be as difficult as it might have been.</p>
<p>The second phase will be to put this new version onto a netbook running a Windows OS and using the Intel® Atom processor.  This will be challenging in a second way as we are porting a large demo over to a device that works with less power and available space.  The application is also threaded, and since the Intel Atom is a one-core processor, CPU usage could impact playability quite a bit.  And then there is the question of whether the Atom chipset has sufficient OpenGL support.</p>
<p> If I am at least partially successful on phase 2, then phase 3 will be to get the demo working on a netbook using Moblin 2.0.   This OS is just coming out and it looks to be a big improvement over 1.0.  But, will the demo work on it?   By the time I start working on this phase I will know whether the demo will work on Atom, so the challenge here is to determine how well Moblin 2.0 works with OpenGL graphics.</p>
<p>The last phase of this project is to see if I can get the demo to work on a MID with Moblin 2.0.  Again, this is another type of challenge, since we will know at that point that the demo will work on Moblin 2.0 and the Intel Atom.  The challenge this phase is to see what design changes need to be made in order to play the demo on a small-screen device which may or may not have access to control buttons.</p>
<p>I’m looking forward to each and every one of these challenges, and I plan to continue discussing the difficulties and solutions I find along the way with all of you.  So keep checking back here now and then to see how I’m doing and offer your comments and suggestions.  The journey begins now…</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/05/26/threaded-graphics-to-mid-a-new-journey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Libraries Lost and Found</title>
		<link>http://software.intel.com/en-us/blogs/2009/02/19/linux-libraries-lost-and-found/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/02/19/linux-libraries-lost-and-found/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 19:33:38 +0000</pubDate>
		<dc:creator>Judy Hartley (Intel)</dc:creator>
				<category><![CDATA[Mobility]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[application release]]></category>
		<category><![CDATA[distribution]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MID]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/02/19/linux-libraries-lost-and-found/</guid>
		<description><![CDATA[Developing an application to run on Linux systems is, for the most part, fun and rewarding.  I always enjoy using new tools and seeing how much I can get the tool to do for me.   But after the construction is complete, you need to test it on the intended target devices.  I’ve been developing an [...]]]></description>
			<content:encoded><![CDATA[<p><span style="Arial;">Developing an application to run on Linux systems is, for the most part, fun and rewarding.<span style="yes;">  </span>I always enjoy using new tools and seeing how much I can get the tool to do for me.<span style="yes;">   </span>But after the construction is complete, you need to test it on the intended target devices.<span style="yes;">  </span>I’ve been developing an application to run on MID devices.<span style="yes;">  </span>There are several operating systems being used for MID devices, but the current favorite seems to be MIDinux.<span style="yes;">  </span>It is not based on Ubuntu Linux, which is what I’ve been developing on.<span style="yes;">  </span>It is based on Red Flag Linux.<span style="yes;">  </span>Still, shouldn’t be hard.<span style="yes;">  </span>They are both Linux, right?</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span><span style="Arial;">Actually, it isn’t that easy for someone unfamiliar with the different flavors of Linux.<span style="yes;">  </span>These two operating systems use different package installation tools.<span style="yes;">  </span>You have to learn how to use both, and then you have to find the right packages to install.<span style="yes;">  </span>Dependencies were haunting me for quite a while, and I’m not talking about foreign oil.<span style="yes;">  </span>My tool needs two packages to be installed before use.<span style="yes;">  </span>Only, on a clean system, one of those two packages needs 2 other packages and the second package needs 3.<span style="yes;">  </span>And so it goes.<span style="yes;">  </span>Eventually, you end up with a long list of libraries that you need to install in each new system, or you learn what I learned this week.<span style="yes;">  </span>You bundle the needed libraries into the distribution package.<span style="yes;">   </span>Now, there are at least two ways to accomplish this.<span style="yes;">  </span>First, you can add the libraries as static libraries in your source code.</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span><span style="Arial;">I started with this method, but with the Anjuta IDE, even though I marked the libraries as being static, didn’t include them in the executable.<span style="yes;">  </span>This might have been my fault, although I had a team member look as well, and we couldn’t find anything to change.<span style="yes;">  </span>I also &lt;gasp&gt; checked the user manual for Anjuta and tried to follow it, but again I ended up frustrated.<span style="yes;">  </span>So, I went to the Linux guru in our department and he gave me some pearls of wisdom which I will pass along to those of you who, like me, are fairly new to Linux.</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"> <span style="Arial;">A second possible way to add the libraries is to include them in your distribution tarball in a separate folder.<span style="yes;">  </span>Here is the way I was shown:</span></p>
<ol style="0in;" type="1">
<li class="MsoNormal"><span style="Arial;">Create two folders, named “bin” and “lib”.<span style="yes;">  </span>Actually, you can name them anything you want, but the example below uses those two names.<span style="yes;">  </span>Put the binary in the “bin” folder and the libraries that need to be included in the “lib” folder.<span style="yes;">  </span>To easily get the libraries into the bin folder, first run the “ldd” command on the binary:</span><span style="small;"><span style="Arial;"><span style="1;">  </span></span></span><span style="&quot;Times New Roman&quot;;"><span style="small;"><span style="1;">          </span></span></span></li>
</ol>
<table class="MsoTableGrid" style=".5pt solid windowtext;" border="1" cellspacing="0" cellpadding="0" align="left">
<tbody>
<tr style="yes;">
<td style="windowtext 1pt solid;" valign="top">
<p class="MsoNormal" style="exactly;"><span style="&quot;Times New Roman&quot;;"><span style="small;">$ ldd &lt;binary name&gt;</span></span></p>
</td>
</tr>
</tbody>
</table>
<p> </p>
<p> </p>
<p><span style="small;"><span style="Arial;">You should see something like this list although it will probably be longer:</span></span><span style="1;"><span style="Arial;">        </span></span></p>
<p class="MsoNormal" style="0in 0in 0pt;">
<table class="MsoTableGrid" style=".5pt solid windowtext;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr style="yes;">
<td style="windowtext 1pt solid;" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;"><span style="small;">linux-gate.so.1 =&gt;<span style="yes;">  </span>(0xb7f8d000)</span></span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;"><span style="small;">libdbus-glib-1.so.2 =&gt; /usr/lib/libdbus-glib-1.so.2 (0xb7f5d000)</span></span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;"><span style="small;">libdbus-1.so.3 =&gt; /usr/lib/libdbus-1.so.3 (0xb7f27000)</span></span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;"><span style="small;">libgthread-2.0.so.0 =&gt; /usr/lib/libgthread-2.0.so.0 (0xb7f21000)</span></span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;"><span style="small;">librt.so.1 =&gt; /lib/tls/i686/cmov/librt.so.1 (0xb7f18000)</span></span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;"><span style="small;">libglademm-2.4.so.1 =&gt; /usr/lib/libglademm-2.4.so.1 (0xb7f0e000)</span></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="0in 0in 0pt;"> </p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">This is the list of libraries that your program depends on. You can use any method you prefer to put all those libraries into the “lib” folder.<span style="yes;">  </span>Our guru suggested this shell command:</span></p>
<p class="MsoNormal" style="0in 0in 0pt;">
<table class="MsoTableGrid" style=".5pt solid windowtext;" border="1" cellspacing="0" cellpadding="0" width="741">
<tbody>
<tr style="yes;">
<td style="windowtext 1pt solid;" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;"><span style="small;">$ for i in `ldd &lt;binary name&gt; | cut -f2 -d"=" | cut -f2 -d" " | grep .so`; do cp i ../lib/; done</span></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="0in 0in 0pt;"> </p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="small;"><span style="Arial;">The above command assumes that you are in the “bin” folder where you have put your binary.<span style="yes;">  </span></span></span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">  2.     </span><span style="Arial;">Now, we want to force the OS to look in our “lib” folder first, rather than the default location, so we change the LD_LIBRARY_PATH environmental variable to our new folder:</span></p>
<p class="MsoNormal" style="0in 0in 0pt;">
<table class="MsoTableGrid" style=".5pt solid windowtext;" border="1" cellspacing="0" cellpadding="0" align="left">
<tbody>
<tr style="yes;">
<td style="windowtext 1pt solid;" valign="top">
<p class="MsoNormal" style="exactly;"><span style="&quot;Times New Roman&quot;;"><span style="small;">$ LD_LIBRARY_PATH=../lib ldd ./&lt;binary name&gt;</span></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="0in 0in 0pt;"> </p>
<p class="MsoNormal" style="0in 0in 0pt;"> </p>
<p class="MsoNormal" style="0in 0in 0pt;"> </p>
<p class="MsoNormal" style="0in 0in 0pt;"> </p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="small;"><span style="Arial;">This will result in the following list:</span></span></p>
<p class="MsoNormal" style="0in 0in 0pt;"> </p>
<p class="MsoNormal" style="0in 0in 0pt;">
<table class="MsoTableGrid" style=".5pt solid windowtext;" border="1" cellspacing="0" cellpadding="0" align="left">
<tbody>
<tr style="yes;">
<td style="windowtext 1pt solid;" valign="top">
<p class="MsoNormal" style="exactly;"><span style="&quot;Times New Roman&quot;;"><span style="small;">linux-gate.so.1 =&gt;<span style="yes;">  </span>(0xb7f8d000)</span></span></p>
<p class="MsoNormal" style="exactly;"><span style="&quot;Times New Roman&quot;;"><span style="small;">libdbus-glib-1.so.2 =&gt; ../lib/libdbus-glib-1.so.2 (0xb7f5d000)</span></span></p>
<p class="MsoNormal" style="exactly;"><span style="&quot;Times New Roman&quot;;"><span style="small;">libdbus-1.so.3 =&gt; ../lib/libdbus-1.so.3 (0xb7f27000)</span></span></p>
<p class="MsoNormal" style="exactly;"><span style="&quot;Times New Roman&quot;;"><span style="small;">libgthread-2.0.so.0 =&gt; ../lib/libgthread-2.0.so.0 (0xb7f21000)</span></span></p>
<p class="MsoNormal" style="exactly;"><span style="&quot;Times New Roman&quot;;"><span style="small;">librt.so.1 =&gt; ../lib/librt.so.1 (0xb7f18000)</span></span></p>
<p class="MsoNormal" style="exactly;"><span style="&quot;Times New Roman&quot;;"><span style="small;">libglademm-2.4.so.1 =&gt; ../lib/libglademm-2.4.so.1 (0xb7f0e000)</span></span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="Arial;"> </span></p>
<p class="MsoNormal" style="none;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="none;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="none;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="none;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="none;"> </p>
<p class="MsoNormal" style="none;"> </p>
<p class="MsoNormal" style="none;"><span style="small;"><span style="Arial;">As you can see, the system is now finding these libraries in our “lib” folder.<span style="yes;">  </span>The one problem with this method is that we have to set that environmental variable every time the program is run.<span style="yes;">  </span>The common solution for this is to create a script that is used as a “wrapper” for your application.<span style="yes;">  </span>Here’s how to do it:</span></span></p>
<p class="MsoNormal" style="none;"><span style="small;"><span style="Arial;">3.    </span></span><span style="Arial;">To create the script:</span><span style="Wingdings;"><span style="Ignore;"><span style="7pt &quot;Times New Roman&quot;;">    </span></span></span></p>
<ul>
<li>
<div class="MsoNormal"><span style="Wingdings;"><span style="Ignore;"><span style="7pt &quot;Times New Roman&quot;;"> </span></span></span><span style="Arial;">Rename your binary to something else, such as &lt;binary name&gt;.bin</span><span style="small;"><span style="Arial;"><span style="2;">               </span></span></span></div>
</li>
</ul>
<p class="MsoNormal" style="0in 0in 0pt;">
<table class="MsoTableGrid" style=".5pt solid windowtext;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr style="yes;">
<td style="windowtext 1pt solid;" valign="top">
<p class="MsoNormal" style="none;"><span style="&quot;Times New Roman&quot;;"><span style="small;">$ mv &lt;binary name&gt;<span style="yes;">  </span>&lt;binary name&gt;.bin</span></span></p>
</td>
</tr>
</tbody>
</table>
<ul>
<li>
<div class="Scilicet" style=".5in;"><span style="Arial;"> </span><span style="Arial;">Create a shell script with the original name of the binary:</span><span style="2;"><span style="Arial;">              </span></span></div>
</li>
</ul>
<p class="MsoNormal" style="0in 0in 0pt;">
<table class="MsoTableGrid" style=".5pt solid windowtext;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr style="yes;">
<td style="windowtext 1pt solid;" valign="top">
<p class="MsoNormal" style="none;"><span style="&quot;Times New Roman&quot;;"><span style="small;">#!/bin/bash</span></span></p>
<p class="MsoNormal" style="none;"><span style="&quot;Times New Roman&quot;;"><span style="small;">#Get full path to this script</span></span></p>
<p class="MsoNormal" style="none;"><span style="&quot;Times New Roman&quot;;"><span style="small;">filename="${BASH_SOURCE[0]}"<span style="yes;">                                                            </span></span></span></p>
<p class="MsoNormal" style="none;"><span style="&quot;Times New Roman&quot;;"><span style="small;">dir=`dirname $filename`</span></span></p>
<p class="MsoNormal" style="none;"><span style="&quot;Times New Roman&quot;;"><span style="small;">cwd=`cd $dir; pwd`</span></span></p>
<p class="MsoNormal" style="none;"><span style="&quot;Times New Roman&quot;;"><span style="small;"> </span></span><span style="&quot;Times New Roman&quot;;"><span style="small;">#Execute binary, after setting variable and pass all args to binary</span></span></p>
<p class="MsoNormal" style="none;"><span style="&quot;Times New Roman&quot;;"><span style="small;">LD_LIBRARY_PATH=$cwd/../lib "$cwd/&lt;binary name&gt;.bin" $*</span></span></p>
</td>
</tr>
</tbody>
</table>
<ul>
<li>
<div class="Scilicet" style="0in 0in 0pt 0.9in;"><span style="Arial;"><span style="small;">Change the permissions on the script to make it executable:<span style="1;"> </span></span></span></div>
</li>
</ul>
<p class="MsoNormal" style="0in 0in 0pt;">
<table class="MsoTableGrid" style=".5pt solid windowtext;" border="1" cellspacing="0" cellpadding="0" align="left">
<tbody>
<tr style="yes;">
<td style="windowtext 1pt solid;" valign="top">
<p class="Scilicet" style="exactly;"><span style="&quot;Times New Roman&quot;;"><span style="small;">$<span style="yes;">  </span>chmod +x &lt;binary name&gt;</span></span></p>
</td>
</tr>
</tbody>
</table>
<p class="Scilicet" style=".5in;"> </p>
<p class="Scilicet" style=".5in;"> <span style="Arial;"> </span></p>
<p class="Scilicet" style=".5in;"><span style="Arial;">Armed with this new technique and with a renewed sense of hope, I loaded my tool onto a new build of MIDinux.<span style="yes;">  </span>The first time I ran it, this is what I got:</span></p>
<p class="MsoNormal" style="0in 0in 0pt;">
<table class="MsoTableGrid" style=".5pt solid windowtext;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr style="yes;">
<td style="windowtext 1pt solid;" valign="top">
<p class="Scilicet" style=".5in;"><span style="10pt;"><span style="Arial;">****MEMORY-ERROR****: &lt;binary name&gt;.bin[19643]: Gslice: assertion failed: sys_page_size &gt;= 2 * LARGEALIGNMENT</span></span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="Arial;">Slightly disappointing, wasn’t it?<span style="yes;">  </span>The key to this problem was in the “lib” folder.<span style="yes;">  </span>When using the “ldd” command, I got ALL the libraries that the application depended on.<span style="yes;">  </span>MIDinux seems to prefer to use the default library location for the libraries it already has rather than using them in another location.<span style="yes;">  </span>Or, maybe it just doesn’t like two copies of the same library.<span style="yes;">  </span>Whatever the reason, I found that by removing all of the libraries that were already loaded on the OS from the “lib” directory I was able to run my tool successfully.<span style="yes;">  </span>Whew!</span> </p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">Well, I hope this blog will help any of you that have been struggling with just such a situation.<span style="yes;">  </span>If you have any tips or suggestions you would like to share, I’d be happy to hear them, and I’m sure other people would, as well.<span style="yes;">  </span>Until next time…</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"> <span style="Arial;">Note:<span style="yes;">  </span>Our Linux guru graciously gave me his permission to share his suggestions with all of you.</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"> </p>
<p> </p>
<p class="MsoNormal" style="0in 0in 0pt;"> </p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/02/19/linux-libraries-lost-and-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross-Platform Wizarding</title>
		<link>http://software.intel.com/en-us/blogs/2008/10/29/cross-platform-wizarding/</link>
		<comments>http://software.intel.com/en-us/blogs/2008/10/29/cross-platform-wizarding/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 15:59:02 +0000</pubDate>
		<dc:creator>Judy Hartley (Intel)</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cross-platform]]></category>
		<category><![CDATA[GTK+]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[wxWidgets]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2008/10/29/cross-platform-wizarding/</guid>
		<description><![CDATA[Hi Everyone.  Well, I’m happy to tell you that the program I’ve been discussing in my previous blogs has completed the code inspection process and has cleared legal.  The decision was made to bundle it with the actual API’s that are being developed in another group so it is not yet out on ISN.  I [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">Hi Everyone.<span style="yes;">  </span>Well, I’m happy to tell you that the program I’ve been discussing in my previous blogs has completed the code inspection process and has cleared legal.<span style="yes;">  </span>The decision was made to bundle it with the actual API’s that are being developed in another group so it is not yet out on ISN.<span style="yes;">  </span>I will begin working on the 1.1 version of the tool in a few days but today I wanted to talk about the interim project I have been doing. </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">Here’s the setup: A member of my team developed a tool some time ago for Win32.<span style="yes;">  </span>He has been updating it and revising it for over a year now and it has gained in popularity.<span style="yes;">  </span>Recently, his tool was developed for Linux by another member of our team. The Linux version is strictly command line driven.<span style="yes;">  </span>To tie both of these two programs together, I was asked to come up with a GUI wizard that would look the same in both Win32 and Linux and make using the tool a little less confusing and more intuitive for the user.</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">My first step was to find the right development tools.<span style="yes;">  </span>Python had been suggested as being a good choice for cross-platform development, so I took a look at that.<span style="yes;">  </span>I also talked to a senior software engineer and got a recommendation for wxWidgets.<span style="yes;">  </span>I had not heard of wxWidgets before, but with his suggestion in hand I went online and had a look at it.<span style="yes;">  </span>Do you know about </span><a href="http://www.wxwidgets.org/"><span style="Arial;">wxWidgets</span></a><span style="Arial;">?<span style="yes;">  </span>It’s a pretty cool toolkit.<span style="yes;">  </span>You can use it with C++, Perl, Python, and even C#.<span style="yes;">  </span>There are distributions of it for Win32, Mac OS X, any version of Linux that uses GTK+, and several more.<span style="yes;">  </span>I’m not really sure how I got to </span><a href="http://wxformbuilder.org/"><span style="Arial;">wxFormBuilder</span></a><span style="Arial;">, but it seemed like the perfect interface to get started with, being a wxWidgets GUI builder, designer and RAD tool that was easily connected to Anjuta (my development IDE in Linux). <span style="yes;"> </span>I was soon up and running with it.<span style="yes;">  </span>Unfortunately, wxFormBuilder did not have wxWizard as part of its available widgets. <span style="yes;"> </span>I didn’t know if a wizard widget existed so I started out designing with a notebook widget.<span style="yes;">  </span>It’s not the same, but it did give me pages that were connected together. <span style="yes;"> </span>I was just about finished with my design when I located this wonderful book entitled “</span><a href="http://www.wxwidgets.org/docs/book/"><span style="Arial;">Cross-Platform GUI Programming with wxWidgets</span></a><span style="Arial;">.”<span style="yes;">  </span>It really helps you to understand wxWidgets and gives lots of examples.<span style="yes;">  </span>Under documentation on the wxWidgets website you can find the latest online manual which is terrific, but sadly sparse on example code.<span style="yes;">  </span>This book helps bridge that gap.<span style="yes;">  </span>Guess what I found detailed in the book?<span style="yes;">  </span>That’s right, a wxWizard class!</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">So now I have moved to using straight wxWidgets in Anjuta.<span style="yes;">  </span>Saying that makes me feel like I’m hitting the hard stuff, and honestly it does feel like a little richer and more intense experience.<span style="yes;">  </span>I miss having the visual format to develop the pages but I was able to cut and paste most of the design from my wxFormBuilder notebook design into the wizard pages, which saved a lot of time. <span style="yes;"> </span>Extensive use of the documentation on the wxWidgets site was extremely helpful when I wanted to do something beyond the norm to individual controls.<span style="yes;">  </span>The wizard is just about finished now and ready to be connected. <span style="yes;"> </span>I’ll start by connecting it to the Linux command-line version, and after that is successful I will port it over to Win32. <span style="yes;"> </span>I know that it will work, however.<span style="yes;">  </span>I already have wxWidgets set up in my development studio on Win32. <span style="yes;"> </span>That’s a very reassuring bit of knowledge.<span style="yes;">  </span>My original tool, wxFormbuilder, is portable to Win32 as well and although I got the correct download I have not been successful in integrating it into my development studio there. <span style="yes;"> </span>Now I don’t have to do so.</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">I’ll let you know in my next blog how the integration process is going for the wizard and also tell you about anything new and different I learn about the Linux environment, C++, wxWidgets, Glade, Anjuta or any other programming subject.<span style="yes;">  </span>Take care until then!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2008/10/29/cross-platform-wizarding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Bug Extermination</title>
		<link>http://software.intel.com/en-us/blogs/2008/10/01/linux-bug-extermination/</link>
		<comments>http://software.intel.com/en-us/blogs/2008/10/01/linux-bug-extermination/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 17:57:04 +0000</pubDate>
		<dc:creator>Judy Hartley (Intel)</dc:creator>
				<category><![CDATA[Mobility]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[DBus]]></category>
		<category><![CDATA[GTK+]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MID]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2008/10/01/linux-bug-extermination/</guid>
		<description><![CDATA[Well, it has been a while since I wrote a blog entry, but boy have I learned some stuff! If you have followed my previous blogs you know that I have been working on developing a program to be run on MIDs. I started out putting together my development system and creating my program in [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it has been a while since I wrote a blog entry, but boy have I learned some stuff! If you have followed my previous blogs you know that I have been working on developing a program to be run on MIDs. I started out putting together my development system and creating my program in Linux. Then I started working on learning about moblin.org and going through the tutorials there on creating a target and additional things that are needed to run a program on MIDs. Just after I wrote my last blog I ran into a problem that has been the bane of my existence for a while. The problem was a segmentation fault that has been erratic and difficult to pin down. Remember my problem and solution from my first blog? I fixed the error and the program worked, but I kept getting the warning: says "Glib-WARNING **: g_main_context_prepare(): main loop already active in another thread." Well, I'm happy to tell you that I have cleared up the warning and it is kind of related to the segmentation fault I was getting. But, let's start at the beginning.</p>
<p>I wasn't able to find very much to help me on the warning so for a while I just lived with it. I kept trying different things to help relieve it. I tried putting in a pthread mutex and locking and unlocking between the call I made in the signal handler. That didn't fix it. Then I found out about gdk_threads_enter() and gdk_threads_leave() and tried those in the signal handler in the main thread. I couldn't get the g_thread_init(NULL) call to work inside the main thread. Then, finally I tried putting the init functions in a thread other than the main GUI thread and I was able to do that. After reading some more at the <a href="http://library.gnome.org/devel/gdk/stable/gdk-Threads.html">GDK Reference Manual</a> I realized that the function I added was a GTK+ function which cannot be called from another thread without the gdk_threads_enter() and gdk_threads_leave() functions being used. What I ended up doing is putting the "enter" and "leave" functions in the second thread around the function call that updated data in the main thread. It worked! By doing this, I found I didn't even need the GTK+ function forcing a refresh in the signal handler. The data was updated right away. Whew!</p>
<p>But, while that was nice to have cleared up, I had uncovered another problem. A segmentation fault was driving me nuts. One of the main features of my application was the use of the DBus system to receive information about the MID system. DBus is a system designed and used for interprocess communication in most Linux systems. There are defined calls to be made and quite a few tutorials on the web. The major tutorial seems to be <a href="http://dbus.freedesktop.org/doc/dbus-tutorial.html">D-Bus Tutorial</a>. All of my DBus calls were made on one particular thread, which makes sense. Except that sometimes when I was running the program it would have a segmentation fault and the program would crash. At first, it was happening about 1 out of every 3 or 4 times. I had a friend who is a long-time coder take a look at the code. He pointed out some areas I needed to tighten up and I gladly took his recommendations and made the changes. The segmentation fault was still there. I had some of the other software engineers take a look at the code. They also had some recommendations, most of which I agreed with and implemented. The segmentation fault still came and went at will (it seemed to almost take on a life of its own). We had a group look and talk session to see if together we could find it. Apparently, we couldn't. The group did recommend that I load up a tool called <a href="http://www.klocwork.com/">Klocwork</a> which is a bug analysis tool. Klocwork found 5 minor problems which I fixed, but the fixes did not result in the segmentation fault disappearing. Finally, I took the code home with me and remove the DBus code from the threaded environment. I made a simple GUI and ran the DBus code in single thread mode. No segmentation fault over 80 iterations. Then I created a second thread and put the DBus code in the second thread. Guess what? The segmentation fault was back. Have you already figured out what the solution was? Yes, the gdk_threads_enter() and gdk_threads_leave() functions! By surrounding the DBus calls with those two functions, my program runs without any crashes at all. Looking back, most of the "code monkeys" I asked to look at my code had never written code in the Linux environment, so it is not too surprising that they weren't familiar with GTK+ critical section needs.</p>
<p>My program is now going through code inspection, and I don't expect it to be a difficult experience at all, since so many people have already given me their suggestions and tips. My last big hurdle is to actually get my program running on an actual MID. We have received some MIDs to use as test vehicles so I have the hardware I need. Will there be another adventure while actually getting the program into the MID? Stay tuned, friends and neighbors, and I'll let you know soonest.</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2008/10/01/linux-bug-extermination/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adventures at Moblin.org</title>
		<link>http://software.intel.com/en-us/blogs/2008/08/14/adventures-at-moblinorg/</link>
		<comments>http://software.intel.com/en-us/blogs/2008/08/14/adventures-at-moblinorg/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 17:02:34 +0000</pubDate>
		<dc:creator>Judy Hartley (Intel)</dc:creator>
				<category><![CDATA[Mobility]]></category>
		<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MID]]></category>
		<category><![CDATA[moblin]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2008/08/14/adventures-at-moblinorg/</guid>
		<description><![CDATA[Thanks for all the kind comments from my last blog.  I’ve been continuing on my quest to move my application into the MID environment.  To do this, I have made moblin.org my new best friend.  By opening the “resource center” page I discovered some guides for getting a development system set up and for porting [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">Thanks for all the kind comments from my last blog.<span style="yes;">  </span>I’ve been continuing on my quest to move my application into the MID environment.<span style="yes;">  </span>To do this, I have made </span><a href="http://www.moblin.org/"><span style="Arial;">moblin.org</span></a><span style="Arial;"> my new best friend.<span style="yes;">  </span>By opening the “resource center” page I discovered some guides for getting a development system set up and for porting applications over to the MID.<span style="yes;">  </span>I started with </span><a href="http://www.moblin.org/toolkits/prepDev/toolkits_prepDev_useImgCrtr.php"><span style="Arial;">Preparing for Development</span></a><span style="Arial;">.<span style="yes;">  </span>Installing the Moblin Image Creator was fairly simple.<span style="yes;">  </span>I did find that I needed one other package than those listed on that page (the missing package is “curl”).<span style="yes;">  </span>It could be that this package is only needed in some environments and for that reason isn’t listed. The </span><a href="http://www.moblin.org/toolkits/prepDev/toolkits_prepDev_useImgCrtr.php"><span style="Arial;">Projects and Targets</span></a><span style="Arial;"> page showed me how to create a target environment and how to use Xephyr to test my target environment and applications. I had no trouble with creating the target or adding feature sets (fsets), but I hit a brick wall when I got to starting Xephyr.<span style="yes;">  </span>Every time I entered the “ume-xephyr-start” command, I would get the following and return to the prompt:</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<blockquote>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;">Setting screen resolution to 1024x600</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;">DISPLAY already set to  :0.0</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;">Starting dbus</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;"> * Starting system message bus dbus                                      [ OK ] </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;"> * Starting network connection manager NetworkManager                    [ OK ] </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;"> * Starting network events dispatcher NetworkManagerDispatcher           [ OK ] </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;"> * Starting System Tools Backends system-tools-backends                  [ OK ] </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;">Starting UI in Xephyr</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;">Extended Input Devices not yet supported. Impelement it at line 625 in ../../../../hw/kdrive/src/kinput.c</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;">Could not init font path element /usr/share/fonts/X11/cyrillic, removing from list!</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;">Could not init font path element /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType, removing from list!</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="&quot;Times New Roman&quot;;">waiting for X server to shut down FreeFontPath: FPE "/usr/share/fonts/X11/misc" refcount is 2, should be 1; fixing.</span></p>
</blockquote>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">In order to solve this, I ended up joining the </span><a href="http://www.moblin.org/community/community_mail-list.php"><span style="Arial;">Moblin mailing list</span></a><span style="Arial;"> and posting the problem there.<span style="yes;">  </span>The response took a while, but it turned out that this was a known issue and the fix is relatively simple.<span style="yes;">  </span>All you have to do is type “killall gconfd-2” at the target prompt (without the quotes).<span style="yes;">  </span>This will allow the screen to be displayed.<span style="yes;">  </span>Cool!</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="small;"><span style="Arial;">Working through the development guides has been illuminating.<span style="yes;">  </span>I found several typos and a few places where the documents needed to be updated.<span style="yes;">  </span>Thanks to the mailing list, I was put in contact with the website owners and those items are being updated as I write this.<span style="yes;">  </span>Hopefully, those who come behind me will have an easier time of going through the guides.<span style="yes;">  </span></span></span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">I haven’t gotten an image successfully from the Image Creator to the MID I have in the lab.<span style="yes;">  </span>I tried a live image that had some of my stuff on it, and when that didn’t work, I tried a standard image I found on the website.<span style="yes;">  </span>The standard seemed to load, but then it just shut the MID off, so I’m not sure what’s going on there.<span style="yes;">  </span>Work continues.<span style="yes;">  </span>Until next blog, please let me know if you have any suggestions.<span style="yes;">  </span>Cheers!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2008/08/14/adventures-at-moblinorg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows to Linux and soon to MID</title>
		<link>http://software.intel.com/en-us/blogs/2008/08/05/windows-to-linux-and-soon-to-mid/</link>
		<comments>http://software.intel.com/en-us/blogs/2008/08/05/windows-to-linux-and-soon-to-mid/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 16:05:22 +0000</pubDate>
		<dc:creator>Judy Hartley (Intel)</dc:creator>
				<category><![CDATA[Mobility]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[Anjuta]]></category>
		<category><![CDATA[Glade]]></category>
		<category><![CDATA[gtkmm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MID]]></category>
		<category><![CDATA[threading]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2008/08/05/windows-to-linux-and-soon-to-mid/</guid>
		<description><![CDATA[Newbie blogger here.  I’ve been working on a GUI application for MID devices that will call some APIs that are being developed simultaneously.  Because it is MID directed, I’m using a Linux OS (Ubuntu 8.04) for the first time in years.   My development system is Anjuta IDE and Glade Interface Designer.  I started using Gdk+ [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">Newbie blogger here.<span style="yes;">  </span>I’ve been working on a GUI application for MID devices that will call some APIs that are being developed simultaneously.<span style="yes;">  </span>Because it is MID directed, I’m using a Linux OS (Ubuntu 8.04) for the first time in years.<span style="yes;">   </span>My development system is Anjuta IDE and Glade Interface Designer.<span style="yes;">  </span>I started using Gdk+ and C language and then “graduated” to C++ using Gdkmm.<span style="yes;">  </span>This seems to be somewhat rarified air as there are few internet pages or posts detailing problems and solutions.<span style="yes;">  </span>It feels like I’ve sort of kludged something together, but it works for me.<span style="yes;">  </span>I’ve finally reached a point where the interface part of my program is working beautifully. <span style="yes;"> </span>I thought I would take the time to write this blog and mention some of the internet sites that have helped me the most, and describe a problem I had and the solution I came up with.<span style="yes;">  </span>Maybe some of you have had similar experiences and might know a better way.<span style="yes;">  </span>Alternatively, this post may help someone else getting comfortable with Linux development.</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">The most interesting thing about this whole process has been the search for relevant information that combines one or more of the elements of my development environment.<span style="yes;">  </span>You can find lots of information about GTK + in the </span><a href="http://library.gnome.org/devel/gtk-tutorial/stable/"><span style="Arial;">GNOME Documentation Library</span></a><span style="Arial;">, but not so much about using the </span><a href="http://glade.gnome.org/documentation.html"><span style="Arial;">Glade Interface Designer</span></a><span style="Arial;"> with it.<span style="yes;">  </span>Of course, the Glade site has some documentation that helps with the program itself, but little on using it with Gtk. The </span><a href="http://www.gtkmm.org/documentation.shtml"><span style="Arial;">Gdkmm documentation</span></a><span style="Arial;"> is excellent and has helped me the most.<span style="yes;">  </span>It even includes a section on </span><a href="http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/chapter-libglademm.html"><span style="Arial;">Glade and libglademm</span></a><span style="Arial;"> which gives a lot of information.<span style="yes;">  </span>Down at the bottom of the page is a link to a great collection of example code.</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"><span style="small;">Then there is C++ in Linux.<span style="yes;">  </span>It is basically the same as in Windows, but some things are different.<span style="yes;">  </span>I miss my CStrings.<span style="yes;">  </span>Yeah, I know it’s a crutch, but there you go. <span style="yes;"> </span>When I tried to use itoa, I couldn’t make it work.<span style="yes;">  </span>I’ve learned since then that the way to call itoa on Glib is g_ascii_strtoull (Thank you, Daniel Harbin).</span><span style="9pt;"> </span><span style="small;"><span style="yes;">  </span>But I have found some interesting ways to use strings in Linux.<span style="yes;">  </span>This site, </span></span><a href="http://www.yolinux.com/TUTORIALS/LinuxTutorialC++StringClass.html"><span style="Arial;">C++ String class Examples and Tutorial</span></a><span style="Arial;"> is great!<span style="yes;">  </span>It contains all the things I’d forgotten that could be done with regular strings.</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">My application is a four thread program.<span style="yes;">  </span>It has a main GUI thread that then spawns off three additional threads.<span style="yes;">  </span>One of these threads has a link back to the GUI class.<span style="yes;">  </span>When it is ready, it sends data to the GUI and changes the text in some widgets.<span style="yes;">  </span>The problem that I mentioned earlier was that although I was getting the information posted correctly, the GUI itself was not refreshing until the mouse was moved.<span style="yes;">  </span>Since my program sends new information every second, several changes could have occurred before a mouse move triggered the update.<span style="yes;">  </span>This just wasn’t going to work.<span style="yes;">  </span>I tried the show(), flush(), locking the gdk_thread, even GdkWindow::invalidate_rect.<span style="yes;">  </span>Nothing seemed to work. </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">Then someone else pointed out that I was trying to update the GUI from another thread.<span style="yes;">  </span>Part of the solution was to set the signal in Glade to go to a signal handler when the widget was changed.<span style="yes;">  </span>Then in the signal handler, I put in the following code:</span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="small;"><span style="Arial;"><span style="1;">          </span>p_eEntry-&gt;show();</span></span></p>
<p class="MsoNormal" style="0.5in;"><span style="Arial;">while(Gtk::Main::instance()-&gt;events_pending())</span></p>
<p class="MsoNormal" style="0.5in;"><span style="small;"><span style="Arial;"><span style="1;">          </span>Gtk::Main::instance()-&gt;interation();</span></span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;"> </span></p>
<p class="MsoNormal" style="0in 0in 0pt;"><span style="Arial;">What this code does is to tell the GUI to stop and handle all updates right away.<span style="yes;">  </span>The solution works.<span style="yes;">  </span>I do get a warning in the terminal that says “Glib-WARNING **: g_main_context_prepare(): main loop already active in another thread.” <span style="yes;"> </span>I’m still researching why this happens and how to fix the warning.<span style="yes;">  </span>Some online comments suggest that it is a bug while others say to use the “child watch” functionality of GLib. If you know of something that will help, I hope you will post a reply.<span style="yes;">  </span>Regardless, I will post more comments as I go along with the hope that others will benefit and /or contribute.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2008/08/05/windows-to-linux-and-soon-to-mid/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

