| 847 | } |
| 848 | |
| 849 | int main(int argc, const char *argv[]) |
| 850 | { |
| 851 | MSG msg; |
| 852 | HINSTANCE hInst = GetModuleHandle(NULL); |
| 853 | setHightDPI(); |
| 854 | |
| 855 | (void)argc; |
| 856 | (void)argv; |
| 857 | |
| 858 | if(!iniLoad("softgpu.ini")) |
| 859 | { |
| 860 | MessageBoxA(NULL, "Can't load configuration file softgpu.ini!", "Configuration error!", MB_ICONSTOP); |
| 861 | return 1; |
| 862 | } |
| 863 | |
| 864 | WNDCLASS wc_loading; |
| 865 | memset(&wc_loading, 0, sizeof(wc_loading)); |
| 866 | |
| 867 | wc_loading.style = CS_HREDRAW | CS_VREDRAW; |
| 868 | wc_loading.lpfnWndProc = softgpuLoadingProc; |
| 869 | wc_loading.lpszClassName = WND_SOFTGPU_LOAD_CLASS_NAME; |
| 870 | wc_loading.hbrBackground = GetSysColorBrush(COLOR_3DFACE); |
| 871 | wc_loading.hCursor = LoadCursor(0, IDC_WAIT); |
| 872 | wc_loading.hIcon = LoadIconA(hInst, MAKEINTRESOURCE(SOFTGPU_ICON1)); |
| 873 | wc_loading.hInstance = hInst; |
| 874 | RegisterClass(&wc_loading); |
| 875 | |
| 876 | DWORD threadId; |
| 877 | HANDLE win_loading_th = CreateThread(NULL, 0, softgpuLoadingThread, NULL, 0, &threadId); |
| 878 | |
| 879 | hasSETUPAPI = loadSETUAPI(); |
| 880 | if(hasSETUPAPI) |
| 881 | { |
| 882 | checkInstallation(); |
| 883 | } |
| 884 | |
| 885 | /* load system informations */ |
| 886 | softgpu_sysinfo(); |
| 887 | check_SW_HW(); |
| 888 | |
| 889 | if(win_loading_th != INVALID_HANDLE_VALUE) |
| 890 | { |
| 891 | /* destroy loading window */ |
| 892 | PostThreadMessage(threadId, WM_DESTROY, 0, 0); |
| 893 | |
| 894 | /* wait loading win thread to close... */ |
| 895 | if(WaitForSingleObject(win_loading_th, 1000) == WAIT_TIMEOUT) |
| 896 | { |
| 897 | TerminateThread(win_loading_th, 0); |
| 898 | } |
| 899 | CloseHandle(win_loading_th); |
| 900 | } |
| 901 | |
| 902 | // Register the window class. |
| 903 | WNDCLASS wc, wc2; |
| 904 | memset(&wc, 0, sizeof(WNDCLASS)); |
| 905 | memset(&wc2, 0, sizeof(WNDCLASS)); |
| 906 |
nothing calls this directly
no test coverage detected