Skip to content

Commit

Permalink
Rename setFramebufferObject -> setOpenGLFramebufferObject (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntadej authored Aug 27, 2024
1 parent 5b4081e commit 48b2e07
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/core/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1541,18 +1541,18 @@ void Map::render() {
}

/*!
\brief Set the framebuffer object.
\param fbo The framebuffer object ID.
\param size The framebuffer size.
\brief Set the OpenGL framebuffer object.
\param fbo The OpenGL framebuffer object ID.
\param size The OpenGL framebuffer size.
If MapLibre Native needs to rebind the default \a fbo, it will use the
ID supplied here. \a size is the size of the framebuffer, which
on high DPI screens is usually bigger than the map size.
Must be called on the render thread.
*/
void Map::setFramebufferObject(quint32 fbo, const QSize &size) {
d_ptr->setFramebufferObject(fbo, size);
void Map::setOpenGLFramebufferObject(quint32 fbo, const QSize &size) {
d_ptr->setOpenGLFramebufferObject(fbo, size);
}

/*!
Expand Down Expand Up @@ -1729,7 +1729,7 @@ void MapPrivate::render() {
m_mapRenderer->render();
}

void MapPrivate::setFramebufferObject(quint32 fbo, const QSize &size) {
void MapPrivate::setOpenGLFramebufferObject(quint32 fbo, const QSize &size) {
const std::lock_guard<std::recursive_mutex> lock(m_mapRendererMutex);

if (m_mapRenderer == nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class Q_MAPLIBRE_CORE_EXPORT Map : public QObject {
// should be called on the render thread.
void createRenderer();
void destroyRenderer();
void setFramebufferObject(quint32 fbo, const QSize &size);
void setOpenGLFramebufferObject(quint32 fbo, const QSize &size);

public slots:
void render();
Expand Down
2 changes: 1 addition & 1 deletion src/core/map_p.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MapPrivate : public QObject, public mbgl::RendererFrontend {
void createRenderer();
void destroyRenderer();
void render();
void setFramebufferObject(quint32 fbo, const QSize &size);
void setOpenGLFramebufferObject(quint32 fbo, const QSize &size);

using PropertySetter = std::optional<mbgl::style::conversion::Error> (mbgl::style::Layer::*)(
const std::string &, const mbgl::style::conversion::Convertible &);
Expand Down
2 changes: 1 addition & 1 deletion src/location/texture_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void TextureNode::resize(const QSize &size, qreal pixelRatio)
m_map->resize(minSize);

m_fbo = std::make_unique<QOpenGLFramebufferObject>(fbSize, QOpenGLFramebufferObject::CombinedDepthStencil);
m_map->setFramebufferObject(m_fbo->handle(), fbSize);
m_map->setOpenGLFramebufferObject(m_fbo->handle(), fbSize);

#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
setTexture(QNativeInterface::QSGOpenGLTexture::fromNative(
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/gl_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void GLWidget::initializeGL() {
*/
void GLWidget::paintGL() {
d_ptr->m_map->resize(size());
d_ptr->m_map->setFramebufferObject(defaultFramebufferObject(), size() * devicePixelRatioF());
d_ptr->m_map->setOpenGLFramebufferObject(defaultFramebufferObject(), size() * devicePixelRatioF());
d_ptr->m_map->render();
}

Expand Down
2 changes: 1 addition & 1 deletion test/core/map_tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MapTester::MapTester()
connect(&map, &Map::mapChanged, this, &MapTester::onMapChanged);
connect(&map, &Map::needsRendering, this, &MapTester::onNeedsRendering);
map.resize(size);
map.setFramebufferObject(widget.defaultFramebufferObject(), size);
map.setOpenGLFramebufferObject(widget.defaultFramebufferObject(), size);
map.setCoordinateZoom(Coordinate(60.170448, 24.942046), 14);
widget.show();
}
Expand Down

0 comments on commit 48b2e07

Please sign in to comment.