summaryrefslogtreecommitdiff
path: root/platform/glfw/glfw_view.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/glfw/glfw_view.cpp')
-rw-r--r--platform/glfw/glfw_view.cpp75
1 files changed, 0 insertions, 75 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index 82519e6ac2..cba3419672 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -720,78 +720,3 @@ void GLFWView::toggleCustomSource() {
mbgl::style::VisibilityType::None : mbgl::style::VisibilityType::Visible);
}
}
-
-namespace mbgl {
-namespace platform {
-
-#ifndef MBGL_USE_GLES2
-void showDebugImage(std::string name, const char *data, size_t width, size_t height) {
- glfwInit();
-
- static GLFWwindow *debugWindow = nullptr;
- if (!debugWindow) {
- debugWindow = glfwCreateWindow(static_cast<int>(width), static_cast<int>(height), name.c_str(), nullptr, nullptr);
- if (!debugWindow) {
- glfwTerminate();
- fprintf(stderr, "Failed to initialize window\n");
- exit(1);
- }
- }
-
- GLFWwindow *currentWindow = glfwGetCurrentContext();
-
- glfwSetWindowSize(debugWindow, static_cast<int>(width), static_cast<int>(height));
- glfwMakeContextCurrent(debugWindow);
-
- int fbWidth, fbHeight;
- glfwGetFramebufferSize(debugWindow, &fbWidth, &fbHeight);
- float scale = static_cast<float>(fbWidth) / static_cast<float>(width);
-
- glPixelZoom(scale, -scale);
- glRasterPos2f(-1.0f, 1.0f);
- glDrawPixels(width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE, data);
-
- glfwSwapBuffers(debugWindow);
-
- glfwMakeContextCurrent(currentWindow);
-}
-
-void showColorDebugImage(std::string name, const char *data, size_t logicalWidth, size_t logicalHeight, size_t width, size_t height) {
- glfwInit();
-
- static GLFWwindow *debugWindow = nullptr;
- if (!debugWindow) {
- debugWindow = glfwCreateWindow(static_cast<int>(logicalWidth), static_cast<int>(logicalHeight), name.c_str(), nullptr, nullptr);
- if (!debugWindow) {
- glfwTerminate();
- fprintf(stderr, "Failed to initialize window\n");
- exit(1);
- }
- }
-
- GLFWwindow *currentWindow = glfwGetCurrentContext();
-
- glfwSetWindowSize(debugWindow, static_cast<int>(logicalWidth), static_cast<int>(logicalHeight));
- glfwMakeContextCurrent(debugWindow);
-
- int fbWidth, fbHeight;
- glfwGetFramebufferSize(debugWindow, &fbWidth, &fbHeight);
- float xScale = static_cast<float>(fbWidth) / static_cast<float>(width);
- float yScale = static_cast<float>(fbHeight) / static_cast<float>(height);
-
- glClearColor(0.8, 0.8, 0.8, 1);
- glClear(GL_COLOR_BUFFER_BIT);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glPixelZoom(xScale, -yScale);
- glRasterPos2f(-1.0f, 1.0f);
- glDrawPixels(width, height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, data);
-
- glfwSwapBuffers(debugWindow);
-
- glfwMakeContextCurrent(currentWindow);
-}
-#endif
-
-} // namespace platform
-} // namespace mbgl