michael@0: // michael@0: // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: #include "compiler/TranslatorGLSL.h" michael@0: #include "compiler/TranslatorESSL.h" michael@0: michael@0: // michael@0: // This function must be provided to create the actual michael@0: // compile object used by higher level code. It returns michael@0: // a subclass of TCompiler. michael@0: // michael@0: TCompiler* ConstructCompiler( michael@0: ShShaderType type, ShShaderSpec spec, ShShaderOutput output) michael@0: { michael@0: switch (output) { michael@0: case SH_GLSL_OUTPUT: michael@0: return new TranslatorGLSL(type, spec); michael@0: case SH_ESSL_OUTPUT: michael@0: return new TranslatorESSL(type, spec); michael@0: default: michael@0: return NULL; michael@0: } michael@0: } michael@0: michael@0: // michael@0: // Delete the compiler made by ConstructCompiler michael@0: // michael@0: void DeleteCompiler(TCompiler* compiler) michael@0: { michael@0: delete compiler; michael@0: }