When I run this code:
window_handle = CreateWindow("OpenGL", title, style, 0, 0, width, height, NULL, NULL, window_instance, NULL);
if (!window_handle)
{
GL_KillWindow ();
MessageBox (NULL, "Window creation error", "ERROR", MB_OK | MB_ICONEXCLAMATION);
return false;
}
CreateWindow returns NULL. What are the reasons that could cause CreateWindow to fail?
When I use GetLastError (), it returns 1400 which means "Invalid window handle", how could I fix this?