Lack of Windows GUI programming knowledge is the main reason I use Ultra Fractal - plus the fact that I'm sick of all the issues relating to software development under Windows in C/C++ etc.
One solution which I use, is SDL - it is originally inteded for games, but can be used as a simple cross platform UI.
For illustration I have attached a "shell" that I use for my GPU fractal renderer. The following snippet is all the GUI code that is needed for simple key driven interaction.
#include "SDL.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "Bulber.h"
void UpdateScreen( SDL_Surface *screen, Bulber* bulb)
{
unsigned char *raw_pixels;
SDL_LockSurface(screen);
raw_pixels = (unsigned char*)screen->pixels;
bulb->Blit( raw_pixels, screen->pitch );
SDL_UnlockSurface(screen);
SDL_UpdateRect(screen,0,0,0,0);
}
int main()
{
SDL_Surface *screen;
/* Initialize SDL's video system and check for errors */
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
printf("Unable to initialize SDL: %s\n",
SDL_GetError());
return 1;
};
/* Make sure SDL_Quit gets called when the
* program exits! */
atexit(SDL_Quit);
/* Attempt to set a 640x480 24bpp video mode */
screen = SDL_SetVideoMode(800,600,24,SDL_SWSURFACE );// | SDL_RESIZABLE);
if (screen == NULL) {
printf("Unable to set video mode: %s\n",
SDL_GetError());
return 1;
};
/* If we got this far, everything worked */
int x,y;
Bulber bulb(800,600);
float cx = 0.0f;
float cy = 0.0f;
float cz = -4.0f;
float zoom = 1.0f;
bulb.Calc( cx, cy, cz, zoom );
UpdateScreen(screen, &bulb);
SDL_EnableKeyRepeat(300,100);
SDL_Event event;
bool run = true;
for(;run;) {
SDL_WaitEvent(&event);
switch (event.type) {
case SDL_KEYDOWN:
switch(event.key.keysym.sym){
case SDLK_a:
cz -= 0.01 / zoom;
bulb.Calc( cx, cy, cz, zoom );
UpdateScreen(screen, &bulb);
break;
case SDLK_z:
cz += 0.01 / zoom;
bulb.Calc( cx, cy, cz, zoom );
UpdateScreen(screen, &bulb);
break;
case SDLK_LEFT:
cx -= 0.04f /zoom;
bulb.Calc( cx, cy, cz, zoom );
UpdateScreen(screen, &bulb);
break;
case SDLK_RIGHT:
cx += 0.04f /zoom;
bulb.Calc( cx, cy, cz, zoom );
UpdateScreen(screen, &bulb);
break;
case SDLK_UP:
cy -= 0.1f /zoom;
bulb.Calc( cx, cy, cz, zoom );
UpdateScreen(screen, &bulb);
break;
case SDLK_DOWN:
cy += 0.1f /zoom;
bulb.Calc( cx, cy, cz, zoom );
UpdateScreen(screen, &bulb);
break;
case SDLK_PAGEUP:
zoom = zoom / 1.1f;
bulb.Calc( cx, cy, cz, zoom );
UpdateScreen(screen, &bulb);
break;
case SDLK_PAGEDOWN:
zoom = zoom * 1.1f;
bulb.Calc( cx, cy, cz, zoom );
UpdateScreen(screen, &bulb);
break;
default:
break;
}
break;
case SDL_QUIT:
run = false;
break;
}
}
return 0;
}