This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // based on https://gist.github.com/kamino410/09df4ecdf37b03cbd05752a7b2e52d3a | |
| // this adds ImGui to an application with CUDA and OpenGL. the thing is, once you use CUDA, ImGui renders very strangely. | |
| // after 9 hours of debugging I found that putting glBindBuffer before and after the draw call fixes this! | |
| //glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo); // THE MAGIC LINE #1 | |
| //glDrawPixels(WIDTH, HEIGHT, GL_RGBA, GL_UNSIGNED_BYTE, 0); | |
| //glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); // THE MAGIC LINE #2 | |
| #include "imgui/imgui.h" // version 1.78 and 1.60 | |
| #include "imgui/imgui_impl_glfw.h" |