void LoadVorbisLibraries() { static bool bIsIntialized = false; if (!bIsIntialized) { bIsIntialized = true; #if PLATFORM_WINDOWS && WITH_OGGVORBIS //@todo if ogg is every ported to another platform, then use the platform abstraction to load these DLLs // Load the Ogg dlls FString VSVersion = TEXT("VS2013/"); FString PlatformString = TEXT("Win32"); FString DLLNameStub = TEXT(".dll"); #if _MSC_VER == 1900 VSVersion = TEXT("VS2015/"); #endif #if PLATFORM_64BITS PlatformString = TEXT("Win64"); DLLNameStub = TEXT("_64.dll"); #endif FString RootOggPath = FPaths::EngineDir() / TEXT("Binaries/ThirdParty/Ogg/") / PlatformString / VSVersion; FString RootVorbisPath = FPaths::EngineDir() / TEXT("Binaries/ThirdParty/Vorbis/") / PlatformString / VSVersion; FString DLLToLoad = RootOggPath + TEXT("libogg") + DLLNameStub; verifyf(LoadLibraryW(*DLLToLoad), TEXT("Failed to load DLL %s"), *DLLToLoad); // Load the Vorbis dlls DLLToLoad = RootVorbisPath + TEXT("libvorbis") + DLLNameStub; verifyf(LoadLibraryW(*DLLToLoad), TEXT("Failed to load DLL %s"), *DLLToLoad); DLLToLoad = RootVorbisPath + TEXT("libvorbisfile") + DLLNameStub; verifyf(LoadLibraryW(*DLLToLoad), TEXT("Failed to load DLL %s"), *DLLToLoad); #endif //PLATFORM_WINDOWS } }
static void PlatformOpenGLVersionFromCommandLine(int& OutMajorVersion, int& OutMinorVersion) { if(PlatformOpenGL3()) { OutMajorVersion = 3; OutMinorVersion = 2; } else if (PlatformOpenGL4()) { OutMajorVersion = 4; OutMinorVersion = 3; } else { verifyf(false, TEXT("OpenGLRHI initialized with invalid command line, must be one of: -opengl, -opengl3, -opengl4")); } }
virtual void CompileShader(FName Format, const struct FShaderCompilerInput& Input, struct FShaderCompilerOutput& Output,const FString& WorkingDirectory) const override { CheckFormat(Format); if (Format == NAME_GLSL_150) { CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_150); } else if (Format == NAME_GLSL_150_MAC) { CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_150_MAC); } else if (Format == NAME_GLSL_430) { CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_430); } else if (Format == NAME_GLSL_ES2) { CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_ES2); if (Input.DumpDebugInfoPath != TEXT("") && IFileManager::Get().DirectoryExists(*Input.DumpDebugInfoPath)) { FShaderCompilerInput ES2Input = Input; ES2Input.DumpDebugInfoPath = ES2Input.DumpDebugInfoPath.Replace(TEXT("GLSL_150_ES2"), TEXT("GLSL_ES2"), ESearchCase::CaseSensitive); if (!IFileManager::Get().DirectoryExists(*ES2Input.DumpDebugInfoPath)) { verifyf(IFileManager::Get().MakeDirectory(*ES2Input.DumpDebugInfoPath, true), TEXT("Failed to create directory for shader debug info '%s'"), *ES2Input.DumpDebugInfoPath); } FShaderCompilerOutput ES2Output; CompileShader_Windows_OGL(ES2Input, ES2Output, WorkingDirectory, GLSL_ES2); } } else if (Format == NAME_GLSL_ES2_WEBGL ) { CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_ES2_WEBGL); } else if (Format == NAME_GLSL_ES2_IOS ) { CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_ES2_IOS); } else if (Format == NAME_GLSL_150_ES3_1) { CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_150_ES3_1); } else if (Format == NAME_GLSL_150_ES2_NOUB) { CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_150_ES2_NOUB); } else if (Format == NAME_GLSL_150_ES2) { CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_150_ES2); if (Input.DumpDebugInfoPath != TEXT("") && IFileManager::Get().DirectoryExists(*Input.DumpDebugInfoPath)) { FShaderCompilerInput ES2Input = Input; ES2Input.DumpDebugInfoPath = ES2Input.DumpDebugInfoPath.Replace(TEXT("GLSL_150_ES2"), TEXT("GLSL_ES2_150"), ESearchCase::CaseSensitive); if (!IFileManager::Get().DirectoryExists(*ES2Input.DumpDebugInfoPath)) { verifyf(IFileManager::Get().MakeDirectory(*ES2Input.DumpDebugInfoPath, true), TEXT("Failed to create directory for shader debug info '%s'"), *ES2Input.DumpDebugInfoPath); } FShaderCompilerOutput ES2Output; CompileShader_Windows_OGL(ES2Input, ES2Output, WorkingDirectory, GLSL_ES2); } } else if (Format == NAME_GLSL_310_ES_EXT) { CompileShader_Windows_OGL(Input, Output, WorkingDirectory, GLSL_310_ES_EXT); } else { check(0); } }