if(g_pVertexShaderBlob==NULL)// NB: Pass ID3D10Blob* pErrorBlob to D3DCompile() to get error showing in (const char*)pErrorBlob->GetBufferPointer(). Make sure to Release() the blob!
if(g_pPixelShaderBlob==NULL)// NB: Pass ID3D10Blob* pErrorBlob to D3DCompile() to get error showing in (const char*)pErrorBlob->GetBufferPointer(). Make sure to Release() the blob!
mousePosScale.x=(float)display_w/w;// Some screens e.g. Retina display have framebuffer size != from window size, and mouse inputs are given in window/screen coordinates.
mousePosScale.x=(float)display_w/w;// Some screens e.g. Retina display have framebuffer size != from window size, and mouse inputs are given in window/screen coordinates.
mousePosScale.y=(float)display_h/h;
ImGuiIO&io=ImGui::GetIO();
io.DisplaySize=ImVec2((float)display_w,(float)display_h);// Display size, in pixels. For clamping windows positions.
@ -302,9 +302,9 @@ void UpdateImGui()
// (we already got mouse wheel, keyboard keys & characters from glfw callbacks polled in glfwPollEvents())
doublemouse_x,mouse_y;
glfwGetCursorPos(window,&mouse_x,&mouse_y);
io.MousePos=ImVec2((float)mouse_x*mousePosScale.x,(float)mouse_y*mousePosScale.y);// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
io.MouseDown[0]=mousePressed[0]||glfwGetMouseButton(window,GLFW_MOUSE_BUTTON_LEFT)!=0;// If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.
io.MousePos=ImVec2((float)mouse_x*mousePosScale.x,(float)mouse_y*mousePosScale.y);// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
io.MouseDown[0]=mousePressed[0]||glfwGetMouseButton(window,GLFW_MOUSE_BUTTON_LEFT)!=0;// If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.
// 3. Show the ImGui test window. Most of the sample code is in ImGui::ShowTestWindow()
if(show_test_window)
{
ImGui::SetNewWindowDefaultPos(ImVec2(650,20));// Normally user code doesn't need/want to call this, because positions are saved in .ini file. Here we just want to make the demo initial state a bit more friendly!
ImGui::ShowTestWindow(&show_test_window);
}
// Rendering
staticboolshow_test_window=true;
staticboolshow_another_window=false;
// 1. Show a simple window
// Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug"
// 3. Show the ImGui test window. Most of the sample code is in ImGui::ShowTestWindow()
if(show_test_window)
{
ImGui::SetNewWindowDefaultPos(ImVec2(650,20));// Normally user code doesn't need/want to call this, because positions are saved in .ini file. Here we just want to make the demo initial state a bit more friendly!