Commit Graph

71 Commits

Author SHA1 Message Date
RoosterDragon
3f8c1ad5df Don't allocate a full-sized array when creating a VertexBuffer.
We can allocate a much smaller zeroed buffer and copy that multiple times in order to zero the memory. When creating large VertexBuffers, this caps our temporary allocation size significantly.
2017-12-19 00:57:02 +01:00
RoosterDragon
7760c41bd9 Avoid array resizing in OpenAlAsyncLoadSound.
- Where it is accessible, use the length of the stream to presize the MemoryStream to the correct size.
- Instead of copying out the result via ToArray, grab the underlying buffer via GetBuffer and use that to create the sound source.

This avoids extraneous copying of the array containing the audio.
2017-12-12 00:01:04 +01:00
RoosterDragon
3a9abda441 Specify C# 5 as the language version used in all projects.
Attempts to use features from a new version will generate compile errors (on Roslyn and possibly other compilers), preventing accidental adoption of new language features.
2017-10-19 14:18:03 +02:00
RoosterDragon
3b4904775a Remove OpenAlStreamingSound.
Whilst the implementation appears to work most of the time, it sometimes stops playing audio mid-track. This could be an implementation issue, or bugs in the underlying streaming APIs of the OpenAL library. Either way, it is not currently reliable enough to be used.
2017-09-17 15:50:49 +02:00
RoosterDragon
94942cb140 Create OpenAlAsyncLoadSound.
This loads the sound inside a task, then begins playing it, avoiding blocking the UI thread. Unlike OpenAlStreamingSound it does not stream the sound from disk, rather, it loads the entire sound into memory and plays it in one go.
2017-09-17 15:50:49 +02:00
Allan Greis Eriksen
5435e34b9a Audio device names is now shown correcly in the Audio Device combolist. 2017-08-13 18:38:18 +02:00
RoosterDragon
85c948fd8d Add a streaming audio playback interface.
This allows audio to be streamed, rather than needed to be fully loaded into memory.
2017-07-14 23:02:49 +01:00
rob-v
8276b17570 Fix Sound memory leak (OutOfMemoryException), remove Music caching to free memory 2017-06-12 18:33:53 -05:00
Paul Chote
42232f4a55 Work around resolution issues in (legacy) Fullscreen on OSX. 2017-05-13 00:02:29 +01:00
Paul Chote
fff2f097d0 Add KeyInput.IsRepeat. 2017-05-06 14:10:24 +01:00
Oliver Brakmann
0635f3636d Add a setting to disable DPI scaling on Windows systems 2017-04-14 23:23:14 +02:00
Paul Chote
a880562b4b Add support for moving ISounds after creation. 2017-02-03 21:59:32 +00:00
Paul Chote
18d2454306 Pixel double hardware cursors on non-OSX. 2017-01-21 11:00:00 +00:00
Paul Chote
fb451fb203 Add an OPENRA_DISPLAY_SCALE environment variable for linux. 2017-01-21 11:00:00 +00:00
Paul Chote
87b894ad8e Add support for the windows DPI scaling. 2017-01-21 11:00:00 +00:00
Paul Chote
6599aeb035 Add support for retina displays on OSX. 2017-01-21 10:59:59 +00:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
RoosterDragon
c79ccab1ba Marshal results in QueryDevices correctly. 2016-10-03 21:47:42 +01:00
RoosterDragon
696d783a67 Improve out-of-memory logging with more details.
Also ensure that when OpenGL gives an out-of-memory error, we throw an OutOfMemoryException so the improved logging is triggered here too.
2016-09-16 07:35:08 +01:00
Paul Chote
5a7a69a875 Tidy muting code. 2016-08-06 19:53:50 +01:00
Paul Chote
9437a86e7e Remove legacy sound code and simplify platform init. 2016-08-06 19:53:50 +01:00
RoosterDragon
1c8f9d44df Clean up ALC sound device correctly.
ALC is thread-safe, therefore we can clean up from any thread and do not need to marshal to the main game thread. To clean up the device properly, we must first unset and destroy the context before attempting to close the device.
2016-07-30 14:53:33 +01:00
RoosterDragon
206088efb4 General code cleanup in OpenAlSoundEngine.cs. 2016-07-30 14:50:42 +01:00
Matthias Mailänder
f22bc68d94 Count the string length in the system codepage. 2016-05-20 21:22:12 +02:00
Matthias Mailänder
1df5e556c6 Auto-detect UTF8 instead of assuming ANSI for device names. 2016-05-20 21:22:10 +02:00
Matthias Mailänder
e47383a4fa Fix NREs in QueryDevices by bailing out early. 2016-05-20 21:21:52 +02:00
Matthias Mailänder
5029ac705f Update to .NET 4.5 2016-05-19 21:24:21 +02:00
Paul Chote
7c67b10d28 Add a secondary texture coordinate to Vertex. 2016-04-15 16:46:47 -04:00
Paul Chote
2634643d91 Write z data to the depth buffer. 2016-04-15 09:42:29 -04:00
Paul Chote
ecebb2a844 Change depth function to <=. 2016-04-15 09:42:28 -04:00
reaperrr
0861c9f6fa Merge pull request #11058 from pchote/terrain-vertex-depth
Use vertex depths for rendering terrain depth preview.
2016-04-10 16:13:50 +02:00
Paul Chote
7315ffbcb7 Fix outdated file headers. 2016-04-10 09:41:12 -04:00
Paul Chote
a8dda39a72 Introduce float3 type. 2016-04-10 09:41:01 -04:00
Paul Chote
cff482bb1a Revert "Added Keybord input filter to only register first key press."
This reverts commit 57cd25d5f8.
2016-03-06 11:11:20 +00:00
Paul Chote
bc0efbefd1 Include OpenGL version string in sysinfo. 2016-03-02 21:33:12 +01:00
Oliver Brakmann
07ec56fd22 Merge pull request #10821 from obrakmann/pr10559-squashed
Added mousewheel zooming
2016-02-24 22:37:00 +01:00
Philipp Schärer
ea74499ec2 Added mousewheel zooming 2016-02-24 22:22:32 +01:00
Paul Chote
e71225496b Clarify GPL version. 2016-02-21 16:30:48 +00:00
Paul Chote
b396965fd9 Update licence header year. 2016-02-21 16:27:31 +00:00
RoosterDragon
8e89a6a696 Simplify names, remove unused usings, remove redundant casts. 2016-01-17 21:35:36 +00:00
RoosterDragon
b5f24c3fa6 Add some missing Dispose calls, fix some Dispose implementations. 2016-01-01 04:51:54 +00:00
RoosterDragon
840dd189ae Merge pull request #10310 from pchote/moregl
More OpenGL cleanups
2015-12-29 02:08:40 +00:00
Paul Chote
6b0e4cf645 Unify framebuffer api naming. 2015-12-28 15:15:30 +00:00
Paul Chote
e69c3360f6 Reorganise GL initialisation. 2015-12-28 15:15:29 +00:00
Paul Chote
e63fc00b76 Unify framebuffer api naming. 2015-12-28 14:23:44 +00:00
Oliver Brakmann
906aa0f1fd Merge pull request #10003 from r34ch/mute-setting
Mute setting
2015-12-28 14:07:27 +01:00
Paul Chote
4372ed650e Move CheckGlVersion to OpenGL. 2015-12-28 10:59:43 +00:00
Paul Chote
d96a32a89f Move WriteGraphicsLog to OpenGL. 2015-12-28 10:57:43 +00:00
Paul Chote
9f41743465 Replace MiniTK.Audio with OpenAL-CS. 2015-12-27 17:03:32 +00:00
Paul Chote
397ca0f481 Replace MiniTK.Graphics with custom OpenGL shim. 2015-12-27 14:37:07 +00:00