Hot answers tagged

4

First you need to render you scene to a Frame Buffer Object (here is a good course on FBO: https://learnopengl.com/#!Advanced-OpenGL/Framebuffers) After that you will end up with a Texture (of type GLuint) containing your rendered scene. To print it into Dear imGUI, just call a Draw Image Command. EDIT New (simpler) Example: ImGui::Begin("GameWindow&...


2

In essence, You need to make sure that the style that is used has wordwrap set to true. The problem with what you tried is that the style you edited isn't used by the TextArea. Which style is used is actually a weird one, as I expected EditorStyles.textArea but for some reason, unity uses EditorStyles.textField as the default style instead...(which has ...


2

The problem is though that this binding has encapsulated the input callbacks in a global .cpp file which makes it impossible to access for other classes. The imgui+GLFW backends have callback exposed in the imgui_impl_glfw_xxx.h file: void ImGui_ImplGlfwGL3_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods); void ...


1

It was a "rounding error". When you encounter similar bug then make sure your ImGui window/Image inside window are on rounded position. In my case "float x" variable was 39.5f and when I ceiled it everything was rendered correctly. Also you can check if your image size translates to the integer factor (e.g. it's drawn at 1x, 2x, 3x etc. ...


1

As noted in my comment, it could be a rasterization/sub-pixel issue. The line thickness is small enough that during the rasterization process the lines end up between the pixels and are being discarded. Try increasing the line thickness to see if that fixes the problem.


1

The Cherno on YouTube did something similar for his Scene Viewport in his Game Engine series. It's written in C++/OpenGL/ImGui, but it's easily translated. From a high level, you need to create a viewport panel/window that you draw to as a "Scene Viewport".


1

Move these lines inside the while loop. unsigned int fbo; glGenFramebuffers(1, &fbo); glBindFramebuffer(GL_FRAMEBUFFER, fbo); GLuint TOF; glGenTextures(1, &TOF); glBindTexture(GL_TEXTURE_2D, TOF); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 400, 300, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); ...


Only top voted, non community-wiki answers of a minimum length are eligible