Delve into the world of graphics and game development. Discuss creating stunning visuals, optimizing game mechanics, and share resources for game developers.

Posts under General subtopic

Post

Replies

Boosts

Views

Activity

screencapturekit
I have code that captures a window and displays a cropped image. The problem is 2 fold. Kit doesn't seem to allow to modify stop and recapture image in window mode to capture a portion of the screen. So this makes me having to crop and display the cropped image via a published variable. This all works find. But seems to stop after some time. Using an M1 16gig ram. program is taking less than 100meg of mem with 40-70%cpu as the crow flies. printing captured success in debug mode and sometimes frame isn't valid so guarding against it. any ideas on how to improve my strategy?
0
0
65
2w
Can Game Mode be activated when a child (Java) process's window is fullscreened?
Imagine a native macOS app that acts as a "launcher" for a Java game.** For example, the "launcher" app might use the Swift Process API or a similar method to run the java command line tool (lets assume the user has installed Java themselves) to run the game. I have seen How to Enable Game Mode. If the native launcher app's Info.plist has the following keys set: LSApplicationCategoryType set to public.app-category.games LSSupportsGameMode set to true (for macOS 26+) GCSupportsGameMode set to true The launcher itself can cause Game Mode to activate if the launcher is fullscreened. However, if the launcher opens a Java process that opens a window, then the Java window is fullscreened, Game Mode doesn't seem to activate. In this case activating Game Mode for the launcher itself is unnecessary, but you'd expect Game Mode to activate when the actual game in the Java window is fullscreened. Is there a way to get Game Mode to activate in the latter case? ** The concrete case I'm thinking of is a third-party Minecraft Java Edition launcher, but the issue can also be demonstrated in a sample project (FB13786152). It seems like the official Minecraft launcher is able to do this, though it's not clear how. (Is its bundle identifier hardcoded in the OS to allow for this? Changing a sample app's bundle identifier to be the same as the official Minecraft launcher gets the behavior I want, but obviously this is not a practical solution.)
2
0
84
1w
Game Porting Toolkit: Any .exe exits immediately with no output
Hi Apple & devs, I'm trying to test various Windows .exe files using the Game Porting Toolkit (GPTK), but I’m hitting a wall: no matter what .exe I try, the command returns instantly with no output — no error, no logs, nothing. Here's what I'm doing: I'm using macOS Sequioa 15.5 on M1 macbook pro. I installed gameportingtoolkt GPTK 2.1 through brew from gcenx: brew install gcenx/wine/game-porting-toolkit When I run any .exe using GPTK's wine64, like this, e.g. with steam user@JMacBook-Pro / % WINEPREFIX=~/wine_prefix /usr/local/bin/gameportingtoolkit 'C:\SteamSetup.exe' --verbose user@JMacBook-Pro / % Immediate exit without any return code, output, nor errors. No output, no crash, no logs. Same result with simple test apps Running with WINEDEBUG=+all (still no output) Even running wine64 does the same thing. I’ve tried: Removing and reinstalling GPTK Creating a fresh WINEPREFIX Checking /tmp and ~/Library/Logs for logs — nothing Has anyone else experienced this or have any idea how to debug it? Is there ANY Apple support for this?? Thanks in advance.
0
0
51
1w
What good is NSBitmapFormatAlphaNonpremultiplied?
If I create a bitmap image and then try to get ready to draw into it, like so: NSBitmapImageRep* newRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: nullptr pixelsWide: 128 pixelsHigh: 128 bitsPerSample: 8 samplesPerPixel: 4 hasAlpha: YES isPlanar: NO colorSpaceName: NSDeviceRGBColorSpace bitmapFormat: NSBitmapFormatAlphaNonpremultiplied | NSBitmapFormatThirtyTwoBitBigEndian bytesPerRow: 4 * 128 bitsPerPixel: 32]; [NSGraphicsContext setCurrentContext: [NSGraphicsContext graphicsContextWithBitmapImageRep: newRep]]; then the log shows this error: CGBitmapContextCreate: unsupported parameter combination: RGB 8 bits/component, integer 512 bytes/row kCGImageAlphaLast kCGImageByteOrderDefault kCGImagePixelFormatPacked Valid parameters for RGB color space model are: 16 bits per pixel, 5 bits per component, kCGImageAlphaNoneSkipFirst 32 bits per pixel, 8 bits per component, kCGImageAlphaNoneSkipFirst 32 bits per pixel, 8 bits per component, kCGImageAlphaNoneSkipLast 32 bits per pixel, 8 bits per component, kCGImageAlphaPremultipliedFirst 32 bits per pixel, 8 bits per component, kCGImageAlphaPremultipliedLast 32 bits per pixel, 10 bits per component, kCGImageAlphaNone|kCGImagePixelFormatRGBCIF10|kCGImageByteOrder16Little 64 bits per pixel, 16 bits per component, kCGImageAlphaPremultipliedLast 64 bits per pixel, 16 bits per component, kCGImageAlphaNoneSkipLast 64 bits per pixel, 16 bits per component, kCGImageAlphaPremultipliedLast|kCGBitmapFloatComponents|kCGImageByteOrder16Little 64 bits per pixel, 16 bits per component, kCGImageAlphaNoneSkipLast|kCGBitmapFloatComponents|kCGImageByteOrder16Little 128 bits per pixel, 32 bits per component, kCGImageAlphaPremultipliedLast|kCGBitmapFloatComponents 128 bits per pixel, 32 bits per component, kCGImageAlphaNoneSkipLast|kCGBitmapFloatComponents See Quartz 2D Programming Guide (available online) for more information. If I don't use NSBitmapFormatAlphaNonpremultiplied as part of the format, I don't get the error message. My question is, why does the constant NSBitmapFormatAlphaNonpremultiplied exist if you can't use it like this? If you're wondering why I wanted to do this: I want to extract the RGBA pixel data from an image, which might have non-premultiplied alpha. And elsewhere online, I saw advice that if you want to look at the pixels of an image, draw it into a bitmap whose format you know and look at those pixels. And I don't want the process of drawing to premultiply my alpha.
2
0
43
3d