Skip to content

Commit 1783bfb

Browse files
authored
Code cleanup
Code cleanup
1 parent 2a60b89 commit 1783bfb

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

egui-opengl-internal/src/app.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
use std::ffi::{c_void, OsString};
1+
use std::ffi::c_void;
22
use crate::{input::InputCollector, painter, utils};
33
use clipboard::{windows_clipboard::WindowsClipboardContext, ClipboardProvider};
4-
use egui::{Context, FontData, FontDefinitions, FontFamily, FontId};
4+
use egui::{Context, FontData, FontDefinitions, FontId};
55
use once_cell::sync::OnceCell;
66
use std::ops::DerefMut;
77
use std::path::PathBuf;
8-
use std::sync::Arc;
98
use egui::FontFamily::Proportional;
109
use egui::TextStyle::{Body, Button, Heading, Monospace, Name, Small};
1110
use windows::Win32::{
@@ -35,8 +34,7 @@ use parking_lot::{Mutex, MutexGuard};
3534
use spin::lock_api::{Mutex, MutexGuard};
3635

3736
use lock_api::MappedMutexGuard;
38-
use windows::Win32::Foundation::HINSTANCE;
39-
use windows::Win32::UI::WindowsAndMessaging::{WM_CHAR, WM_UNICHAR};
37+
4038

4139
/// Heart and soul of this integration.
4240
/// Main methods you are going to use are:

example-wnd/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ extern "system" fn DllMain(hinst: usize, reason: u32, _reserved: *mut c_void) ->
5050
unsafe {
5151
WglSwapBuffersHook.disable().unwrap();
5252
let wnd_proc = OLD_WND_PROC.unwrap().unwrap();
53-
let _: Option<WNDPROC> = Some(transmute::<i32,
54-
Option<unsafe extern "system"
55-
fn(HWND, u32, WPARAM, LPARAM) -> LRESULT>>(
53+
let _: Option<WNDPROC> = Some(transmute(
5654
SetWindowLongPtrW(
5755
APP.get_window(),
5856
GWLP_WNDPROC,
@@ -86,8 +84,7 @@ fn hk_wgl_swap_buffers(hdc: HDC) -> HRESULT {
8684

8785
APP.init_default(hdc, window, ui);
8886

89-
OLD_WND_PROC = Some(transmute::<i32, Option<unsafe extern "system"
90-
fn(HWND, u32, WPARAM, LPARAM) -> LRESULT>>(
87+
OLD_WND_PROC = Some(transmute(
9188
SetWindowLongPtrW(
9289
window,
9390
GWLP_WNDPROC,

0 commit comments

Comments
 (0)