git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@69 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-09-30 00:52:43 +00:00
parent 99c28db60d
commit e230b5441c
9 changed files with 172 additions and 12 deletions

View File

@@ -1,8 +1,25 @@
/* $Id$ */
#include <Mw/Milsko.h>
MwLLPixmap pixmap;
static void create(MwWidget handle) {
MwSetDefault(handle);
int y, x;
unsigned char* dat = malloc(640 * 480 * 3);
for(y = 0; y < 480; y++) {
for(x = 0; x < 640; x++) {
unsigned char* px = &dat[(y * 640 + x) * 3];
double c = (double)x / 640 * 255 / 2 + (double)y / 480 * 255 / 2;
px[0] = c;
px[1] = 0;
px[2] = 0;
}
}
pixmap = MwLLCreatePixmap(handle->lowlevel, dat, 640, 480);
free(dat);
}
static void draw(MwWidget handle) {
@@ -16,7 +33,8 @@ static void draw(MwWidget handle) {
MwDrawFrameEx(handle, &r, base, 1, 1);
MwDrawFrameEx(handle, &r, base, 0, 1);
MwDrawRect(handle, &r, base);
MwLLDrawPixmap(handle->lowlevel, &r, pixmap);
// MwDrawRect(handle, &r, base);
MwLLFreeColor(base);
}