Commit Graph

10234 Commits

Author SHA1 Message Date
rdb 0cd69c8748 gobj: fix TexturePool ambiguity when loading tex with other settings
Previously, if you called load_texture a second time with different parameters (such as an alpha filename), you would still get the old texture.
2018-07-31 14:56:04 +02:00
rdb fe1bfef5c0 express: fix a few compile errors with certain WeakPointerTo uses
Fixes #367
2018-07-31 14:02:58 +02:00
rdb 4e42c4c941 nativenet: fix interrogate error recognizing sockaddr types 2018-07-31 11:08:14 +02:00
Mitchell Stokes 247575df62 CoordinateSystem: Document enumerators 2018-07-30 21:26:50 -07:00
rdb 91b01e5621 collide: add tube-into-box collision test 2018-07-30 22:37:02 +02:00
rdb 243ee75e47 express: refactor WeakPointerTo::lock() a little bit 2018-07-30 22:24:55 +02:00
rdb ad3ab3ad21 Define stable ordering for WeakPointerTo for use as map/set key
Currently, the WeakPointerTo comparison operators compare the raw pointers, but this is not useful as it may cause a false equality if one weak pointer in the comparison is expired and points to memory that has since been reused.

Instead, we can define a comparison based on the control block pointer, which exists since the new weak pointer implementation in 0bb81a43c9.  This is implemented in the owner_before method, matching C++11 std::weak_ptr semantics.

I would now recommend deprecating most comparison operators of WeakPointerTo or redefining them to make more sense, ie. comparing equal if they (once) referred to the same object and not if they simply point to the same memory address.  This has not yet been done, though code that uses the comparison operators has been fixed in this commit.

Overloads of std::owner_less have been provided for creating a map or set with Weak(Const)PointerTo keys.
2018-07-30 17:27:09 +02:00
rdb 2d7e80a89e express: add full range of WeakPointerTo ctors and assign ops
Matches PointerTo constructors/assignment operators, supporting conversion between related pointer types.

Fixes #367
2018-07-30 17:26:02 +02:00
rdb 0cb763a10a ShaderGenerator: always use generic attr on Linux
48808fe269 disabled this on Linux, but I believe this was an accidental change.
2018-07-26 22:58:15 +02:00
rdb 02b32a5814 glgsg: support vertices-float64 in core profile shaders
Requires OpenGL 4.1 or GL_ARB_vertex_attrib_64bit extension.
2018-07-26 22:58:15 +02:00
rdb 0f4168a304 text: use 64-bit coords in TextAssembler if vertices-float64 set 2018-07-26 22:58:07 +02:00
rdb d081b4d420 mathutil: override plane.normalize() to be meaningful for planes
Now it only divides by the length of the normal, rather than also adding in the square of the w component.
2018-07-26 22:08:37 +02:00
rdb c634c455fd framework: add zero-argument version of open_framework() 2018-07-26 22:08:37 +02:00
rdb ecfeae8a27 shader: support double-precision vertex columns in GLSL 2018-07-26 22:07:20 +02:00
rdb 7fe72c47f3 glgsg: update copy of glext.h 2018-07-23 09:02:12 +02:00
rdb 1a6d329fde gobj: support T_unsigned_int_24_8 in TexturePeeker 2018-07-23 08:32:58 +02:00
rdb f45fa747d1 x11display: fix BadWindow if get_pointer called after win close 2018-07-17 23:01:44 +02:00
rdb bbb15631c6 mathutil: support infinite near/far in LFrustum
I don't know if anyone is using LFrustum, but just in case, it's good to support this corner case.
2018-07-17 23:00:57 +02:00
rdb cf240d95c1 gobj: support infinite near distance in PerspectiveLens
Useful when rendering with near/far planes flipped around.
2018-07-17 22:59:54 +02:00
rdb 359ce3e9ef glgsg: fix error with glObjectLabel and SSBO 2018-07-17 22:59:23 +02:00
rdb b5194d9ff2 glgsg: pad SSBOs to 16 byte boundary (required by some drivers) 2018-07-17 22:59:15 +02:00
rdb 06539f5c66 glsl: support passing uint variables to shader 2018-07-17 22:32:34 +02:00
rdb 911a549386 collide: add tube-into-tube collision test 2018-07-17 22:30:06 +02:00
rdb 71b4b807f8 collide: add line-into-box test, improve segment/ray into box 2018-07-17 22:24:35 +02:00
rdb 6cd59807dd Remove useless test_display.cxx file 2018-07-17 19:38:10 +02:00
rdb 799f0b4f78 glgsg: work around driver bug extracting buffer texture data
Some drivers would report the wrong internal format.  But it's silly that we query the internal format anyway, since buffer textures have a fixed sized internal format.
2018-07-17 17:04:50 +02:00
rdb 61084a3f4e pgraph: work around C++11 bug in something or other (see #355) 2018-07-12 14:24:40 +02:00
rdb 10fe8659c6 gobj: work around a deadlock in GeomCacheManager::flush() 2018-07-12 14:22:27 +02:00
rdb e41eeaae23 glgsg: if 32-bit unorm depth is not available, fallback to float
This prevents falling back to 24-bit depth if 32-bit depth is requested.
2018-07-12 14:17:02 +02:00
rdb 828233a8f2 glgsg: support gl-depth-zero-to-one to get same NDC Z range as D3D 2018-07-12 14:13:32 +02:00
rdb 16daf08e42 glgsg: fix some GCC warning messages 2018-07-11 13:33:50 +02:00
rdb ff3d005230 x11display: fix Xlib thread safety problems 2018-07-11 13:33:21 +02:00
rdb 55146b9f82 dxgsg9: fix compilation error with WeakPointerTo comparison 2018-07-09 17:09:11 +02:00
rdb fbce833aae pgui: reduce unnecessary locking in PGItem
A deadlock has been observed if the lock is held while traversing the scene graph, so the need for locking in cull_callback is now reduced.
2018-07-09 16:13:01 +02:00
rdb abe20fc489 fmod: return NullAudioSound if file does not exist
This matches the OpenAL behaviour, and is needed to fix the unit tests on macOS.
2018-07-08 21:49:37 +02:00
rdb c6ed4e1836 general: don't cast to regular pointer when returning a PointerTo
This is inefficient because it induces an unnecessary ref()/unref() pair when we just need to move the pointer out of the function.  Thanks to 23128e4695, we can now move between related pointer types, making the .p() hack unnecessary.
2018-07-08 21:40:58 +02:00
rdb 23128e4695 express: support casting between compatible PointerTo types
This makes it possible to implicitly convert a PT of a derived type to a (C)PT of a base type, without needing to first convert it to a regular pointer.  This also applies to moves, which are now more efficient due to the lack of need for ref/unref pair even if the pointer type is not exactly the same.
2018-07-08 21:33:49 +02:00
rdb 409231d214 express: make WeakPointerTo cast operators explicit
This prevents accidentally (and unsafely) decaying a WeakPointerTo to a regular pointer.
2018-07-08 21:25:08 +02:00
rdb fb82a1c557 express: enable WeakPointerToBase comparison operators on Win32
I'm not sure why they were ifdeffed out, but they should certainly be available so that it is possible to compare WeakPointerTo in a thread-safe manner.
2018-07-08 21:22:25 +02:00
rdb 269d154aea chan: fix thread-unsafe access of WeakPointerTo 2018-07-08 21:15:40 +02:00
rdb eda47c7f3b bullet: support Plane class in BulletPlaneShape 2018-07-08 21:13:13 +02:00
rdb 835a895c51 windisplay: don't adjust in_window during get_pointer
This restores the old behaviour from before 29a08932ea, which makes in_window true during pointer capture (ie. click-and-drag) even if the cursor leaves the window.

X11 behaviour is already not to adjust in_window.

Fixes #363
2018-07-07 22:55:45 +02:00
Brian Lach fd227f6492 bullet: allow creation of BulletCapsuleShape from CollisionTube 2018-07-06 13:31:00 -04:00
rdb d4d582484f display: fix ability to make screenshots in multithreaded pipeline
Problem is that WGL is strict about binding context in different thread while it is still bound in another thread.  Either way we need to make sure the draw thread is not rendering, so if you call get_screenshot() from a thread other than the draw thread, it uses the GraphicsEngine to wait until the draw thread is idle and then asks it to do the get_screenshot().

Fixes #360
2018-07-05 19:02:37 +02:00
rdb b85fead09d wgldisplay: report context binding error, keep track of thread
This isn't really a complete solution, just a stopgap measure to prevent a crash.
2018-07-05 17:55:39 +02:00
rdb 5fe294a467 bullet: prevent softbody with AABB out of bounds from asserting
See #357
2018-07-05 12:48:11 +02:00
rdb 96a48a6848 glgsg: fix issue with extract_texture_data and buffer textures
It would always extract the last-created buffer texture, not the texture in question.
2018-07-04 20:56:07 +02:00
rdb 00888518fe gobj: add F_r32i and F_r32 to TexturePeeker 2018-07-04 20:31:08 +02:00
rdb f2976b03ec gobj: add alignment support and move semantics to SimpleAllocator 2018-07-02 12:55:18 +02:00
rdb f5a78d599d putil: make LinkedListNode moveable 2018-06-30 21:38:45 +02:00