Happy Thanksgiving!, great to have a relaxing Thursday morning on the couch, doing nothing but watching last night's NHL highlights while tinkering with some new programming technologies, drinking a cup of strong coffee.
This past summer I spent some time trying to develop some sample game code (blog post: fixed-frequency-uncoupled-game-loop) in C, using libSDL on the Linux platform. I made some progress, but it was difficult, fairly low level, and I kind of lost motivation when work picked up for me this fall.
Recently I downloaded and installed the MS Visual Studio 2010 Express with XNA Game Studio 4.0 to give Windows/XBOX/Windows Phone game programming a shot to hopefully make faster progress. I have done C# before with my adventures in the WorldWind .NET project. Here is my result of my efforts this morning, a moving rectangle sprite:
It was fairly revealing that the easy to follow first tutorial for XNA Windows game development was creating a sprite that moves around a game window, just like my bouncy rectangle game. It took me about half an hour to build the tutorial, what took several days in C with libSDL. The basic project takes care of the game loop for it and it seems to be an uncoupled model between the game logic and drawing of graphics. The game played at a constant speed plus my CPU was only around 7% utilized.
I guess the tradeoff is being locked into Microsoft products, with little hope of ever porting to other platforms. But given I am my own developer, it makes sense to use this platform to actually get some programs made. I like how all the tools are basically free and well integrated together.
Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts
Thursday, November 24, 2011
XNA .NET Bouncy Rectangle Tutorial
Labels:
.NET,
C#,
gaming,
Visual Studio .NET,
Windows
Sunday, August 22, 2010
WorldWind - WMS Authentication Support
A new user on the World Wind forums has submitted some changes for review and inclusion into the World Wind source. It is nice to see some contributions from the community still. I picked up his changes and belatedly did a code review and tried to test them. Note this authentication just adds a username and password via the .NET Framework's "System.Net.NetworkCredential" object added to the existing request sent to the WMS server.
Unfortunately I don't have a WMS server with authentication to test his fix against. I did some basic regression testing and existing WMS functionality seems to work fine. From reviewing the code nothing appeared to be harmful and it made sense, though he added no commenting for any of the changes. I asked the user to provide more code comments as well as to finish an enhancement he was apparently making to the WMS browser for username and password fields in the browser GUI.
Forum discussion
You can get the source and see it in action from my SVN branch:
https://nasa-exp.svn.sourceforge.net/svnroot/nasa-exp/branches/ammianus
I will hold off on commiting his changes to the World Wind trunk until he responds to my questions and maybe finishes his work on the WMS Browser.
I have to say, this is probably my last contribution to the WW.NET project for now. I think it has run its course and led to a dead end, technically and in terms of a learning experience. I have begun new projects to learn more about coding in GNU/Linux and as a result want to focus my efforts towards Real-Time and Embedded system development. I have to thank the World Wind project both as a learning exercise and for the fact it did get me a job interview for a GIS programming position, and it was the first true Open Source project I made contributions to. Here's to many more.
Unfortunately I don't have a WMS server with authentication to test his fix against. I did some basic regression testing and existing WMS functionality seems to work fine. From reviewing the code nothing appeared to be harmful and it made sense, though he added no commenting for any of the changes. I asked the user to provide more code comments as well as to finish an enhancement he was apparently making to the WMS browser for username and password fields in the browser GUI.
Forum discussion
You can get the source and see it in action from my SVN branch:
https://nasa-exp.svn.sourceforge.net/svnroot/nasa-exp/branches/ammianus
I will hold off on commiting his changes to the World Wind trunk until he responds to my questions and maybe finishes his work on the WMS Browser.
I have to say, this is probably my last contribution to the WW.NET project for now. I think it has run its course and led to a dead end, technically and in terms of a learning experience. I have begun new projects to learn more about coding in GNU/Linux and as a result want to focus my efforts towards Real-Time and Embedded system development. I have to thank the World Wind project both as a learning exercise and for the fact it did get me a job interview for a GIS programming position, and it was the first true Open Source project I made contributions to. Here's to many more.
Labels:
C#,
open source,
WorldWind
Saturday, December 19, 2009
How does Visual Studio include Referenced Libraries?
A problem was raised on the forums a number of times about World Wind building in Release mode.
If you checked out the source from SVN, and opened the project in Visual Studio, then tried to build in release mode you would receive errors such as:
Answer given by forum member, James_in_Utah:
I added these two .dlls to the Release folder in World Wind SVN and commited the changes.
This brought the question to my mind, this seems to be a bad practice to check in to source control the contents of the output directory. I see that the .dlls are referenced under project references. Shouldn't there be a way that on build it copies the required .dlls to the Release folder or Debug folder as necessary?.
Unfortunately no one on the forum seemed to have a response and a quick web search revealed no answers.
If you checked out the source from SVN, and opened the project in Visual Studio, then tried to build in release mode you would receive errors such as:
C:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "Tao.OpenGl.Glu". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
C:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "ICSharpCode.SharpZipLib". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
C:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "Tao.OpenGl.ExtensionLoader". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
C:\Apache2\htdocs\html\WWsrc\PluginSDK\T iledWFSPlacenameSet.cs(10,7): error CS0246: The type or namespace name 'ICSharpCode' could not be found (are you missing a using directive or an assembly reference?)
Answer given by forum member, James_in_Utah:
I think the problem is that those DLLs may not be checked in for the "Release" mode build. Try building in Debug mode. That should work. Then find the dlls mentioned, Tao.OpenGl.Glu.dll, ICSharpCode.SharpZipLib.dll in the Debug target directory and just copy them to the Release mode target directory. We really probably should check these into the release mode build target directory in SVN, but I don't have privs to do that.
I added these two .dlls to the Release folder in World Wind SVN and commited the changes.
This brought the question to my mind, this seems to be a bad practice to check in to source control the contents of the output directory. I see that the .dlls are referenced under project references. Shouldn't there be a way that on build it copies the required .dlls to the Release folder or Debug folder as necessary?.
Unfortunately no one on the forum seemed to have a response and a quick web search revealed no answers.
Labels:
.dll,
C#,
references,
Visual Studio .NET
Friday, September 18, 2009
Stars3d fix
I commited my changes to the Stars3d plugin. This was Issue #4. After a few days this was registered by ohloh as my 3rd commit. Also after some time my kudos rank registered this work and bumped me up to level 4. Hooray (sarcasm).
Right now the dev forums for World Wind are like a ghost town, I've replied several times and not heard anything back, no one else is currently working on fixes, and the one guy who was, has not checked in his changes to the trunk.
Since I am so busy with work, I can't do more, would like to keep this momentum going forward and maybe pick up some interest.
I went to Amsterdam two weeks ago for work. Next week I will be in London for two weeks for the same. Doesn't look like I will work on this anytime soon.
Right now the dev forums for World Wind are like a ghost town, I've replied several times and not heard anything back, no one else is currently working on fixes, and the one guy who was, has not checked in his changes to the trunk.
Since I am so busy with work, I can't do more, would like to keep this momentum going forward and maybe pick up some interest.
I went to Amsterdam two weeks ago for work. Next week I will be in London for two weeks for the same. Doesn't look like I will work on this anytime soon.
Sunday, August 23, 2009
Still working on issues
I am still working on the issues for World Wind 1.4.1. There hasn't been a lot of traction but at least one other dev was using my custom wiki bug tracker.
I did check in my Download code and Atmosphere plug-in fixes into the main trunk of World Wind code.
Now, I will start watching the WW project on ohloh for updates. Since I checked in to sourceforge svn using my ammianus id, my ohloh profile should reflect these commits to the WW project. Since it is my first check-in to trunk I don't know if it will work. They seem to refresh their statistics from SVN every 2 days or so.
I did check in my Download code and Atmosphere plug-in fixes into the main trunk of World Wind code.
Now, I will start watching the WW project on ohloh for updates. Since I checked in to sourceforge svn using my ammianus id, my ohloh profile should reflect these commits to the WW project. Since it is my first check-in to trunk I don't know if it will work. They seem to refresh their statistics from SVN every 2 days or so.
Labels:
.NET,
C#,
Download Code,
ohloh,
Plugins
Sunday, August 2, 2009
Download Code checked in
This is also a few weeks late, I finished testing on the last weeks of my vacation in mid-July while still in Korea. The folks at WorldWindCentral were kind enough to provide me commit access to SVN, so I have started my own branch to check in the changes. So far this has not been commited to /trunk yet.
Here is the the URL for my shiny new SVN branch:
https://nasa-exp.svn.sourceforge.net/svnroot/nasa-exp/branches/ammianus
As far as the Download code I also I posted a detail list of the fixes I have done here:
http://worldwindcentral.com/wiki/1_4_1_Issues#Download_code_error_response_handling
Logical changes include new error response handling:
* 4xx / Client error are cached as failures and WW will not retry to download them during that session (cache is in memory only and cleared when WW is exited).
* 5xx / Server Error are recorded and a timeout period will begin before requests are allowed to this server again. A message is displayed in the top right of the UI stating the timeout length. If server response contains "retry-after" header, that period is used, otherwise default is 2 minutes.
Changes made to source files:
* WebDownload/WebDownload.cs
* PluginSDK/QuadTileSet.cs
* PluginSDK/Renderable/GeoSpatialDownloadRequest.cs
Here is the the URL for my shiny new SVN branch:
https://nasa-exp.svn.sourceforge.net/svnroot/nasa-exp/branches/ammianus
As far as the Download code I also I posted a detail list of the fixes I have done here:
http://worldwindcentral.com/wiki/1_4_1_Issues#Download_code_error_response_handling
Logical changes include new error response handling:
* 4xx / Client error are cached as failures and WW will not retry to download them during that session (cache is in memory only and cleared when WW is exited).
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 206 Partial Content
- 200 OK && Content length == 0
* 5xx / Server Error are recorded and a timeout period will begin before requests are allowed to this server again. A message is displayed in the top right of the UI stating the timeout length. If server response contains "retry-after" header, that period is used, otherwise default is 2 minutes.
- 500 Internal Server Error
- 501 Not Implemented
- 502 Bad Gateway
- 503 Service Unavailable
Changes made to source files:
* WebDownload/WebDownload.cs
* PluginSDK/QuadTileSet.cs
* PluginSDK/Renderable/GeoSpatialDownloadRequest.cs
Labels:
.NET,
C#,
Download Code,
svn branch,
WorldWind
Saturday, April 11, 2009
Contribution Update
I went back and did some further rework for the changes to the "Download code" I submitted to the forum earlier. I posted these on the forum as well (still do not have commit access to SVN). There were no clear directions so I took some suggestions from forum users and combined that with already existing functionality (that was in the code but not used due to a bug I think I fixed).
I spent this day making these updates. Basically there were 3 files updated.
Changes include:
I spent this day making these updates. Basically there were 3 files updated.
Changes include:
- Now individual tiles will be put in a HashTable if they get 3 404 errors. They will be prevented from being readded to the download queue. Pressing 'F5' will clear this HashTable as will restarting the program.
- After 5 failed tiles download attempts (tiles reaching the status above) the current anti-hammer logic kicks in to prevent further requests to that server for that layer. The default timeout period is 2 minutes before it will try to download for this layer again. Pressing 'Pressing F5' will clear this counter, and will stop the timeout and restart the download queue for this layer.
- When the above condition is reached it will display a message in the top right saying "Problem connecting to server... Trying again in 2 minutes" when that layer is rendered after a timeout is reached. This stays visible for the first 20 seconds of the timeout then will be fade out...this logic was actually in there currently, but I was able to confirm that you can see it now (plus I extended the time it is visible from 15 to 20 seconds).
Labels:
C#,
Download Code,
WorldWind
Tuesday, April 7, 2009
World Wind 1.4.1 Issues
I reported two more issues based on my work over the weekend. I did not get a whole lot of responses yet.
Issue 1:
I notice that when you uncheck "Starfield" in the Layer Manager, it doesn't actually remove the stars that are in the background.
Response: confirmed issue
Issue 2:
I have noticed this on my new development environment which is Vista (64-bit).
Sometimes, but not every time (can't seem to pinpoint an obvious cause or pattern), after I have run World Wind from VCE2005 and exit it from the File menu, then try to Run it in Debug again it will not start up. There is no Worldwind.exe process running and the problem remains if I just restart Visual Studio.
This was a juicy one, I had seen this before but thought it was some change to the code I had made caused this problem.
Thankfully I found that in WorldWind.cs it is actually checking for a Window handle named 'NASA World Wind', finding one and then returning after sending arguments for it.
I have had to comment out this return. Otherwise I need to log off of Windows and log back on to fix the problem.
The bug is that probably the Window is not being shut down completely.
Both bugs are being discussed in this stickied thread on the World Wind forums.
Issue 1:
I notice that when you uncheck "Starfield" in the Layer Manager, it doesn't actually remove the stars that are in the background.
Response: confirmed issue
Issue 2:
I have noticed this on my new development environment which is Vista (64-bit).
Sometimes, but not every time (can't seem to pinpoint an obvious cause or pattern), after I have run World Wind from VCE2005 and exit it from the File menu, then try to Run it in Debug again it will not start up. There is no Worldwind.exe process running and the problem remains if I just restart Visual Studio.
This was a juicy one, I had seen this before but thought it was some change to the code I had made caused this problem.
Thankfully I found that in WorldWind.cs it is actually checking for a Window handle named 'NASA World Wind', finding one and then returning after sending arguments for it.
I have had to comment out this return. Otherwise I need to log off of Windows and log back on to fix the problem.
The bug is that probably the Window is not being shut down completely.
// If World Wind is already running, pass any commandline
// arguments from this instance, and quit.
IntPtr handle = GetWWHandle();
if (!System.IntPtr.Zero.Equals(handle))
{
if(args.Length>0)
NativeMethods.SendArgs( handle, string.Join("\n",args) );
//[Ammianus] by commenting out this return I can get it to start every time.
//return;
}
Both bugs are being discussed in this stickied thread on the World Wind forums.
First contribution?
Technically I did not check-in any changes to SVN, but I did suggest a fix for World Wind on the forums.
I have been spending a good while looking into the "download code" issue. I have taken a step back and this past weekend I dove into the code using my new development machine.
By tweaking a couple of lines of code I managed to unlock behavior already built in to the download classes that would prevent multiple failed downloads from repeating for a particular layer (after 5 failures, stop downloads for a timeout period of 2 minutes). This was slightly different from the expressed requirement to flag specific tiles for not being found and not retrying those.
So on April 5, 2009, I went back to the World Wind forums and posted my update including the changes to the two class files to make the existing functionality work correctly. I even got some replies by a few active members that they would try it out. I asked for clarification as well if I should go back and make the anti-hammer logic work for tiles specifically rather than whole layers which is what I initially wanted to do.
It was such a successful feeling on Sunday to get this working the way I wanted. My wife and I spent all day working on our various projects, me on World Wind, her on her doctoral dissertation. It took about 5-6 hours of steady work, debugging and reading log files to really wrap my head around how these classes were truly interacting. Making a simple change (which I understood) and having it work was very rewarding, it gives me confidence to continue with some more changes.
Things to check:
* One recommendation was to display a message in the UI that the connection to the server is on hold for the 2 minute timeout period. I did in fact see something like that at one point in my testing but it quickly went away, may have been unrelated to my code changes
* Pressing 'F5' will clear the cache for a specific area and force a retry of the download of the visible tiles. Suggestion was that this should reset any timeout or counters of failures if the user doesn't want to wait (I suppose would be the case if they scrolled back over some location that they were more confident had tiles to download from the server)
* Need validation on whether current anti-hammer logic is ok, or we need per-tile anti-hammer logic
I have been spending a good while looking into the "download code" issue. I have taken a step back and this past weekend I dove into the code using my new development machine.
By tweaking a couple of lines of code I managed to unlock behavior already built in to the download classes that would prevent multiple failed downloads from repeating for a particular layer (after 5 failures, stop downloads for a timeout period of 2 minutes). This was slightly different from the expressed requirement to flag specific tiles for not being found and not retrying those.
So on April 5, 2009, I went back to the World Wind forums and posted my update including the changes to the two class files to make the existing functionality work correctly. I even got some replies by a few active members that they would try it out. I asked for clarification as well if I should go back and make the anti-hammer logic work for tiles specifically rather than whole layers which is what I initially wanted to do.
It was such a successful feeling on Sunday to get this working the way I wanted. My wife and I spent all day working on our various projects, me on World Wind, her on her doctoral dissertation. It took about 5-6 hours of steady work, debugging and reading log files to really wrap my head around how these classes were truly interacting. Making a simple change (which I understood) and having it work was very rewarding, it gives me confidence to continue with some more changes.
Things to check:
* One recommendation was to display a message in the UI that the connection to the server is on hold for the 2 minute timeout period. I did in fact see something like that at one point in my testing but it quickly went away, may have been unrelated to my code changes
* Pressing 'F5' will clear the cache for a specific area and force a retry of the download of the visible tiles. Suggestion was that this should reset any timeout or counters of failures if the user doesn't want to wait (I suppose would be the case if they scrolled back over some location that they were more confident had tiles to download from the server)
* Need validation on whether current anti-hammer logic is ok, or we need per-tile anti-hammer logic
Labels:
C#,
Download Code,
WorldWind
Tuesday, March 3, 2009
Asynchronous downloads
One of the things I've learned about the download code is that it uses Asynchronous calls to handle the downloading of the image files from the server in the background.
I found a good article on doing these calls in .NET which explains a lot of the World Wind .NET download code and what it is doing.
http://www.codeproject.com/KB/dotnet/async_pattern.aspx
I need to understand this in order to really implement the more robust queuing method.
I found a good article on doing these calls in .NET which explains a lot of the World Wind .NET download code and what it is doing.
http://www.codeproject.com/KB/dotnet/async_pattern.aspx
I need to understand this in order to really implement the more robust queuing method.
Labels:
Asynchronous,
C#
Sunday, March 1, 2009
Download code
So I have struggled with the infamous "download code" for the past week or more. It was really difficult to untangle what connects to what and where. I found myself resorting to drawing my own class diagrams to keep the pieces straight from what I could tell.
What was interesting is that there looks like two separate and independent "download code" implementations that do almost the same thing for different areas of the application.
The first component, if you will, was in the project called WebDownload, this was the first one I was able to step my way through. Unfortunately, it was not the component that could solve the problem I was tasked with fixing.

The next set of classes was in another project, PluginSDK. Here was where I eventually made some quick changes to actually stop the repeating downloads from happening.

The QuadTileSet is the center of action here, it has the queue of download requests that it services. I changed this class to have a Hashtable where it would store the download requests for tiles where the server responded with a 404 response. Then it wouldn't re-add these items to the download queue if they were in this Hashtable already.
All in all I had to make some slight changes to three classes here:
You may notice the snazzy UML class diagrams I used above. I am not really big on UML, though I used to do class diagrams a lot for a previous company. I went looking for some free, preferably Open Source UML Editors, just to let me crank out the class diagrams above (which I had already hand-drawn on paper).
I tried out two, both were basically Eclipse plugins. One did not work and the other I felt was too complex and buggy for the simple diagrams I want to do.
Papyrus UML - this actually worked but was difficult to use
acceleo - I installed this in my Eclipse environment as a plugin as per directions. I didn't allow me to create any diagrams after about 10 minutes of trying so I uninstalled it.
What was interesting is that there looks like two separate and independent "download code" implementations that do almost the same thing for different areas of the application.
The first component, if you will, was in the project called WebDownload, this was the first one I was able to step my way through. Unfortunately, it was not the component that could solve the problem I was tasked with fixing.

The next set of classes was in another project, PluginSDK. Here was where I eventually made some quick changes to actually stop the repeating downloads from happening.

The QuadTileSet is the center of action here, it has the queue of download requests that it services. I changed this class to have a Hashtable where it would store the download requests for tiles where the server responded with a 404 response. Then it wouldn't re-add these items to the download queue if they were in this Hashtable already.
All in all I had to make some slight changes to three classes here:
- QuadTileSet
- GeoSpatialDownloadRequest
- WebDownload
You may notice the snazzy UML class diagrams I used above. I am not really big on UML, though I used to do class diagrams a lot for a previous company. I went looking for some free, preferably Open Source UML Editors, just to let me crank out the class diagrams above (which I had already hand-drawn on paper).
I tried out two, both were basically Eclipse plugins. One did not work and the other I felt was too complex and buggy for the simple diagrams I want to do.
Papyrus UML - this actually worked but was difficult to use
acceleo - I installed this in my Eclipse environment as a plugin as per directions. I didn't allow me to create any diagrams after about 10 minutes of trying so I uninstalled it.
Wednesday, January 21, 2009
WW: Progress Update:
After a slow start I got a few answers to my questions:
For WorldWind, the standard for development is Visual Studio 2005. Any changes I made to the project files (say adding a new class file) would need to be checked in by someone else using 2005 for backwards compatibility to all the other 2005 developers.
I was able to download Visual C# 2005 Express for free from Microsoft's site (link while it lasts: http://www.microsoft.com/express/2005/download/default.aspx ). I downloaded it as a CD image and created the installer on a CD I burned with the image.
I finally got around on Monday to uninstalling Visual C# 2008 Express and all its tangled mess of subcomponents. Once I did that I tried to install 2005 version. It complained at first because I already had a version of the .NET Framework 2.0 SDK installed from earlier. As a result I had to uninstall that in order to install 2005, apparently it includes the 2.0 .NET SDK already.
Using Visual Studio 2005 I opened up the World Wind solution and rebuilt it. I did not get any build errors but this has nothing to do with the version of Visual Studio.
It was confirmed that some other developer had checked in a bad version of the code including the wrong gdal_csharp.dll bindings. I had figured this out by looking at the SVN revision history for those dlls and comparing with the classes that actually referenced them. It took a while for people on the forum to respond, and other than one user nobody seemed to care that the build was broken.
Another disappointment was that I found from some posts that the World Wind SVN repository does not allow commits except for a select few users. I guess that makes sense, but I've never worked on an OpenSource project, so I assumed it was something like Wikipedia's model, where anyone can contribute, but moderators/admins could revert harmful changes to the code. I suppose Software is more tricky than encyclopedia articles.
Anyway, in the mean time to get back up to speed on C# and .NET I revisited some of my old .NET projects, including a Tetris game I wrote in 2003 using GDI+ graphics. I also downloaded a tutorial for creating a simple project that uses Managed DirectX to paint the background of a window different colors.
For WorldWind, the standard for development is Visual Studio 2005. Any changes I made to the project files (say adding a new class file) would need to be checked in by someone else using 2005 for backwards compatibility to all the other 2005 developers.
I was able to download Visual C# 2005 Express for free from Microsoft's site (link while it lasts: http://www.microsoft.com/express/2005/download/default.aspx ). I downloaded it as a CD image and created the installer on a CD I burned with the image.
I finally got around on Monday to uninstalling Visual C# 2008 Express and all its tangled mess of subcomponents. Once I did that I tried to install 2005 version. It complained at first because I already had a version of the .NET Framework 2.0 SDK installed from earlier. As a result I had to uninstall that in order to install 2005, apparently it includes the 2.0 .NET SDK already.
Using Visual Studio 2005 I opened up the World Wind solution and rebuilt it. I did not get any build errors but this has nothing to do with the version of Visual Studio.
It was confirmed that some other developer had checked in a bad version of the code including the wrong gdal_csharp.dll bindings. I had figured this out by looking at the SVN revision history for those dlls and comparing with the classes that actually referenced them. It took a while for people on the forum to respond, and other than one user nobody seemed to care that the build was broken.
Another disappointment was that I found from some posts that the World Wind SVN repository does not allow commits except for a select few users. I guess that makes sense, but I've never worked on an OpenSource project, so I assumed it was something like Wikipedia's model, where anyone can contribute, but moderators/admins could revert harmful changes to the code. I suppose Software is more tricky than encyclopedia articles.
Anyway, in the mean time to get back up to speed on C# and .NET I revisited some of my old .NET projects, including a Tetris game I wrote in 2003 using GDI+ graphics. I also downloaded a tutorial for creating a simple project that uses Managed DirectX to paint the background of a window different colors.
Monday, January 12, 2009
Wind in my sails
This year as part of one of my 2009 goals, I recently got interested in trying to contribute to World Wind development after downloading a version a couple of years ago. I am primarily a Java developer but I have done C# .NET development on the 1.1 Framework around 2003-2004. In any case I have a goal of being able to contribute here as well as pick up some more knowledge around .NET. Maybe for now I can turn some of my questions or any tips into more detailed documentation for new contributors in the future (more documentation can never hurt right?
)
Getting Started
I have the professional version of Visual Studio .NET 2003 (not sure if it can be used with .NET 2.0+ Frameworks).
1)So I started out with installing Visual C# 2008 Express(http://www.microsoft.com/express/product/)
2)Following the wiki
-I downloaded the .NET 2.0 Framework SDK just in case (I am not sure if this necessary: http://www.microsoft.com/downloads/d...displaylang=en)
-Next I got the Nov 2007 DirectX SDK (http://www.microsoft.com/downloads/d...displaylang=en)
3) With tortoiseSVN I checked out the latest code from SVN repo ( https://nasa-exp.svn.sourceforge.net...runk/WorldWind)
4) I opened the solutions file in C# 2008, and had it convert the projects after making a backup.
5) Under Build > Build Configuration I changed the Active Solution Configuration to 'Debug' from 'Debug MSRS' (I don't know if this is needed)
5) I tried to Run the app with Debug > Start Debug. It said there were build errors (more on that later), but I could run last successful build, which I did. So WorldWind started and I pointed its Cache file to my existing installed WorldWind 1.4 cache directory.
Success!
Questions:
My first question is, did I miss anything or do anything i shouldn't have?
Second, I see that the conversion done by VS 2008, changes all the .csproj files in the source. Assuming at some point, I wanted to make some contributions what is the policy on checking in projects? Would a 2008 .csproj be backwards-compatible with VS 2005 developers?
When I right-click on any project in the WorldWind solution in VS and view the Properties window, under Targeted Framework: is shows '.NET Framework 3.5'
- Is this part of the "conversion"?
- In all the documentation I have read, WW 1.4(.1) is on .NET 2.0. Are any changes I make for potential contributions possibly not backwards compatible as a result? Should I manually change each projects' Targeted Framework to 2.0? Is there a way to do this for the entire solution at once and not manually changing it in every single project? What is this setting specifically doing? More research will be needed on my part for this one I think.
Finally the build errors
If I build the project I get about 14 Errors, all in the DstileGUI project.
Errors look like: In the project references are references to gdal_csharp.dll and gdalconst_csharp.dll. There is a using GDAL; statement in these classes.
I tried a few things, which I can elaborate on, but it seems as if there may be some mismatch between the gdal version and the DstileGUI code? This page seems to point out that there new Namespace conventions being used with GDAL for C# in version 1.4.0 and 1.5.0 of GDal.
I wonder if they included the right version of the .dll with the source code?
Still waiting for responses from the World Wind Central forums. The Developers Corner there seem pretty quiet but there are a few other recent threads.
Getting Started
I have the professional version of Visual Studio .NET 2003 (not sure if it can be used with .NET 2.0+ Frameworks).
1)So I started out with installing Visual C# 2008 Express(http://www.microsoft.com/express/product/)
2)Following the wiki
-I downloaded the .NET 2.0 Framework SDK just in case (I am not sure if this necessary: http://www.microsoft.com/downloads/d...displaylang=en)
-Next I got the Nov 2007 DirectX SDK (http://www.microsoft.com/downloads/d...displaylang=en)
3) With tortoiseSVN I checked out the latest code from SVN repo ( https://nasa-exp.svn.sourceforge.net...runk/WorldWind)
4) I opened the solutions file in C# 2008, and had it convert the projects after making a backup.
5) Under Build > Build Configuration I changed the Active Solution Configuration to 'Debug' from 'Debug MSRS' (I don't know if this is needed)
5) I tried to Run the app with Debug > Start Debug. It said there were build errors (more on that later), but I could run last successful build, which I did. So WorldWind started and I pointed its Cache file to my existing installed WorldWind 1.4 cache directory.
Success!
Questions:
My first question is, did I miss anything or do anything i shouldn't have?
Second, I see that the conversion done by VS 2008, changes all the .csproj files in the source. Assuming at some point, I wanted to make some contributions what is the policy on checking in projects? Would a 2008 .csproj be backwards-compatible with VS 2005 developers?
When I right-click on any project in the WorldWind solution in VS and view the Properties window, under Targeted Framework: is shows '.NET Framework 3.5'
- Is this part of the "conversion"?
- In all the documentation I have read, WW 1.4(.1) is on .NET 2.0. Are any changes I make for potential contributions possibly not backwards compatible as a result? Should I manually change each projects' Targeted Framework to 2.0? Is there a way to do this for the entire solution at once and not manually changing it in every single project? What is this setting specifically doing? More research will be needed on my part for this one I think.
Finally the build errors
If I build the project I get about 14 Errors, all in the DstileGUI project.
Errors look like:
Code:
Error 1 The type or namespace name 'GDAL' could not be found
(are you missing a using directive or an assembly reference?)
D:\coding\WorldWind\svn\DstilePlugin\GDALImageStore.cs 37 9 DstileGUI
I tried a few things, which I can elaborate on, but it seems as if there may be some mismatch between the gdal version and the DstileGUI code? This page seems to point out that there new Namespace conventions being used with GDAL for C# in version 1.4.0 and 1.5.0 of GDal.
I wonder if they included the right version of the .dll with the source code?
Still waiting for responses from the World Wind Central forums. The Developers Corner there seem pretty quiet but there are a few other recent threads.
Subscribe to:
Posts (Atom)