1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-04 13:33:34 +00:00
Commit graph

234 commits

Author SHA1 Message Date
bjorn 6823942e3d utf8_encode function; 2020-08-08 12:13:37 -06:00
bjorn c24317d982 Start textinput event; 2020-08-07 15:17:19 -06:00
bjorn 682633d98b Add scancode and key repeat arguments to key events; 2020-08-07 14:15:45 -06:00
bjorn 1e30c0d93c Android key events; 2020-08-06 19:42:12 -06:00
bjorn 83ff4783c2 ALIGN macro aligns up instead of down;
So you don't have to add (n - 1).  Hopefully this turns out to be
the common case.
2020-08-04 12:23:45 -06:00
bjorn 4160743b77 Fix desktop game packaging issue;
Accidentally hardcoded it to "assets" when updating Android.
2020-07-29 16:30:14 -06:00
bjorn f0a5a8838b OpenGL debug messages and contexts;
The new t.graphics.debug flag controls the following:

- If enabled, a debug context is created
- If disabled, a no-error context is created
- If enabled, GL debug messages are forwarded to lovr.log
2020-07-28 16:12:30 -06:00
bjorn e3aa4c7d5d t.graphics.debug flag; 2020-07-28 16:12:15 -06:00
bjorn 472c59bc7b Fix windows build; 2020-07-19 17:57:05 -06:00
Elias Fleckenstein 7860322af9
Reverted size_t in ine 104 back to ssize_T 2020-07-11 15:32:15 +02:00
Elias Fleckenstein ea9fadc1ad
Fixed errors & warnings when compiling on linux
I added header files with #include to prevent the implicit declaration warnings and fixed a typo in function size_t lovrPlatformGetExecutablePath(char* buffer, size_t size).
2020-07-10 16:32:45 +02:00
bjorn 9abed055d8 lovr.log;
lovr.log is a new callback that is invoked whenever LÖVR wants to
send the project a message.  For example, this could be a performance
warning from the graphics module, an error message from one of the
headset backends, or an API deprecation notice.

The callback's signature is (message, level, tag).  The message is a
string containing the message to log, level is a string that is currently
one of "debug", "info", "warn", "error", and tag is an optional string
that is used to indicate the source of the message for grouping purposes.

The default implementation of the callback just prints the message,
but the callback can be overridden to do things like filter messages,
write them to a file, or even render them in VR.  Projects can also
invoke the callback directly to log their own messages.
2020-07-06 16:20:55 -06:00
bjorn 8b8681ad2f rm core/hash; 2020-07-06 16:01:31 -06:00
bjorn 29f8365eed Clean up os_android and fix event polling issues; 2020-07-03 20:17:39 -06:00
bjorn 515cec673c Fix quit request for glfw; 2020-07-02 20:15:06 -06:00
bjorn 96337bf8cc rm core/gpu;
This is far from done and will probably be structured a bit differently.
2020-07-02 10:46:13 -06:00
bjorn 9777306b70 rm oculus mobile; 2020-07-02 10:46:10 -06:00
bjorn d8f7325bc7 lovr-oculus-mobile fixes; 2020-06-29 17:40:57 -06:00
bjorn afaae2febb Remaining android filesystem work; 2020-06-25 18:18:44 -06:00
bjorn b77276fd1f Android: make printf and print work; 2020-06-25 16:42:19 -06:00
bjorn 2042010b5b Move core/fs paths to core/os;
Usually these are more of a platform-specific concept, and they
don't really interact with files or do any io.

There is a little bit of duplication among the *nix platforms since
they're similar, but overall this organization feels a bit better.
2020-06-25 13:28:40 -06:00
bjorn 8b281d56e3 Android: Organize tup rules; Fix manifest; 2020-06-25 13:27:18 -06:00
bjorn a1aa3c8ae8 Finish vrapi driver; 2020-06-09 18:02:03 -06:00
bjorn b34c03bcc8 Tup build system for android; 2020-06-09 18:02:03 -06:00
bjorn 75e26f0051 Move core/hash to core/util; 2020-05-19 13:49:40 -06:00
bjorn f7dddfe3fd Fix PNG IDAT CRC; 2020-05-18 12:41:49 -06:00
bjorn ebc69c6c93 win32: AllocConsole if AttachConsole fails;
This may help retrieve stdout when running lovr outside of cmd.
2020-05-11 15:23:35 -06:00
bjorn b035f8e4dc core/fs: Use DWORD instead of uint32_t in fs_read and fs_write;
Fixes a warning.
2020-04-30 16:53:10 -06:00
bjorn ce2a28360d Unconditionally cast ref to volatile long on win32;
This was originally a C++-only contribution, but clang also warns
about it on windows when compiling as C.

It's nice to have one less thing specific to C++.
2020-04-30 16:49:53 -06:00
mcc d8abfcfae3 Remove mat4_transform_project, it not only duplicates mat4_transform, it is buggy 2020-04-05 19:51:37 -04:00
bjorn ef7ebaef85 core/gpu: vulkan feature detection; rm stats; 2020-02-23 00:47:59 -08:00
bjorn 3d3fb71a98 core/gpu: start shader stuff; coherent buffer mapping; 2020-02-21 18:38:33 -08:00
bjorn 93d556b603 zip: read compressed size from central directory;
Some zip writers do not write the compressed size to the local file
headers.
2020-02-21 15:44:48 -08:00
bjorn b9b8062c18 core/gpu: texture views; 2020-02-21 01:48:58 -08:00
bjorn f428ceacaf core/gpu: gl backend compiles; 2020-02-20 15:52:41 -08:00
bjorn 7d2bec7283 core/gpu: add vulkan backend; 2020-02-20 12:23:31 -08:00
bjorn 6452f51680 core/gpu: attribute formats; 2020-02-19 20:28:30 -08:00
bjorn a658da78ad core/gpu: Add all uncompressed texture formats; 2020-02-19 19:36:30 -08:00
bjorn aadadb968b core/gpu: will it blend; 2020-02-19 18:33:59 -08:00
bjorn 0620cade9e core/gpu: gpu_set_vertex_buffers; fixes; 2020-02-19 18:02:37 -08:00
bjorn cb4a7a5a43 core/gpu: indirect drawing commands; 2020-02-19 17:42:33 -08:00
bjorn 238496de29 Start core/gpu; 2020-02-19 17:21:40 -08:00
mcc e7938fe514 Fix ref.h in recent MSVC when compiled as C++
A cast is required at this point in MSVC 2019 when ref.h is included from a C++ file. This change has no effect on Lovr compiled normally (which compiles only as C), what this change does is make it possible for forks to extend Lovr with C++ files.
2020-02-17 14:47:08 -05:00
bjorn 47f4319ba8 core/png; rm stb_image_write; 2020-02-16 04:11:55 -08:00
bjorn 8477638fad Fix warning; 2020-02-15 23:27:25 -08:00
bjorn 409c2ad0c6 Fix projection matrices; 2020-02-13 16:33:17 -08:00
bjorn 723f5684cf Fix mat4_fov and desktop driver projection;
OpenVR may need updating now, but at least we know what the correct
approach is now.
2020-02-06 17:32:44 -08:00
bjorn 4a545e4d04 EGL context creation fixes; 2020-02-04 16:48:03 -08:00
bjorn 3c2154c824 Add unused EGL context creation; 2020-01-28 21:42:44 -08:00
bjorn c9a06a37cb Refactor main; Add unused android entrypoint; 2020-01-28 21:38:44 -08:00
bjorn b19a391c32 desktop: emit focus events; 2020-01-27 21:10:27 -08:00
bjorn 08577ee91b Fix cast-qual warning; 2020-01-23 11:01:27 -08:00
bjorn 0f338c3ebd Fix getDirectoryItems on windows; 2020-01-22 16:09:35 -08:00
bjorn b1eeda96cb Small safety fix; 2020-01-16 09:32:12 -08:00
bjorn 0ecd8f6b49 Fix lovr.filesystem.getExecutablePath on macOS; 2020-01-16 09:21:21 -08:00
mcc dac50c4687 Pragma once in core/hash.h 2020-01-06 13:55:39 -05:00
Bjorn ebde129204
Merge pull request #174 from mcclure/android-0.14
Android fixes. Major change is lovrMain() {} is now lovrMain {}
2019-12-17 17:23:50 -08:00
mcc c563787f7d Android fixes. Major change is lovrMain() {} is now lovrMain {}
The oculus drivers choke on #define lovrMain()
2019-12-17 20:20:09 -05:00
mcc ff1ae2c050 Minor fix to let header files compile in C++ 2019-12-17 20:02:33 -05:00
bjorn fd437423e7 Fix refcount alignment;
Once and for all?  How does alignment even work.
2019-12-15 17:04:26 -08:00
bjorn 0d156549f7 Fix remaining references to platform; 2019-12-13 19:59:09 -08:00
bjorn bb279b451c Fix remaining platform references; 2019-12-13 19:58:22 -08:00
bjorn e2d8f8c645 platform -> os;
The function names are staying the same for now.
2019-12-13 19:55:46 -08:00
bjorn 63dc8f6c9b Only use glfw for window creation;
This allows for headless operation.  Currently GLFW throws an error
if you call glfwInit without an X server running, preventing lovr
from starting at all in that situation.

Because GLFW is currently used for time functions, those had to be
moved into the platform layer.  There's lots of duplication here,
ideally the platform layer would just return raw timer values and the
timer module would handle the epoch logic, but it was too difficult to
coordinate that right now.

Also, lovrPlatformInit is guaranteed to set the time epoch to 0 now.
2019-12-13 19:55:46 -08:00
bjorn 5957d07448 Fix warnings; 2019-12-13 03:41:35 -08:00
bjorn fe422ba60f Use nanosleep instead of usleep;
usleep is deprecated and does not exist on some new Linux systems.
2019-12-13 03:41:02 -08:00
bjorn c87d6dec3d lovrPlatformGetProcAddress;
Seems nicer than a global and allows for logging/hooks;
2019-12-10 13:15:12 -08:00
bjorn 403ed8d3b0 Windows; 2019-12-10 12:19:50 -08:00
bjorn 8795ebb31d Windows WIP; 2019-12-10 12:19:50 -08:00
bjorn 488c125c5f Draw the rest of the owl; 2019-12-10 12:19:50 -08:00
bjorn 8da7df68d8 core/fs; 2019-12-10 12:19:50 -08:00
bjorn bfd63e3515 Use restrict modifier in curve evaluation;
Allows compiler to emit SIMD, way smaller/faster.
2019-12-05 13:39:04 -08:00
bjorn 08f90ab1bd Make refcount 64 bits to avoid alignment issues;
There may be a better way to solve this, but I can't think of one
that doesn't also violate strict aliasing.
2019-11-28 16:03:42 -08:00
bjorn b9f5ece72b Fix arr_splice; 2019-11-28 15:58:38 -08:00
bjorn 31b5792713 ifdef out glfwInitHint on emscripten; 2019-11-22 19:36:30 -08:00
bjorn 0bd5fced12 Use new glfw method for avoiding chdir; 2019-11-03 15:31:21 -08:00
bjorn d21911d010 Add core/map hash table; rm lib/map; 2019-10-30 00:07:05 -07:00
bjorn b35ebc15b6 rm LOVR_USE_SSE;
It doesn't really improve performance on an average LÖVR app and
isn't worth the complexity.
2019-10-22 16:46:54 -07:00
bjorn e32c3ea2df v0.13.0; 2019-10-14 18:21:07 -07:00
bjorn 77258ec4dd mat4 multiplication works with vec4; 2019-10-13 16:02:21 -07:00
bjorn 6ef27ec7cc Merge branch 'master' of github.com:bjornbytes/lovr 2019-10-08 15:29:04 -07:00
bjorn 5f404e2b1f WebVR fixes;
- Re-add the maf.c file that exports all the maf symbols.
- Fix lovrGpuTock for WebGL.
2019-10-07 19:50:17 -07:00
bjorn 0c642a6790 Improve mat4:unpack;
- Orientation is correct when the matrix is scaled
- Orientation calculation is more efficient
2019-10-04 19:26:09 -07:00
bjorn 3e47f958ad Fix mat4:lookAt; 2019-08-31 05:45:19 -07:00
bjorn 00412e2e79 Add a conf.lua flag for making the window resizable; 2019-08-28 00:59:03 -07:00
bjorn 305596adf8 Fix windows build;
LOVR_EXPORT needs to be on the declaration, unfortunately.
2019-08-26 15:53:10 -07:00
bjorn e9654cd067 Fix function prototypes; 2019-08-21 23:19:42 -07:00
bjorn 28344928c9 Simplify arr; 2019-08-21 23:16:58 -07:00
bjorn 13655d0df4 Simplify logging; 2019-08-21 19:02:02 -07:00
bjorn cd09e1e695 rm sds; 2019-08-21 16:30:20 -07:00
bjorn 8d4760167f luax is now api; 2019-08-21 15:27:26 -07:00
bjorn 7c8a44cc57 Cleanup function pointer typedefs; 2019-08-21 14:44:54 -07:00
bjorn fb279057b8 maf no longer needs to export symbols; 2019-08-21 03:29:37 -07:00
bjorn 26e7233fde Fix some API issues with lightuserdata; 2019-08-19 14:35:06 -07:00
bjorn b1b97ddb02 quat:direction returns vec3; 2019-08-19 14:19:10 -07:00
bjorn 584261e21f rm ffi vectors; 2019-08-19 14:13:36 -07:00
bjorn 4719e5edbe Well that was broken; 2019-08-10 18:12:16 -07:00
bjorn d03d0a39ec Fix GCC compilation; 2019-08-01 13:02:31 -07:00
bjorn 7690db28af Windows: Fix all the int warnings; 2019-07-31 17:51:49 -07:00
bjorn 507736ba2d Oh no; 2019-07-31 14:43:31 -07:00
bjorn 62fe520da1 maf: Fix quat_getDirection; 2019-07-16 23:03:37 -07:00
bjorn 9156fa2cbf Vector rework; 2019-07-16 20:30:51 -07:00
bjorn 4372eb293e rm comma operator;
everyone is making fun of me haha
2019-07-10 18:46:51 -07:00
mcc 8bfc8683db Patch maf.h so it can be included in C++
A C-only feature is used in one spot currently, which would be fine if maf.h were maf.c, but it's designed to be #included...
2019-07-10 14:58:55 -07:00
mcc 99f8122f23 ref.h compiles in C++
Check for GCC version >=4.7 [covers GCC or, theoretically, Intel C Compiler] or __has_builtin(__atomic_add_fetch) [covers Clang]. If either of these are found, prefer the GCC atomic builtins instead of the C11 builtins.

Also: Gates Microsoft atomics on _MSC_VER, not _WIN32. This may help improve compatibility with mingw but has not been tested.
2019-07-10 14:58:25 -07:00
mcc 53270fbd76 mat4_transform_project in maf.h
mat4_transform ignores the final row of the matrix, which normally contains scale data. This is fine for modelview matrices, which is all lovr currently uses mat4_transform for. However it fails if you ever use mat4_transform on a projection matrix.

mat4_transform_project takes the final row into account, so you can use it with projection matrices. This was useful in my fork and might be useful to have around in lovr someday later.
2019-07-02 13:37:33 -07:00
bjorn b17d01e4aa Don't return NULL from mat4_invert; 2019-06-22 17:25:48 -07:00
bjorn 879c789a08 Polyfill M_PI;
It technically isn't part of C, which is causing problems on some systems.
2019-06-20 21:43:40 -07:00
bjorn c10851d726 Fix tostring; 2019-06-20 13:47:43 -07:00
bjorn 6b2d06e766 Add lovrPlatformOpenConsole; 2019-06-16 18:55:43 -07:00
bjorn eb1e257209 Add new array implementation; Upgrade filesystem;
Filesystem:

- Uses streaming file IO.
- Uses less memory when requiring files.
- Simplifies its require path implementation.
2019-06-16 13:30:30 -07:00
bjorn 79083c7df1 Fix warnings on newer versions of gcc; 2019-06-11 19:57:20 -07:00
bjorn 31a1dc6cee Details; 2019-06-10 03:39:53 -07:00
bjorn c0f4e2848b Update android build; 2019-06-05 20:22:51 -07:00
bjorn 06c6b172de vec3 has 4 elements; 2019-06-03 07:20:03 -07:00
bjorn 31e086edaf Inline all the maf functions; 2019-06-03 07:19:25 -07:00
bjorn dc34ed4570 Start to trend towards 4-element arrays for vec3;
It will be important for enabling more SIMD.
2019-06-02 20:35:52 -07:00
bjorn c7a2e513d3 Inline hash function; 2019-06-02 04:15:46 -07:00
bjorn 374492c586 Add experimental hotkeys flag;
- Add t.hotkeys flag to conf.lua, which defaults to true.
- If t.hotkeys is truthy, the following hotkeys will be enabled:
  - Escape: Quit the experience
  - F5: Restart the experience
2019-06-02 03:00:12 -07:00
bjorn 22fe333150 Update refcounting (again);
- Ref struct only stores refcount now and is more general.
- Proxy stores a hash of its type name instead of an enum.
- Variants store additional information instead of using a vtable.
- Remove the concept of superclasses from the API.
- Clean up some miscellaneous includes.
2019-06-02 01:02:26 -07:00
bjorn d11e9be175 Lua userdata store their destructor in their metatable; 2019-05-28 16:31:13 -07:00
Bjorn Swenson 5ec6f1d1d1
Merge pull request #120 from mcclure/oculus-quest
Oculus quest support
2019-05-28 16:30:17 -07:00
bjorn 1cfc2adf4a Fix typo; 2019-05-28 02:45:08 -07:00
bjorn 6b439327fa Make refcounts atomic; 2019-05-28 02:43:15 -07:00
mcc f4189d13e8 Oculus Mobile fixes: Fix potential crash, fix touches on Go after Quest changes 2019-05-26 11:17:49 -04:00
bjorn 3804a1c0ee lovrPlatformGetName;
Used in lovr.getOS.
2019-05-20 20:44:39 -07:00
bjorn 4cc154fdfa More number conversions; 2019-05-20 20:35:07 -07:00
bjorn e87b81e34a Fix android platform include order; 2019-05-20 15:16:27 -07:00
bjorn df6b7fc96a Ref is mostly private now;
It's really nice how objects don't need to care about how they're
allocated/managed now.
2019-05-20 15:09:06 -07:00
bjorn c31853a1d4 Fix build; 2019-05-20 14:31:46 -07:00
bjorn 67b76e08c2 Details; 2019-05-20 04:15:24 -07:00
bjorn e368723248 Improve platform-specific defines; 2019-05-20 04:05:39 -07:00
bjorn 67ddefd0c2 Ensure platform functions have prefix; 2019-05-20 04:02:25 -07:00
bjorn 7645f4c014 Add core folder; 2019-05-20 02:47:33 -07:00