Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qsgtexture_mac.mm
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qsgtexture_p.h"
6#include <private/qquickitem_p.h>
7#include <private/qquickwindow_p.h>
8#include <QtCore/private/qnativeinterface_p.h>
9#include <rhi/qrhi.h>
10
12
13id<MTLTexture> QSGTexturePlatformMetal::nativeTexture() const
14{
15 if (auto *tex = m_texture->rhiTexture())
16 return (id<MTLTexture>) quintptr(tex->nativeTexture().object);
17 return 0;
18}
19
20namespace QNativeInterface {
21
23
24QSGTexture *QSGMetalTexture::fromNative(id<MTLTexture> texture,
26 const QSize &size,
27 QQuickWindow::CreateTextureOptions options)
28{
29 return QQuickWindowPrivate::get(window)->createTextureFromNativeTexture(quint64(texture), 0, size, options);
30}
31
32} // QNativeInterface
33
static QQuickWindowPrivate * get(QQuickWindow *c)
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\inmodule QtQuick
Definition qsgtexture.h:20
\inmodule QtCore
Definition qsize.h:25
Combined button and popup list for selecting options.
#define QT_DEFINE_NATIVE_INTERFACE(...)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint texture
size_t quintptr
Definition qtypes.h:167
unsigned long long quint64
Definition qtypes.h:61
aWidget window() -> setWindowTitle("New Window Title")
[2]