Quat:mul also takes numbers.
They both require 3 args when using numbers.
I didn't opt for the 4-component Mat4:mul(numbers) variant, mostly out
of laziness.
Co-Authored-By: Josip Miskovic <josipmiskovic@gmail.com>
They defaulted to 1 to avoid confusion when mipmaps weren't generated
during a render pass (withou the { mipmaps = true } flag), but now the
mipmaps flag is obsolete and render passes automatically generate
mipmaps for all levels in their texture views. This means that render
passes can have mipmaps by default again, which leads to better
appearance when sampling them later.
Restores ability to open window after initializing graphics module.
Surface is created lazily instead of being required upfront.
Use native platorm handles instead of GLFW's callbacks.
Some minor reorganization around core/gpu present API and xr transitions.
Linux links against libxcb/libX11/libX11-xcb for XGetXCBConnection.
The message box is meant to be a hack to improve UX on Windows, not an
officially supported feature of core/os. So it's more appropriate to
inline it in the one place/platform where it's used.
GLFW reports window size as zero on Windows when the desktop window is
minimized. This is by design. Using zero width/height for window
textures isn't valid. The fix is to ignore resize events where the
width or height is zero and also cache the last-valid window size so it
can be reported by os_window_get_size. Sighs...
Currently I don't think there's a way for plugins to use JNI, because they
have no way to access the JavaVM or JNIEnv pointers. JNI_OnLoad is only
called for native libraries loaded by Java, and the plugin library has
no way of loading liblovr.so or accessing its symbols because the
library is inside the APK. This change emulates JNI_OnLoad as a means
of smuggling the JavaVM over to plugins before they're loaded. On
Android API level 31, the JNI_GetCreatedJavaVMs function was exposed on
Android, so that may be an alternative for plugins to use in the future.
These are called when creating/destroying Thread objects. It's
currently only implemented on Android, where it attaches/detaches the
Java VM to the thread. This allows JNI calls to be used on threads.
However I don't think e.g. `lovr.system.requestPermission` will work on
a thread yet, because it uses the global JNI env from the main thread
instead of the thread's JNI env. Still, attaching/detaching the VM is
an improvement and will allow well-behaved JNI methods to work on
threads now.
I don't know how expensive this is, yolo.
Just draw a sphere. The transform is rotated so the sphere segments
line up better, because spheres and capsules use different orientations
for their sphere parts. Also the "degenerate" z axis is reconstructed
to be perpendicular to the x/z axes. This doesn't seem like it will be
particularly fast, but hopefully people aren't drawing zero-length
capsules too often. There might be an opportunity to shortcut the
rotation since it's 90 degrees and would just involve swapping columns.