Jul 26 2009

IcoFX - Free Icon Editor

When it comes to developing software the icon for the executable is usually not something handled by me and not something over which I place a great amount of concern.  But earlier today I was working on a Windows Mobile program that I wanted to have a polished look, down to the program icon.  I designed my icon work in Photoshop and was trying to import it into the Visual Studio icon editor.  I had no trouble doing this with the 24-bit true-color version of the icons, but when I was adding the paletted versions I ran into problems.  I evaluated some free icon editors and came across one that I absolutly love, IcoFX.

In short IcoFX is free and very capable.  It will save icons in both Windows and OS X format.  It takes care of resizing the icon images for you. If you are ever in need of a better icon editor you should check this out.

IcoFX Web Page

Tags:

Jul 25 2009

Creating a High Performance Message Loop

I've heard criticisms of the Windows and Windows Mobile environment because of the way that the default message pump is implemented and the performance cap that it puts on applications that require constant refreshing of the UI (such as games).  The problem is that the default message pump is geared towards business applications and minimizing CPU usage.  If you need to make a high performance application or game then you should use a different message pump implementation. You should not be waiting on WM_PAINT message.  You should just go ahead and repaint the screen.   Given that many developers will never alter the default message pump implementation it is preferable to have one that has low CPU usage by default.  If you want to do performance graphics you need a loop similar to the following:

	
bool keepRunning = true;
while(keepRunning)
{
	if(PeekMessage(&msg,NULL,0,0,TRUE))
	{
		if(msg.message==WM_QUIT)
			keepRunning=false;
		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) 
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}
	}
	else
	{
		//Execute Game Logic Here and rendering here
	}
}

The default message pump handling would be blocked when there are no messages to process and the WM_PAINT message (being low priority) would always be the last thing on the queue. In the message pump above the application will be able to concentrate on the game logic and give attention to messages on the queue when they arrive.  We'll talk about  other things that you would need to do for a game in coming posts.

Tags:

Dec 17 2008

Secret Run Menu in Windows Mobile

Category: Windows Mobile | Tips | WindowsJoel Ivory Johnson @ 00:45

Like the desktop versions of Windows there is a Run menu in Windows Mobile. But it is hidden.  To access it hold down the action button and access the context-menu (press-and-hold) button on the clock. 

Selecting "Run" will display the run menu.

 

In case you are wondering why any one would want to have access to this here is the reason.  Several programs on Windows Mobile devices can accept command line arguments.  But since there is no command line in Windows Mobile there's not a clear way to pass such arguments to a program.  A typical user would never need this, but a developer would.

Tags: