X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin2_src%2FWM%2Fvideo.c;h=d17e0e595489ee9d995f5b233466f954a57bf348;hb=099719a211c90b88e59e9dc08bcf18ec1a21573d;hp=00dbe16cf2a1e6064652be6700b557cb00e22daa;hpb=1c2a87ec67d332b6a165c79398693eac1eb1166e;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin2_src/WM/video.c b/Usermode/Applications/axwin2_src/WM/video.c index 00dbe16c..d17e0e59 100644 --- a/Usermode/Applications/axwin2_src/WM/video.c +++ b/Usermode/Applications/axwin2_src/WM/video.c @@ -7,13 +7,14 @@ #include // === PROTOTYPES === -void Video_Setup(); -void Video_Update(); +void Video_Setup(void); +void Video_Update(void); +void Video_FillRect(short X, short Y, short W, short H, uint32_t Color); // === GLOBALS === // === CODE === -void Video_Setup() +void Video_Setup(void) { int tmpInt; @@ -58,8 +59,42 @@ void Video_Setup() Video_Update(); } -void Video_Update() +void Video_Update(void) { - seek(giTerminalFD, 0, SEEK_SET); + //seek(giTerminalFD, 0, SEEK_SET); + seek(giTerminalFD, 0, 1); write(giTerminalFD, giScreenWidth*giScreenHeight*4, gpScreenBuffer); } + +void Video_FillRect(short X, short Y, short W, short H, uint32_t Color) +{ + uint32_t *buf = gpScreenBuffer + Y*giScreenWidth + X; + + _SysDebug("Video_FillRect: (X=%i, Y=%i, W=%i, H=%i, Color=%08x)", + X, Y, W, H, Color); + + if(W < 0 || X < 0 || X >= giScreenWidth) return ; + if(X + W > giScreenWidth) W = giScreenWidth - X; + + if(H < 0 || Y < 0 || Y >= giScreenHeight) return ; + if(Y + H > giScreenHeight) H = giScreenHeight - Y; + + while( H -- ) + { + memset32( buf, Color, W ); + buf += giScreenWidth; + } +} + +void Video_DrawRect(short X, short Y, short W, short H, uint32_t Color) +{ + Video_FillRect(X, Y, W, 1, Color); + Video_FillRect(X, Y+H-1, W, 1, Color); + Video_FillRect(X, Y, 1, H, Color); + Video_FillRect(X+W-1, Y, 1, H, Color); +} + +void Video_DrawText(short X, short Y, short W, short H, void *Font, int Point, uint32_t Color, char *Text) +{ + // TODO! +}