Blender V5.0
session/display_driver.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021-2025 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
6
7#ifdef _WIN32
8# include "util/windows.h"
9#else
10# include <unistd.h>
11#endif
12
14
19
21{
22 clear();
23
24 type_ = type;
25 handle_ = handle;
26 own_handle_ = true;
27 size_ = size;
28}
29
31{
32 return handle_ == 0;
33}
34
36{
37 need_zero_ = true;
38}
39
41{
43#ifdef _WIN32
44 CloseHandle(HANDLE(handle_));
45#else
46 close(handle_);
47#endif
48 }
49
51 handle_ = 0;
52 size_ = 0;
53 need_zero_ = false;
54 own_handle_ = false;
55}
56
61
63{
64 return size_;
65}
66
68{
69 return own_handle_;
70}
71
73{
74 bool need_zero = need_zero_;
75 need_zero_ = false;
76 return need_zero;
77}
78
85
long long int int64_t
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
void assign(GraphicsInteropDevice::Type type, int64_t handle, size_t size)
GraphicsInteropDevice::Type type_
GraphicsInteropDevice::Type get_type() const
#define CCL_NAMESPACE_END
#define assert(assertion)