Improve variable names in jaggl_bootstrap_proc_table

master
Graham 5 years ago
parent a5c9851031
commit 7386fdc862
  1. 26
      gl-natives/src/main/c/jaggl.c

@ -228,17 +228,17 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
} }
static void jaggl_bootstrap_proc_table(void) { static void jaggl_bootstrap_proc_table(void) {
WNDCLASS c = { WNDCLASS class = {
.lpfnWndProc = DefWindowProc, .lpfnWndProc = DefWindowProc,
.hInstance = jaggl_instance, .hInstance = jaggl_instance,
.lpszClassName = "OpenRS2" .lpszClassName = "OpenRS2"
}; };
ATOM class_atom = RegisterClass(&c); ATOM class_atom = RegisterClass(&class);
if (!class_atom) { if (!class_atom) {
return; return;
} }
HWND hwnd = CreateWindow( HWND window = CreateWindow(
MAKEINTATOM(class_atom), MAKEINTATOM(class_atom),
"OpenRS2", "OpenRS2",
0, 0,
@ -251,12 +251,12 @@ static void jaggl_bootstrap_proc_table(void) {
jaggl_instance, jaggl_instance,
NULL NULL
); );
if (!hwnd) { if (!window) {
goto destroy_class; goto destroy_class;
} }
HDC hdc = GetDC(hwnd); HDC device = GetDC(window);
if (!hdc) { if (!device) {
goto destroy_window; goto destroy_window;
} }
@ -272,33 +272,33 @@ static void jaggl_bootstrap_proc_table(void) {
.cDepthBits = 24, .cDepthBits = 24,
.iLayerType = PFD_MAIN_PLANE .iLayerType = PFD_MAIN_PLANE
}; };
int format = ChoosePixelFormat(hdc, &pfd); int format = ChoosePixelFormat(device, &pfd);
if (!format) { if (!format) {
goto destroy_device; goto destroy_device;
} }
if (!SetPixelFormat(hdc, format, &pfd)) { if (!SetPixelFormat(device, format, &pfd)) {
goto destroy_device; goto destroy_device;
} }
HGLRC context = wglCreateContext(hdc); HGLRC context = wglCreateContext(device);
if (!context) { if (!context) {
goto destroy_device; goto destroy_device;
} }
if (!wglMakeCurrent(hdc, context)) { if (!wglMakeCurrent(device, context)) {
goto destroy_context; goto destroy_context;
} }
jaggl_init_proc_table(); jaggl_init_proc_table();
destroy_context: destroy_context:
wglMakeCurrent(hdc, NULL); wglMakeCurrent(device, NULL);
wglDeleteContext(context); wglDeleteContext(context);
destroy_device: destroy_device:
ReleaseDC(hwnd, hdc); ReleaseDC(window, device);
destroy_window: destroy_window:
DestroyWindow(hwnd); DestroyWindow(window);
destroy_class: destroy_class:
UnregisterClass(MAKEINTATOM(class_atom), jaggl_instance); UnregisterClass(MAKEINTATOM(class_atom), jaggl_instance);
} }

Loading…
Cancel
Save