| 1 | // Copyright (C) 2023 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef STATICPHYSXOBJECTS_H |
| 5 | #define STATICPHYSXOBJECTS_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include "qtconfigmacros.h" |
| 19 | |
| 20 | #include "extensions/PxDefaultAllocator.h" |
| 21 | #include "extensions/PxDefaultErrorCallback.h" |
| 22 | |
| 23 | namespace physx { |
| 24 | class PxPvdTransport; |
| 25 | class PxPvd; |
| 26 | class PxFoundation; |
| 27 | class PxDefaultCpuDispatcher; |
| 28 | class PxCooking; |
| 29 | } |
| 30 | |
| 31 | QT_BEGIN_NAMESPACE |
| 32 | |
| 33 | struct StaticPhysXObjects |
| 34 | { |
| 35 | physx::PxDefaultErrorCallback defaultErrorCallback; |
| 36 | physx::PxDefaultAllocator defaultAllocatorCallback; |
| 37 | physx::PxFoundation *foundation = nullptr; |
| 38 | physx::PxPvd *pvd = nullptr; |
| 39 | physx::PxPvdTransport *transport = nullptr; |
| 40 | physx::PxPhysics *physics = nullptr; |
| 41 | physx::PxDefaultCpuDispatcher *dispatcher = nullptr; |
| 42 | physx::PxCooking *cooking = nullptr; |
| 43 | |
| 44 | unsigned int foundationRefCount = 0; |
| 45 | bool foundationCreated = false; |
| 46 | bool physicsCreated = false; |
| 47 | |
| 48 | static StaticPhysXObjects &getReference(); |
| 49 | }; |
| 50 | |
| 51 | QT_END_NAMESPACE |
| 52 | |
| 53 | #endif |
| 54 | |