@@ -148,7 +148,7 @@ pub struct NativeContext(pub HGLRC);
148
148
thread_local ! {
149
149
static OPENGL_LIBRARY : HMODULE = {
150
150
unsafe {
151
- libloaderapi:: LoadLibraryA ( & c"opengl32.dll" [ 0 ] as * const u8 as LPCSTR )
151
+ libloaderapi:: LoadLibraryA ( c"opengl32.dll" . as_ptr ( ) )
152
152
}
153
153
} ;
154
154
}
@@ -640,7 +640,7 @@ impl NativeContext {
640
640
fn extension_loader_thread ( ) -> WGLExtensionFunctions {
641
641
unsafe {
642
642
let instance = libloaderapi:: GetModuleHandleA ( ptr:: null_mut ( ) ) ;
643
- let window_class_name = & c"SurfmanFalseWindow" [ 0 ] as * const u8 as LPCSTR ;
643
+ let window_class_name = & c"SurfmanFalseWindow" . as_ptr ( ) ;
644
644
let window_class = WNDCLASSA {
645
645
style : CS_OWNDC ,
646
646
lpfnWndProc : Some ( extension_loader_window_proc) ,
@@ -733,7 +733,7 @@ extern "system" fn extension_loader_window_proc(
733
733
let wgl_extension_functions =
734
734
( * create_struct) . lpCreateParams as * mut WGLExtensionFunctions ;
735
735
( * wgl_extension_functions) . GetExtensionsStringARB = mem:: transmute (
736
- wglGetProcAddress ( & c"wglGetExtensionsStringARB" [ 0 ] as * const u8 as LPCSTR ) ,
736
+ wglGetProcAddress ( & c"wglGetExtensionsStringARB" . as_ptr ( ) ) ,
737
737
) ;
738
738
let extensions = match ( * wgl_extension_functions) . GetExtensionsStringARB {
739
739
Some ( wglGetExtensionsStringARB) => {
@@ -748,44 +748,44 @@ extern "system" fn extension_loader_window_proc(
748
748
( * wgl_extension_functions) . pixel_format_functions =
749
749
Some ( WGLPixelFormatExtensionFunctions {
750
750
ChoosePixelFormatARB : mem:: transmute ( wglGetProcAddress (
751
- & c"wglChoosePixelFormatARB" [ 0 ] as * const u8 as LPCSTR ,
751
+ & c"wglChoosePixelFormatARB" . as_ptr ( ) ,
752
752
) ) ,
753
753
GetPixelFormatAttribivARB : mem:: transmute ( wglGetProcAddress (
754
- & c"wglGetPixelFormatAttribivARB" [ 0 ] as * const u8 as LPCSTR ,
754
+ & c"wglGetPixelFormatAttribivARB" . as_ptr ( ) ,
755
755
) ) ,
756
756
} ) ;
757
757
continue ;
758
758
}
759
759
if extension == "WGL_ARB_create_context" {
760
760
( * wgl_extension_functions) . CreateContextAttribsARB =
761
761
mem:: transmute ( wglGetProcAddress (
762
- & c"wglCreateContextAttribsARB" [ 0 ] as * const u8 as LPCSTR ,
762
+ & c"wglCreateContextAttribsARB" . as_ptr ( ) ,
763
763
) ) ;
764
764
continue ;
765
765
}
766
766
if extension == "WGL_NV_DX_interop" {
767
767
( * wgl_extension_functions) . dx_interop_functions =
768
768
Some ( WGLDXInteropExtensionFunctions {
769
769
DXCloseDeviceNV : mem:: transmute ( wglGetProcAddress (
770
- & c"wglDXCloseDeviceNV" [ 0 ] as * const u8 as LPCSTR ,
770
+ & c"wglDXCloseDeviceNV" . as_ptr ( ) ,
771
771
) ) ,
772
772
DXLockObjectsNV : mem:: transmute ( wglGetProcAddress (
773
- & c"wglDXLockObjectsNV" [ 0 ] as * const u8 as LPCSTR ,
773
+ & c"wglDXLockObjectsNV" . as_ptr ( ) ,
774
774
) ) ,
775
775
DXOpenDeviceNV : mem:: transmute ( wglGetProcAddress (
776
- & c"wglDXOpenDeviceNV" [ 0 ] as * const u8 as LPCSTR ,
776
+ & c"wglDXOpenDeviceNV" . as_ptr ( ) ,
777
777
) ) ,
778
778
DXRegisterObjectNV : mem:: transmute ( wglGetProcAddress (
779
- & c"wglDXRegisterObjectNV" [ 0 ] as * const u8 as LPCSTR ,
779
+ & c"wglDXRegisterObjectNV" . as_ptr ( ) ,
780
780
) ) ,
781
781
DXSetResourceShareHandleNV : mem:: transmute ( wglGetProcAddress (
782
- & c"wglDXSetResourceShareHandleNV" [ 0 ] as * const u8 as LPCSTR ,
782
+ & c"wglDXSetResourceShareHandleNV" . as_ptr ( ) ,
783
783
) ) ,
784
784
DXUnlockObjectsNV : mem:: transmute ( wglGetProcAddress (
785
- & c"wglDXUnlockObjectsNV" [ 0 ] as * const u8 as LPCSTR ,
785
+ & c"wglDXUnlockObjectsNV" . as_ptr ( ) ,
786
786
) ) ,
787
787
DXUnregisterObjectNV : mem:: transmute ( wglGetProcAddress (
788
- & c"wglDXUnregisterObjectNV" [ 0 ] as * const u8 as LPCSTR ,
788
+ & c"wglDXUnregisterObjectNV" . as_ptr ( ) ,
789
789
) ) ,
790
790
} ) ;
791
791
continue ;
0 commit comments