fix cursor thing for x11/gdi, also format
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-03-24 04:26:26 +09:00
commit 6d7fe3271f
Signed by: nishi
GPG key ID: 27EF69B208EB9343
8 changed files with 231 additions and 228 deletions

View file

@ -52,7 +52,9 @@ static void draw(void) {
glPopMatrix();
}
static void idle(void) { deg += 1.0; }
static void idle(void) {
deg += 1.0;
}
static void reshape(int width, int height) {
GLfloat lpos[4];
@ -86,4 +88,6 @@ static void init(void) {
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
}
static void key(int k) { (void)k; }
static void key(int k) {
(void)k;
}

View file

@ -113,7 +113,6 @@
MwBool pointerLocked;
MwBool mouseMoved;
}
+ (MilskoCocoa*)newWithParent:(MwLL)parent

View file

@ -621,7 +621,7 @@ HCURSOR MwLLGDICreateCursor(MwCursor* image, MwCursor* mask) {
}
}
cursor = CreateCursor(GetModuleHandle(NULL), xs, ys, MwCursorDataHeight, MwCursorDataHeight, dmask, dimage);
cursor = CreateCursor(GetModuleHandle(NULL), xs - image->x, ys + (MwCursorDataHeight + image->y), MwCursorDataHeight, MwCursorDataHeight, dmask, dimage);
free(dimage);
free(dmask);

View file

@ -849,7 +849,7 @@ Cursor MwLLX11CreateCursor(Display* display, MwCursor* image, MwCursor* mask) {
XPutImage(display, pimage, imagegc, cimage, 0, 0, 0, 0, MwCursorDataHeight, MwCursorDataHeight);
XPutImage(display, pmask, maskgc, cmask, 0, 0, 0, 0, MwCursorDataHeight, MwCursorDataHeight);
cur = XCreatePixmapCursor(display, pimage, pmask, &cfg, &cbg, xs, ys);
cur = XCreatePixmapCursor(display, pimage, pmask, &cfg, &cbg, xs - image->x, ys + (MwCursorDataHeight + image->y));
XFreePixmap(display, pimage);
XFreePixmap(display, pmask);

View file

@ -87,7 +87,8 @@ static void func_handler(MwWidget handle, const char *name, void *out,
self->pixelFormat =
[[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes];
self->glc =
[[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];
[[NSOpenGLContext alloc] initWithFormat:pixelFormat
shareContext:nil];
[self->glc setView:[w getView]];
self->_win = w;
return self;

View file

@ -58,8 +58,7 @@ l(
l("");
c("Requirements");
l("");
l(
" Milsko requires either");
l(" Milsko requires either");
l(" * A Windows environment with GDI (so anything NT or 9x)");
l(" * A MacOS environment with Cocoa (10.4 or above supported)");
l(" * A Unix-like environment with X11 for runtime.");