#include <glshader.h>
Inheritance diagram for GLShader:

Public Member Functions | |
| int | getID () const |
Protected Member Functions | |
| GLShader (int _id) | |
| virtual | ~GLShader () |
Private Member Functions | |
| GLShaderStatus | compile (const std::vector< std::string > &source) |
Private Attributes | |
| int | id |
Friends | |
| class | GLShaderLoader |
|
|
Definition at line 24 of file glshader.cpp. 00024 : 00025 id(_id) 00026 { 00027 }
|
|
|
Definition at line 65 of file glshader.cpp. References glx::glDeleteObjectARB. 00066 {
00067 glx::glDeleteObjectARB(id);
00068 }
|
|
|
Definition at line 38 of file glshader.cpp. References GL_OBJECT_COMPILE_STATUS_ARB, glx::glCompileShaderARB, glx::glGetObjectParameterivARB, glx::glShaderSourceARB, ShaderStatus_CompileError, ShaderStatus_EmptyProgram, and ShaderStatus_OK. 00039 {
00040 if (source.empty())
00041 return ShaderStatus_EmptyProgram;
00042
00043 // Convert vector of shader source strings to an array for OpenGL
00044 const char** sourceStrings = new const char*[source.size()];
00045 for (unsigned int i = 0; i < source.size(); i++)
00046 sourceStrings[i] = source[i].c_str();
00047
00048 // Copy shader source to OpenGL
00049 glx::glShaderSourceARB(id, source.size(), sourceStrings, NULL);
00050 delete[] sourceStrings;
00051
00052 // Actually compile the shader
00053 glx::glCompileShaderARB(id);
00054
00055 GLint compileSuccess;
00056 glx::glGetObjectParameterivARB(id, GL_OBJECT_COMPILE_STATUS_ARB,
00057 &compileSuccess);
00058 if (compileSuccess == GL_FALSE)
00059 return ShaderStatus_CompileError;
00060
00061 return ShaderStatus_OK;
00062 }
|
|
|
Definition at line 31 of file glshader.cpp. References id. Referenced by GLShaderLoader::CreateFragmentShader(), and GLShaderLoader::CreateVertexShader(). 00032 {
00033 return id;
00034 }
|
|
|
Reimplemented in GLVertexShader, and GLFragmentShader. Definition at line 43 of file glshader.h. |
|
|
Definition at line 39 of file glshader.h. Referenced by getID(). |
1.4.1