void init() { glewInit(); // Initialize GL glClearColor(0.6, 0.6, 0.6, 0); glClearDepth(1.0f); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); glShadeModel(GL_SMOOTH); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glActiveTexture(GL_TEXTURE0); glEnable(GL_TEXTURE_2D); // Initialize the rest of the app world_initialize(128, 128); heightmap_initialize(); font_initialize(); player_initialize(); textures_initialize(); materials_initialize(60.0f * WORLD_SCALE); environment_initialize(60.0f * WORLD_SCALE); }
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; HWND hWnd; HACCEL hAccelTable; WSADATA wsaData; WSAStartup(0x101, &wsaData); LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); MyRegisterClass(hInstance); NPPRegisterEmbed(hInstance); hWnd = CreateWindow(NPGeckoWindow, szTitle, WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_W32); char *url = GetCommandLine(); while (url[0] != ' ' || url[1] == ' ') { if (url[0] == 0) break; url++; } if ( NPPluginLoad("NPSWF32.DLL") ) { MessageBox(hWnd, "NPSWF32.DLL ¼ÓÔØʧ°Ü", "Flash Flv tool", MB_ICONSTOP); return -1; } player_initialize(); NPPluginInitialize(hWnd); NPPluginExec(url + 1); ProvideRPCCall(hWnd); while (GetMessage(&msg, NULL, 0, 0)) { if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } NPPluginShutdown(); player_cleanup(); WSACleanup(); return msg.wParam; }