本文整理汇总了C++中Evas_GL_API::glDeleteShader方法的典型用法代码示例。如果您正苦于以下问题:C++ Evas_GL_API::glDeleteShader方法的具体用法?C++ Evas_GL_API::glDeleteShader怎么用?C++ Evas_GL_API::glDeleteShader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Evas_GL_API
的用法示例。
在下文中一共展示了Evas_GL_API::glDeleteShader方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printf
static void
_del_gl(Evas_Object *obj)
{
GLData *gld = evas_object_data_get(obj, "gld");
if (!gld)
{
printf("Unable to get GLData. \n");
return;
}
Evas_GL_API *gl = gld->glapi;
gl->glDeleteShader(gld->vtx_shader);
gl->glDeleteShader(gld->fgmt_shader);
gl->glDeleteProgram(gld->program);
gl->glDeleteBuffers(1, &gld->gear1->vbo);
gl->glDeleteBuffers(1, &gld->gear2->vbo);
gl->glDeleteBuffers(1, &gld->gear3->vbo);
free_gear(gld->gear1);
free_gear(gld->gear2);
free_gear(gld->gear3);
evas_object_data_del((Evas_Object*)obj, "..gld");
free(gld);
}
示例2: malloc
//--------------------------------//
static GLuint
load_shader( GLData *gld, GLenum type, const char *shader_src )
{
Evas_GL_API *gl = gld->glapi;
GLuint shader;
GLint compiled;
// Create the shader object
shader = gl->glCreateShader(type);
if (shader==0)
return 0;
// Load/Compile shader source
gl->glShaderSource(shader, 1, &shader_src, NULL);
gl->glCompileShader(shader);
gl->glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
if (!compiled)
{
GLint info_len = 0;
gl->glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &info_len);
if (info_len > 1)
{
char* info_log = malloc(sizeof(char) * info_len);
gl->glGetShaderInfoLog(shader, info_len, NULL, info_log);
printf("Error compiling shader:\n%s\n======\n%s\n======\n", info_log, shader_src );
free(info_log);
}
gl->glDeleteShader(shader);
return 0;
}
return shader;
}