Commit Graph

306 Commits

Author SHA1 Message Date
rdb a32030d46e framework: Clean up task manager on close_framework()
This prevents crashes due to the tasks it spawns continuing to run
2024-11-26 18:16:01 +01:00
rdb 84ed141b2a Squash merge webgl-port branch into master
Adds support for emscripten as a build target / platform, and adds a WebGL renderer back-end
2024-01-25 15:37:38 +01:00
rdb e5869ac750 pview: Fix camera positioning differences with offscreen window 2023-10-08 23:30:00 +02:00
Max Rodriguez 70cdbae247 framework: Create aspect2d child nodes & update on win resize
Closes #1510
Fixes #1508
2023-08-02 08:21:40 +02:00
rdb eefb51f510 dtoolutil: Add small_vector implementation and use it
This vector implementation does is optimized for the case of having only a small number of elements, which are stored directly on the vector object rather than being allocated from the heap.  If the capacity exceeds this small number, then a heap allocation is done.

This should improve performance in a couple of cases where vectors typically store 1 element and rarely more than that.
2023-02-22 16:48:11 +01:00
rdb 0747f46055 event: Improve interface for adding tasks from C++
The order of arguments is now the same as in Python (with the callable first), sort and priority arguments have been added, and new tasks can be added directly to a chain
2022-12-26 19:10:01 +01:00
rdb e9c97535f7 framework: Support GUI under pixel2d by default (for C++ users)
Fixes #1222
2022-01-01 18:22:02 +01:00
rdb 653cc3e091 event: Support C++11 lambdas as event handlers
It's unfortunate that we now have three maps on EventHandler for three different types of functions.  I'd love to unify them all under std::function, but the fact that it doesn't support comparison means the behavior would be different.

Perhaps in the future we can create a new interface or deprecate the existing behaviors and unify everything under std::function.
2021-11-29 14:48:06 +01:00
rdb 4af5bc9e6d event: Support lambdas as tasks via new FunctionAsyncTask
This is intended to replace GenericAsyncTask.
2021-11-29 14:47:44 +01:00
rdb 3aa77a1260 framework: Fix unnecessary ternary check 2021-11-16 17:31:27 +01:00
rdb 43fb82fa66 gobj: Add config switch for Panda not to default to packed vertex colors
See #981.  Setting `vertex-colors-prefer-packed` to false will make Panda default to OpenGL-style vertex colors, which is useful if are targeting OpenGL and not DirectX 9, avoiding a potential performance cost.
2021-03-25 23:15:58 +01:00
rdb b272af8bbf Merge branch 'cmake' 2020-01-22 11:20:51 +01:00
rdb 246e73e325 framework: fix a debug output not protected by is_debug() check 2020-01-13 16:27:58 +01:00
Sam Edwards 5fa4af9189 CMake: Rely on GNUInstallDirs to specify install paths
This makes multiarch OSes happy as they can dictate that
64-bit libraries go into 'lib64'
2019-08-31 00:48:42 -06:00
Sam Edwards 1a654cba04 CMake: Record the location that headers are installed
This populates INTERFACE_INCLUDE_DIRECTORIES on the targets
after they're installed.
2019-08-30 22:58:18 -06:00
Sam Edwards b8f3c7eb63 CMake: Move some symbols from dtool_config.h to -D flags
The symbols moved aren't used in any headers, so they don't
have to be in the installed dtool_config.h. Removing them
keeps the recompiling to a minimum when an optional feature
is toggled.
2019-04-15 22:16:05 -06:00
Sam Edwards 6097d34ead CMake: Neatly format everything for readability and consistency 2019-04-14 22:37:18 -06:00
Sam Edwards 7097f5b0e1 CMake: Move "framework" to its own component
It can depend on graphics backends, so it can't go in Core.
2019-02-23 02:54:01 -07:00
Sam Edwards 99fee1a64d CMake: Assign COMPONENT and EXPORT to all targets 2018-12-06 17:48:44 -07:00
Sam Edwards 208ecd6708 Merge branch 'master' into cmake 2018-09-02 16:06:41 -06:00
Sam Edwards fa1e1a2e63 CMake: Tidy up installation directory
Don't install "object-Configuration/" directories when
using metalibs, and also put .dll files in bin/ on Windows.
2018-09-01 11:07:55 -06:00
Sam Edwards 4695557a5d general: Don't require BUILDING_* for static builds 2018-08-31 23:54:32 -06:00
Sam Edwards 2ab77d9a27 Merge branch 'master' into cmake 2018-08-14 21:59:45 -06:00
rdb c634c455fd framework: add zero-argument version of open_framework() 2018-07-26 22:08: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
Sam Edwards b2bfb31114 general: Remove `using std::*` from headers
Also remove most `using namespace std;` statements. The only one that remains is in py_panda.h.

Closes #350
Closes #335
2018-06-14 16:04:49 +02:00
Sam Edwards ed2b3017d4 Merge branch 'master' into local/cmake-merge 2018-06-12 16:19:30 -06:00
Sam Edwards a971bc1dfc general: Break apart BUILDING_PANDAGL 2018-06-12 16:15:45 -06:00
Sam Edwards c4126942f6 Merge branch 'master' into cmake 2018-06-10 02:29:21 -06:00
Sam Edwards 7790f8429d general: Fully qualify header references into the std namespace
Closes #341
2018-06-07 10:35:12 +02:00
Sam Edwards 592a2e2d68 Merge branch 'master' into cmake 2018-06-06 13:18:12 -06:00
Sam Edwards e2b4353800 general: Replace NULL (and 0 as pointer) with C++11 nullptr
Exceptions to this replacement are:
- .c files
- Headers included by a .c file
- stb_image.h
- dr_flac.h
- Strings
- Comments
2018-06-03 16:35:13 -06:00
Sam Edwards d0ebc59d32 Merge branch 'master' into cmake 2018-05-27 14:07:05 -06:00
Sam Edwards 0ce9dc98b1 general: Move inclusion of checkPandaVersion.h to dtoolbase
This includes it everywhere, meaning developers no longer must
remember to include it in each metalib init file.
2018-05-26 18:39:24 -06:00
Sam Edwards 4cec331722 CMake: Add support for building metalibs as metalibs 2018-04-18 14:42:56 -06:00
Sam Edwards d642ca4fa0 CMake: Change linkages to go through metalibs
This changes the target_link_libraries() declarations so they only
go directly to a component library if it's in the same metalib.

If it's outside of the metalib, the correct thing to do is link against
the metalib. CMake takes care of the transitive linking for us, so
there isn't actually any big change here.
2018-04-15 01:10:21 -06:00
Sam Edwards 449195a33d CMake: Define appropriate BUILDING_ symbols 2018-03-31 04:24:06 -06:00
Sam Edwards 25b13ad199 Merge branch 'master' into cmake 2018-03-31 04:23:49 -06:00
rdb 63b1e44977 framework: fix pview crash when exit is called inside render_frame
This can happen when a system event (eg. on macOS) triggers a terminate from within process_events.

This is a workaround for a common error; the proper fix is not to put PandaFramework in the global scope.
2018-03-29 14:11:21 +02:00
Sam Edwards 9dd37e9dbc general: Add guards to ensure proper BUILDING_ macros defined
This is designed to sanity-check the buildsystem, ensuring that the
expected BUILDING_ macros are defined at the expected time. It
also helps catch cases where the wrong BUILDING_/EXPCL_ macros
are used.
2018-03-25 13:17:52 -06:00
Sam Edwards ecfd924f0d CMake: Remove references to unsupported versions of DirectX. 2018-02-18 23:34:02 -07:00
rdb 88dd3389ee cmake: install header files 2017-02-19 23:42:48 +01:00
Sam Edwards e3fcacb1f7 Merge branch 'master' into cmake 2016-11-30 19:21:50 -08:00
rdb 4381412d23 Merge branch 'release/1.9.x' 2016-09-28 00:14:21 +02:00
rdb 3ee033eeeb Write texture types when pview failed to recognise extension 2016-09-27 21:33:11 +02:00
rdb 400bc2cc26 Support .ktx textures, ETC1/ETC2/EAC compression 2016-07-15 11:50:57 +02:00
rdb 85386049f0 Merge branch 'release/1.9.x' 2016-07-09 15:39:07 +02:00
rdb fd8dd360b2 Fix compile error statically linking build with DX9 2016-07-09 09:59:51 +02:00
Sam Edwards fffd105f96 Merge branch 'master' into cmake 2016-06-25 19:12:14 -07:00
rdb 288452a861 Changes to help with static build, allow linking OpenAL statically 2016-04-29 19:54:24 +02:00