mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-18 06:06:35 +00:00
Examples: Terser code + added commented out glUseProgram(0( suggestion in OpenGL2 sample.
This commit is contained in:
parent
136dbdfd95
commit
ed94edfd8e
@ -352,15 +352,7 @@ void ImGui_ImplGlfwGL3_NewFrame()
|
|||||||
g_MouseWheel = 0.0f;
|
g_MouseWheel = 0.0f;
|
||||||
|
|
||||||
// Hide/show hardware mouse cursor
|
// Hide/show hardware mouse cursor
|
||||||
if (io.MouseDrawCursor)
|
glfwSetInputMode(g_Window, GLFW_CURSOR, io.MouseDrawCursor ? GLFW_CURSOR_HIDDEN : GLFW_CURSOR_NORMAL);
|
||||||
{
|
|
||||||
// imgui draws cursor itself
|
|
||||||
glfwSetInputMode(g_Window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
glfwSetInputMode(g_Window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start the frame
|
// Start the frame
|
||||||
ImGui::NewFrame();
|
ImGui::NewFrame();
|
||||||
|
@ -41,6 +41,7 @@ static void ImGui_ImplGlfw_RenderDrawLists(ImDrawList** const cmd_lists, int cmd
|
|||||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
glEnableClientState(GL_COLOR_ARRAY);
|
glEnableClientState(GL_COLOR_ARRAY);
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
//glUseProgram(0); // You may want this if using this code in an OpenGL 3+ context
|
||||||
|
|
||||||
// Setup orthographic projection matrix
|
// Setup orthographic projection matrix
|
||||||
const float width = ImGui::GetIO().DisplaySize.x;
|
const float width = ImGui::GetIO().DisplaySize.x;
|
||||||
@ -256,15 +257,7 @@ void ImGui_ImplGlfw_NewFrame()
|
|||||||
g_MouseWheel = 0.0f;
|
g_MouseWheel = 0.0f;
|
||||||
|
|
||||||
// Hide/show hardware mouse cursor
|
// Hide/show hardware mouse cursor
|
||||||
if (io.MouseDrawCursor)
|
glfwSetInputMode(g_Window, GLFW_CURSOR, io.MouseDrawCursor ? GLFW_CURSOR_HIDDEN : GLFW_CURSOR_NORMAL);
|
||||||
{
|
|
||||||
// imgui draws cursor itself
|
|
||||||
glfwSetInputMode(g_Window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
glfwSetInputMode(g_Window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start the frame
|
// Start the frame
|
||||||
ImGui::NewFrame();
|
ImGui::NewFrame();
|
||||||
|
Loading…
Reference in New Issue
Block a user