Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions samples/desktop/Tiny/Tiny.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <cstdio>
#include <stb/stb_image_write.h>
#include <igl/IGL.h>
#include <regex>

#define USE_OPENGL_BACKEND 0

Expand Down Expand Up @@ -190,15 +191,15 @@ static GLFWwindow* initIGL(bool isHeadless, bool enableVulkanValidationLayers) {
#if IGL_PLATFORM_WINDOWS
auto ctx = std::make_unique<igl::opengl::wgl::Context>(GetDC(glfwGetWin32Window(window)),
glfwGetWGLContext(window));
device_ = std::make_unique<igl::opengl::wgl::Device>(std::move(ctx));
device = std::make_unique<igl::opengl::wgl::Device>(std::move(ctx));
#elif IGL_PLATFORM_LINUX
auto ctx = std::make_unique<igl::opengl::glx::Context>(
nullptr,
glfwGetX11Display(),
(igl::opengl::glx::GLXDrawable)glfwGetX11Window(window),
(igl::opengl::glx::GLXContext)glfwGetGLXContext(window));

device_ = std::make_unique<igl::opengl::glx::Device>(std::move(ctx));
device = std::make_unique<igl::opengl::glx::Device>(std::move(ctx));
#endif
#else
const igl::vulkan::VulkanContextConfig cfg{
Expand Down Expand Up @@ -298,13 +299,13 @@ static std::shared_ptr<ITexture> getNativeDrawable() {
std::shared_ptr<ITexture> drawable;
#if USE_OPENGL_BACKEND
#if IGL_PLATFORM_WINDOWS
const auto& platformDevice = device_->getPlatformDevice<opengl::wgl::PlatformDevice>();
const auto& platformDevice = device->getPlatformDevice<opengl::wgl::PlatformDevice>();
IGL_DEBUG_ASSERT(platformDevice != nullptr);
drawable = platformDevice->createTextureFromNativeDrawable(&ret);
#elif IGL_PLATFORM_LINUX
const auto& platformDevice = device_->getPlatformDevice<opengl::glx::PlatformDevice>();
const auto& platformDevice = device->getPlatformDevice<opengl::glx::PlatformDevice>();
IGL_DEBUG_ASSERT(platformDevice != nullptr);
drawable = platformDevice->createTextureFromNativeDrawable(width_, height_, &ret);
drawable = platformDevice->createTextureFromNativeDrawable(width, height, &ret);
#endif
#else
const auto& platformDevice = device->getPlatformDevice<igl::vulkan::PlatformDevice>();
Expand Down
Loading
Loading