3 * - By John Hodge (thePowersGang)
8 #include <axwin4/axwin.h>
10 #include "include/common.h"
11 #include "include/taskbar.h"
14 tAxWin4_Window *CreateBGWin(int w, int h);
17 unsigned int giScreenWidth = 640;
18 unsigned int giScreenHeight = 480;
21 int main(int argc, const char *argv[])
23 assert( AxWin4_Connect("ipcpipe:///Devices/ipcpipe/axwin4") );
25 AxWin4_GetScreenDimensions(0, &giScreenWidth, &giScreenHeight);
27 tAxWin4_Window *bgwin = CreateBGWin(giScreenWidth, giScreenHeight);
30 _SysDebug("Beginning queue");
31 while( AxWin4_WaitEventQueue(0) )
33 _SysDebug("Clean exit");
38 tAxWin4_Window *CreateBGWin(int w, int h)
40 tAxWin4_Window *bgwin = AxWin4_CreateWindow("background");
41 AxWin4_MoveWindow(bgwin, 0,0);
42 AxWin4_ResizeWindow(bgwin, w,h);
43 AxWin4_SetWindowFlags(bgwin, AXWIN4_WNDFLAG_NODECORATE|AXWIN4_WNDFLAG_KEEPBELOW);
45 // Load background image
46 uint32_t *buf = AxWin4_GetWindowBuffer(bgwin);
49 for( size_t y = 0; y < h; y ++ )
51 for(size_t x = 0; x < w; x ++ )
53 uint8_t r = y * 256 / h;
55 uint8_t b = x * 256 / w;
56 buf[y*w+x] = (r << 16) | (g << 8) | b;
62 //AxWin4_FillRect(bgwin, 0, 0, w, h, 0x0000CC);
64 //AxWin4_DamageRect(bgwin, 0, 0, w, h);
65 AxWin4_ShowWindow(bgwin, true);