1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-02 12:33:52 +00:00
Commit graph

2925 commits

Author SHA1 Message Date
Nevyn Bengtsson 972eb108c0 NULL is not valid for buffers in UnqueueBuffers 2020-01-11 16:31:06 +01:00
bjorn dc1c011380 Fix bug with std140 offset logic; 2020-01-09 21:57:25 -08:00
bjorn dd6d737a43 CMake: compile binary resources earlier; 2020-01-09 21:57:13 -08:00
Nevyn Bengtsson 3279c0d3f0 Document buffer unqueueing in source play 2020-01-09 16:37:28 +01:00
bjorn 42c85c39fb rm 1ms sleep from main loop;
It's causing massive problems on windows, and sleeping for zero ms
is good enough to relinquish CPU time to the OS.  VR APIs also do
their own sleeping.
2020-01-08 23:58:11 -08:00
Bjorn 14e197414c
Merge pull request #185 from mcclure/hash-pragma-once
core/hash.h is missing #pragma once
2020-01-08 16:02:19 -08:00
Bjorn 9eaa970bc9
Merge pull request #186 from alloverse/fix/184
Bump msdfgen + add move_dll for it
2020-01-08 16:02:06 -08:00
Nevyn Bengtsson ab3e7a52fa AudioStream: fix broken GetDurationInSeconds
d'oh
2020-01-09 00:01:18 +01:00
Nevyn Bengtsson 86ba2feeeb RawAudioStream: Use cursor instead of realloc-remainder
Previous code would wastefully reallocate memory for every time a buffer is too big to fit. New code just uses an index into the next buffer at which to start reading, requiring no extra allocation.
2020-01-08 23:52:08 +01:00
Nevyn Bengtsson 1ca57a073c style fixes after review 2020-01-08 23:44:28 +01:00
Nevyn Bengtsson edbfbf9bdc audiostream: make getDuration consistent between raw and buffer-based
queueLength was in samples, samples was samples/channelCount. Now samples is always samples, and the division by channels occurrs in the new getter
2020-01-08 17:58:25 +01:00
Nevyn Bengtsson af6b3515ef audiostream: use samples instead of queueLength
Instead of having a bogus samples ivar in AudioStream when it's raw, use it to denote the amount of audio data enqueued.

This means `stream:getDuration()` gets the same meaning as `stream:getQueueLength()` (except in seconds instead of samples), so we can remove the latter.
2020-01-08 17:55:04 +01:00
Nevyn Bengtsson 3cb7649996 audiostream: what the heck is memory.h
fixes review comment
2020-01-08 17:49:13 +01:00
Nevyn Bengtsson d987dd0dc3 Bump msdfgen + add move_dll for it
Fixes #184
2020-01-06 20:19:52 +01:00
mcc dac50c4687 Pragma once in core/hash.h 2020-01-06 13:55:39 -05:00
Nevyn Bengtsson ae5877a299 Rewind raw sources on explicit stop
I missed this one in dbe2edd8
2020-01-05 21:26:41 +01:00
Nevyn Bengtsson 1db932d856 Source: Stop, then unqueue buffers
Doing it the other way around is illegal; you may not unqueue unprocessed buffers, so we need to stop first.
2020-01-05 21:26:14 +01:00
Nevyn Bengtsson b3fb31f5a4 Destructor for raw audio stream 2020-01-05 21:19:08 +01:00
Nevyn Bengtsson dbe2edd89d Source: Do rewind on stop like before, and clear buffers
I changed my mind. Let's use rewind to clear buffers on a raw stream like Bjorn suggested, and put rewind at stop like it was before.
2020-01-05 21:08:30 +01:00
Nevyn Bengtsson a8b4dc673d Accessor for RawAudioStream:getQueueLength
Useful for determining current amount of latency.
2020-01-05 00:05:29 +01:00
Nevyn Bengtsson 5232aa2ff2 RawAudioStream: Add a limit to amount of queued data
This is useful for making sure the audio subsystem doesn't go haywire with too much generated data
2020-01-04 23:49:58 +01:00
Nevyn Bengtsson 2d681260e5 RawAudioStream: Fix byte/sample confusion
dequeue_raw thought that size was in bytes, but it's in samples.
2020-01-04 23:22:58 +01:00
Nevyn Bengtsson a3720b494b RawAudioStream: Fix use-after-free 2020-01-04 02:02:32 +01:00
Nevyn Bengtsson e85a9b74c6 Audio source: unqueue before playing 2020-01-04 01:58:03 +01:00
Nevyn Bengtsson a274eb05d1 RawAudioStream: Fix a buncha crashes
It's still buggy but at least less so
2020-01-03 23:01:21 +01:00
Nevyn Bengtsson 33bee6ce44 Audio: Rewind on play, not stop
Before, streams were rewound when they stopped, so that next time they're played they're played from the start.

Instead, rewind on play instead, so that it's done when it's needed. This gets us a good point to make sure we're not rewinding raw streams too.
2020-01-03 23:00:58 +01:00
Nevyn Bengtsson c6806f50e1 RawAudioStream: getter for isRaw
And disallow looping raw streams
2020-01-03 22:59:37 +01:00
Nevyn Bengtsson 4fb4f6cdd1 RawAudioStream lua API 2020-01-03 17:15:12 +01:00
bjorn 4dc1f6fe57 YEAR; 2020-01-02 18:42:55 -08:00
bjorn db6efbb5b2 Update README; 2020-01-02 18:42:55 -08:00
Nevyn Bengtsson f6abb8d714 Raw audiostream implementation
Naive unoptimized implementation to get a feel
for the API design.
2020-01-02 20:34:55 +01:00
Bjorn e74fb01b59
Merge pull request #178 from Jcd1230/master
Remove bad pragma pack for OpenVR on Linux and Mac
2020-01-01 14:38:36 -08:00
Jason Dogariu 163367a3ba rm pragma pack to fix OpenVR on Linux and Mac 2020-01-01 17:34:45 -05:00
bjorn fc8c195ab1 Update glfw to work around macos vsync problem; 2020-01-01 02:55:40 -08:00
bjorn 1db51ed25f tup: fix typo; 2019-12-31 19:40:39 -08:00
bjorn c9b1f257bf api: try new file naming convention; Tupfile: cleanup;
I assume full responsibility for any catastrophes this causes.
2019-12-31 19:31:44 -08:00
bjorn 72328640b6 rm CONTRIBUTING;
It's a guide on the website now.
2019-12-31 18:51:47 -08:00
bjorn c06a20cd78 Update .editorconfig;
- Only apply to stuff in src folder.
- Add lua extension.
- Ignore lib folder.

Considering moving it into src or removing it completely.
2019-12-31 18:39:29 -08:00
bjorn f12a092739 OpenXR build instructions;
It is probably bad that there is not a better place to put this,
but it is better than nothing.
2019-12-31 18:29:18 -08:00
bjorn 9fdeb75802 I can't into gitignore; 2019-12-31 18:23:56 -08:00
bjorn d228dc95d7 Automatically convert binary resources;
- Teach CMake how to compile binary resources to C headers, like xxd.
- Note: tup is already using xxd to do this.
- gitignore binary resource headers to reduce git noise and avoid problematic
  interactions between git and build systems.
2019-12-29 11:25:30 -08:00
bjorn 6060dc12b1 Improve tup config;
- Add config folder that contains tup config files.  There is a default
  config added to source control, but everything else in that folder is
  gitignored so you can add your own custom configurations.
- Remove and gitignore tup.config.
- This results in the following setup:
  - You can now create a tup.config symlink that points at the config
    you want to use.
  - Or, you can use the `tup variant` command to manage multiple build
    configurations at the same time (e.g. debug, release, wasm).
2019-12-29 10:52:44 -08:00
bjorn b18baf4e3c rm .travis.yml;
I haven't been getting much value out of the emscripten CI, and having
two CI systems is kind of awkward.  Also, travis doesn't let you change
the location of .travis.yml and it's cluttering up the root folder.  It
is possible to add this back in the future if there's a need for it,
preferably using appveyor or some other system.
2019-12-29 10:34:28 -08:00
bjorn f88268b763 rm openxr submodule;
The OpenXR headset driver is not enabled by default, and it doesn't
seem like this will change soon, so let's omit the submodule
dependency to save the bytes/time.
2019-12-29 10:31:15 -08:00
bjorn 12fcaffc3b Slight update to lovrDirSep;
Macro instead of global variable.
2019-12-29 10:30:26 -08:00
bjorn 79fd5ad7d8 Name boot.lua chunk properly;
This makes error messages nicer.
2019-12-28 23:18:03 -08:00
bjorn e538965f77 Add newline to end of stb_image.h; 2019-12-28 23:16:36 -08:00
bjorn a5db2d6c5c mv appveyor config to resources folder; 2019-12-28 20:13:19 -08:00
Bjorn 4687f30024
Merge pull request #175 from mcclure/threadlocal-vflip
Patch in thread local storage for stb_image vflip
2019-12-20 14:06:05 -08:00
mcc 21a52368f5 Patch in thread local storage for stb_image vflip
This makes loading images in multiple threads concurrently safe.

Adds a new CMake variable LOVR_USE_THREADLOCAL, by default on
2019-12-20 16:09:18 -05:00