Not sure why this has to be so obscure. But somehow adding the call into toggleFullscreen, even though this appDelegate doesn't have a window set, adds a menu item with the fn+F menu item. Posting this to save other pain. Plus the View menu doesn't even have a reference, and is empty otherwise. Pretty hard to polish something shippable with these unfixed outstanding flaws in the API.
CommandGroup(after: .toolbar) {
// must call through NSWindow
Button("See Below") {
// Window isn't set in AppDelegate, so menu item is skipped.
// But add fn+F menu item into app. Suo many stupid hacks.
appDelegate.window?.toggleFullScreen(nil)
}
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I create @State holding a WKWebView (heavyweight object), and then wrap that in a VKViewRepresentable, then
@State var myWebView = newWebView(request: URLRequest(url:URL(string: request)!))
This is the only way I can then reference the webView late on to run javascript queries on it. Otherwise, it's embedded in the View/ContentView hierarchy.
So then when I moved from Window to WindowGroup, only one of these WKWebView is created. This looks bad to have an empty detail panel in the previous Window. The docs on WindowGroup state that it makes new state to go with each Window in the WindowGroup, but in this case, that's not the case here.
Xcode 16 breaks fundamental feature of error/warning clickthrough to a given header or .cpp file. The issues list will jump to the point of include, instead of the actual error/warning. There's not even a highlighted line since these files aren't the source of the error.
Not really sure how this one got through QA since Apple uses Xcode internally. Now I'm constantly having to scour the report navigator, open the items, and then manually jump to file/line.
I tried using the GameController APIs for this, but they didn't seem to work. Is that the recommended API for handling keyboard/mouse? The notifications for mouse and keyboard connect/disconnect don't seem to be defined for visionOS.
The visionOS 2.0 touts keyboard and mouse support. The simulator can even forward keyboard/mouse to the app. But there don't seem to be any sample code of how to programatically receive either of these. The game controller works fine (on device, not on Simulator).
So Xcode has projects. And I breakup my code/libraries/targets into those. So why after 20 years of Xcode, can a workspace, that holds projects not display the same project opened in another workspace? The workspace redirects all output the project would normally generate in DerivedData to a completely different folder by default.
What this means is I have to shut one workspace, and then open the other workspace with a different set of projects to see the ones that are shared. The workspace can't build because it can't open the project shared with another one that is open. VS sln files don't have this issue, so why do workspace files.
The problem with ClampToEdge is that it stretches the outer strip of pixels even when uv goes outside [0,1]. So the typcial change is to use ClampToZero.
The problem with ClampToZero/Border of 0 is that it pulls in black transparent color into images. What would be better is for this to double up the edge pixels of the texture (ClampToEdge), and only once uv exceeds 0,1 then bilerp the transparent color. Currently ClampToZero pulls in black and drops alpha at the edges of small images leading to poor edges of small textures.
How do I suppress these strings? These are flooding my logs when I hit pause/resume. These seem to have been left in the debug/release builds. I'm on Xcode 13.1, and building for macOS 10.15. But I'm running on an M1 mac.
2022-02-26 12:56:43.169437-0800 app[96801:1760817] [] [0x1238a0000] CVDisplayLinkStart
2022-02-26 12:56:43.169584-0800 app[96801:1760817] [] [0x1238a0020] CVDisplayLink::start
2022-02-26 12:56:43.169772-0800 app[96801:1761488] [] [0x6000029f6bc0] CVXTime::reset
2022-02-26 12:56:43.926183-0800 app[96801:1760817] [] [0x1238a0000] CVDisplayLinkStop
I need to be able to drop these onto my app kram. But using the UTType library reports the following:
metallib - "application/octet-stream"
gltf - "model/gltf+json",
glb - "model/gltf+binary"
[UTType typeWithFilenameExtension: @"metallib"].identifier,
[UTType typeWithFilenameExtension: @"gltf"].identifier,
[UTType typeWithFilenameExtension: @"glb"].identifier
dyn.ah62d4rv4ge8043pyqf0g24pc, // ick - metallib
dyn.ah62d4rv4ge80s5dyq2, // ick - gltf
dyn.ah62d4rv4ge80s5dc // ick - glb
```
The memory layout doesn't change in this sort of cast, and this is a common construct when transforming normal and tangents.
float3 normal = input.normal * (float3x3)skinTfm;
no matching conversion for functional-style cast from 'metal::float4x4' (aka 'matrix<float, 4, 4>') to 'metal::float3x3' (aka 'matrix<float, 3, 3>')
My build generates 10 errors, and sometimes it halts the "build and run" as expected.
Most of the time, it just runs the previously successful build anyways. Seems like a basic tenent of an IDE to not do this unless I've explicitly enabled the run.
So I found out clang can do multiarch compiles (-arch arm64 -arch x86_64). But Apple seems to have left precompiled header support out. So I built the pch separately for each arch. That all works.
The next problem is that one needs to specify -include-pch foo.x64.pch and -include-pch foo.arm64.pch on the command line. This doesn't work on the compile line, since it tries to prepend arm64 AST to a x64 .o file, and vice versa.
So there is -Xarch_arm64 and -Xarch_x86_64 . But that option is limited to one argument. But "-include-pch foo.x64.pch" is two arguments.
More details of failed attempts here:
https://github.com/llvm/llvm-project/issues/114626
And no splitting out the builds isn't the same, because then -valid_arch I don't think skips the other build. This are all libraries being built by Make, and then the universal app built using an Xcode project from the libraries.
Topic:
Programming Languages
SubTopic:
General
I was working on a macOS ObjC++ tool that allocated and then replaced a single MTLTexture, and noted that all of the textures were leaked. This project was built with CMake, and I found out the Xcode defaults ARC to off.
ARC has been around long enough that I can't think of many ObjC or Swift projects that would work without it. This default should probably be changed.
The workaround for now, is in all CMakeLists.txt files, to set the following:
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES
When you use the simd classes like float3/matrix3x3 on Swift they are great. I can write and run code like this from existing math routines that are readily found on the web.
let value = m[0][0] * v[0]
When you try to do this in C++/ObjC, the code becomes this. This is not code readily found on the web, and is a big pain to convert.
float value = m.columns[0][0] * v[0];
Can the float3x3 and other wrappers to simd_float3x3 provide an operator[] to the column and other operations like splatting since v[0] above pulls the data out of simd registers.
We currently have to derive off the matrix classes, but it seems like functionality that should be provided in the C/C++ simd classes. A vector math library should promote better code readability than this. We seem to not be able to derive off the vector types which is an issue below.
I also have code based on classes that takes 3 elements that suddenly has to convert to this less readble form.
float3 v(x,y,z) - float3 v(simd_make_float3(x,y,z))
And then there's this code that should fill all values like init repeating in Swift. This is error prone in converting existing simd code to Accelerate simd. So then we try to wrap the float3, can't derive off them, and then lose all swizzling support, operators, etc. Then have to roll our own ops on that struct that holds a float3. What's the recommended way to make this more C++ like without more compiler support
float3 v = {3} - 3,0,0 wasn't expecting that
float3 v(3) doesn't compile
v = {3,0,0} is completely different syntax, and doesn't line up with MSL and most simd libraries
struct myfloat3 : float3 doesn't work
struct myfloat3
{
float3 v; - works, but loses swizzles, operators, etc
explicit myfloat3(float value)
myfloat3(float x, float y, float z)
...
}
How do you get a macOS 10.15 QuickLook extension to work? I added the provider from the Xcode template. The .appex file is in the app bundle under Contents/Plugins/foo-thumb.appex
Can these Quicklook thumbnail providers override the system. So if macOS doesn't handle thumbnails for most types of ktx or any ktx2 files, can I override that with my own Quicklook plugin?
I tried using qlmanage with -m, and all I see are qlgenerators in there. I don't see any .appex files registered or listed. So when I try this on ktx (org.krhonos.ktx) and ktx2 files (public.ktx2) a thumbnail isn't generated.
qlmanager just seems to hang without the -x argument. And on the one file that worked, it pops up a thumbnail but I don't think it was generated by my appex.
sudo qlmanage -t /Users/Foo/tests/Toof-a.ktx -c org.khronos.ktx -x
Testing Quick Look thumbnails with files using server:
/Users/Foo/tests/Toof-a.kt
- force using content type UTI: org.khronos.ktx
2021-05-28 10:04:52.471 qlmanage[23522:4229132] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x984b, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2021-05-28 10:04:52.477 qlmanage[23522:4229132] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x6607, name = 'com.apple.coredrag'
See /usr/include/servers/bootstrap_defs.h for the error codes.
* No thumbnail created for /Users/Foo/tests/Toof-a.ktx
Done producing thumbnails
Bad Message 431
reason: Request Header Fields Too Large
That's the result I get trying click on any forum message from Google Chrome. Safari doesn't exhibit this issue, so please fix the html that drives for forums so that more browsers are supported.