Usermode/AxWin4 - Screen dimensions acquisition, speedup, window render
[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         // Load image
27         uint32_t *image = malloc(w*h*4);
28         for(size_t i = 0; i < w*h; i ++ )
29                 image[i] = rand();
30         
31         AxWin4_DrawBitmap(bgwin, 0, 0, w, h, (void*)image);
32
33         _SysDebug("Beginning queue");
34         
35         while( AxWin4_WaitEventQueue(0) )
36                 ;
37         _SysDebug("Clean exit");
38         
39         return 0;
40 }

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