fill in the rest of the GL functions. finally

This commit is contained in:
jp9000
2013-10-12 20:18:05 -07:00
parent e591256922
commit 9577ddcf9b
12 changed files with 329 additions and 30 deletions

View File

@@ -427,3 +427,34 @@ void gl_windowinfo_destroy(struct gl_windowinfo *wi)
bfree(wi);
}
}
void device_load_swapchain(device_t device, swapchain_t swap)
{
HDC hdc = device->plat->swap.wi->hdc;
if (device->cur_swap == swap)
return;
device->cur_swap = swap;
if (swap)
hdc = swap->wi->hdc;
if (!wglMakeCurrent(hdc, device->plat->hrc)) {
blog(LOG_ERROR, "wglMakeCurrent failed, GetLastError "
"returned %u", GetLastError());
blog(LOG_ERROR, "device_load_swapchain (GL) failed");
}
}
void device_present(device_t device)
{
HDC hdc = device->plat->swap.wi->hdc;
if (device->cur_swap)
hdc = device->cur_swap->wi->hdc;
if (!SwapBuffers(hdc)) {
blog(LOG_ERROR, "SwapBuffers failed, GetLastError "
"returned %u", GetLastError());
blog(LOG_ERROR, "device_present (GL) failed");
}
}