Files
bullet3/ObsoleteDemos/NativeClient/shader_util.h
erwin coumans 69e5454d18 Add the old Bullet 2.x obsolete demos, and CMake buildsystem files, and gradually move them to newer Bullet 3.x structure
Use statically linked freeglut, instead of dynamic glut for the obsolete Bullet 2.x demos
Add the 'reset' method to b3GpuDynamicsWorld, and use it in the BasicGpuDemo (pretty slow in debug mode, use release mode)
Don't crash in btCollisionWorld, if there is no collision dispatcher
2013-12-19 12:40:59 -08:00

30 lines
1.2 KiB
C++

// Copyright (c) 2011 The Native Client Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Some simple helper functions that load shaders and create program objects.
#ifndef EXAMPLES_TUMBLER_SHADER_UTIL_H_
#define EXAMPLES_TUMBLER_SHADER_UTIL_H_
#include <GLES2/gl2.h>
namespace shader_util {
// Load and compile a shader. |type| can be one of GL_VERTEX_SHADER or
// GL_FRAGMENT_SHADER. Returns a non-0 value representing the compiled
// shader on success, 0 on failure. The caller is responsible for deleting
// the returned shader using glDeleteShader().
GLuint CreateShaderOfType(GLenum type, const char *shader_src);
// Load and compile the vertex and fragment shaders, then link these together
// into a complete program. Returns a non-0 value representing the program on,
// success or 0 on failure. The caller is responsible for deleting the
// returned program using glDeleteProgram().
GLuint CreateProgramFromVertexAndFragmentShaders(
const char *vertex_shader_src, const char *fragment_shader_src);
} // namespace shader_util
#endif // EXAMPLES_TUMBLER_SHADER_UTIL_H_