mirror of
				https://github.com/ocornut/imgui.git
				synced 2025-11-04 01:34:32 +00:00 
			
		
		
		
	This commit is contained in:
		@@ -38,9 +38,9 @@ int main(int, char**)
 | 
			
		||||
{
 | 
			
		||||
    // Create application window
 | 
			
		||||
    //ImGui_ImplWin32_EnableDpiAwareness();
 | 
			
		||||
    WNDCLASSEXW wc = { sizeof(wc), CS_OWNDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, L"ImGui Example", NULL };
 | 
			
		||||
    WNDCLASSEXW wc = { sizeof(wc), CS_OWNDC, WndProc, 0L, 0L, GetModuleHandle(nullptr), nullptr, nullptr, nullptr, nullptr, L"ImGui Example", nullptr };
 | 
			
		||||
    ::RegisterClassExW(&wc);
 | 
			
		||||
    HWND hwnd = ::CreateWindowW(wc.lpszClassName, L"Dear ImGui Win32+OpenGL3 Example", WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, NULL, NULL, wc.hInstance, NULL);
 | 
			
		||||
    HWND hwnd = ::CreateWindowW(wc.lpszClassName, L"Dear ImGui Win32+OpenGL3 Example", WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, nullptr, nullptr, wc.hInstance, nullptr);
 | 
			
		||||
 | 
			
		||||
    // Initialize OpenGL
 | 
			
		||||
    if (!CreateDeviceWGL(hwnd, &g_MainWindow))
 | 
			
		||||
@@ -74,7 +74,7 @@ int main(int, char**)
 | 
			
		||||
    // Load Fonts
 | 
			
		||||
    // - If no fonts are loaded, dear imgui will use the default font. You can also load multiple fonts and use ImGui::PushFont()/PopFont() to select them.
 | 
			
		||||
    // - AddFontFromFileTTF() will return the ImFont* so you can store it if you need to select the font among multiple.
 | 
			
		||||
    // - If the file cannot be loaded, the function will return NULL. Please handle those errors in your application (e.g. use an assertion, or display an error and quit).
 | 
			
		||||
    // - If the file cannot be loaded, the function will return a nullptr. Please handle those errors in your application (e.g. use an assertion, or display an error and quit).
 | 
			
		||||
    // - The fonts will be rasterized at a given size (w/ oversampling) and stored into a texture when calling ImFontAtlas::Build()/GetTexDataAsXXXX(), which ImGui_ImplXXXX_NewFrame below will call.
 | 
			
		||||
    // - Use '#define IMGUI_ENABLE_FREETYPE' in your imconfig file to use Freetype for higher quality font rendering.
 | 
			
		||||
    // - Read 'docs/FONTS.md' for more instructions and details.
 | 
			
		||||
@@ -84,8 +84,8 @@ int main(int, char**)
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../misc/fonts/DroidSans.ttf", 16.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf", 16.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf", 15.0f);
 | 
			
		||||
    //ImFont* font = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
 | 
			
		||||
    //IM_ASSERT(font != NULL);
 | 
			
		||||
    //ImFont* font = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, nullptr, io.Fonts->GetGlyphRangesJapanese());
 | 
			
		||||
    //IM_ASSERT(font != nullptr);
 | 
			
		||||
 | 
			
		||||
    // Our state
 | 
			
		||||
    bool show_demo_window = true;
 | 
			
		||||
@@ -99,7 +99,7 @@ int main(int, char**)
 | 
			
		||||
        // Poll and handle messages (inputs, window resize, etc.)
 | 
			
		||||
        // See the WndProc() function below for our to dispatch events to the Win32 backend.
 | 
			
		||||
        MSG msg;
 | 
			
		||||
        while (::PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
 | 
			
		||||
        while (::PeekMessage(&msg, nullptr, 0U, 0U, PM_REMOVE))
 | 
			
		||||
        {
 | 
			
		||||
            ::TranslateMessage(&msg);
 | 
			
		||||
            ::DispatchMessage(&msg);
 | 
			
		||||
@@ -200,7 +200,7 @@ bool CreateDeviceWGL(HWND hWnd, WGL_WindowData* data)
 | 
			
		||||
 | 
			
		||||
void CleanupDeviceWGL(HWND hWnd, WGL_WindowData* data)
 | 
			
		||||
{
 | 
			
		||||
    wglMakeCurrent(NULL, NULL);
 | 
			
		||||
    wglMakeCurrent(nullptr, nullptr);
 | 
			
		||||
    ::ReleaseDC(hWnd, data->hDC);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user