Usermode/AxWin4 - Working in shared memory usage
[tpg/acess2.git] / Usermode / Applications / axwin4_src / UI / main.c
1 /*
2  * AxWin4 GUI - UI Core
3  * - By John Hodge (thePowersGang)
4  *
5  * main.c
6  * - Program core
7  */
8 #include <axwin4/axwin.h>
9 #include <assert.h>
10
11 // === CODE ===
12 int main(int argc, const char *argv[])
13 {
14         assert( AxWin4_Connect("ipcpipe:///Devices/ipcpipe/axwin4") );
15         
16         tAxWin4_Window  *bgwin = AxWin4_CreateWindow("background");
17         
18         unsigned int w, h;
19         AxWin4_GetScreenDimensions(0, &w, &h);
20
21         AxWin4_MoveWindow(bgwin, 0,0);
22         AxWin4_ResizeWindow(bgwin, w,h);
23         AxWin4_SetWindowFlags(bgwin, AXWIN4_WNDFLAG_NODECORATE|AXWIN4_WNDFLAG_KEEPBELOW);
24         AxWin4_ShowWindow(bgwin, true);
25         
26         
27         uint32_t *buf = AxWin4_GetWindowBuffer(bgwin);
28         _SysDebug("buf = %p", buf);
29         // Load image
30         uint32_t *image = malloc(w*h*4);
31         for(size_t i = 0; i < w*h; i ++ )
32                 image[i] = i*(0x1000000/w*h);
33         
34         //AxWin4_DrawBitmap(bgwin, 0, 0, w, h, (void*)image);
35
36         _SysDebug("Beginning queue");
37         
38         while( AxWin4_WaitEventQueue(0) )
39                 ;
40         _SysDebug("Clean exit");
41         
42         return 0;
43 }

UCC git Repository :: git.ucc.asn.au