mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-17 21:08:14 +00:00
[client] egl: refactor to use project naming standard
This commit is contained in:
@@ -49,7 +49,7 @@ struct EGL_Splash
|
||||
GLint uScale;
|
||||
};
|
||||
|
||||
bool egl_splash_init(EGL_Splash ** splash)
|
||||
bool egl_splashInit(EGL_Splash ** splash)
|
||||
{
|
||||
*splash = (EGL_Splash *)malloc(sizeof(EGL_Splash));
|
||||
if (!*splash)
|
||||
@@ -60,13 +60,13 @@ bool egl_splash_init(EGL_Splash ** splash)
|
||||
|
||||
memset(*splash, 0, sizeof(EGL_Splash));
|
||||
|
||||
if (!egl_shader_init(&(*splash)->bgShader))
|
||||
if (!egl_shaderInit(&(*splash)->bgShader))
|
||||
{
|
||||
DEBUG_ERROR("Failed to initialize the splash bgShader");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!egl_shader_compile((*splash)->bgShader,
|
||||
if (!egl_shaderCompile((*splash)->bgShader,
|
||||
b_shader_splash_bg_vert, b_shader_splash_bg_vert_size,
|
||||
b_shader_splash_bg_frag, b_shader_splash_bg_frag_size))
|
||||
{
|
||||
@@ -74,21 +74,21 @@ bool egl_splash_init(EGL_Splash ** splash)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!egl_model_init(&(*splash)->bg))
|
||||
if (!egl_modelInit(&(*splash)->bg))
|
||||
{
|
||||
DEBUG_ERROR("Failed to intiailize the splash bg model");
|
||||
return false;
|
||||
}
|
||||
|
||||
egl_model_set_default((*splash)->bg);
|
||||
egl_modelSetDefault((*splash)->bg);
|
||||
|
||||
if (!egl_shader_init(&(*splash)->logoShader))
|
||||
if (!egl_shaderInit(&(*splash)->logoShader))
|
||||
{
|
||||
DEBUG_ERROR("Failed to initialize the splash logoShader");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!egl_shader_compile((*splash)->logoShader,
|
||||
if (!egl_shaderCompile((*splash)->logoShader,
|
||||
b_shader_splash_logo_vert, b_shader_splash_logo_vert_size,
|
||||
b_shader_splash_logo_frag, b_shader_splash_logo_frag_size))
|
||||
{
|
||||
@@ -96,9 +96,9 @@ bool egl_splash_init(EGL_Splash ** splash)
|
||||
return false;
|
||||
}
|
||||
|
||||
(*splash)->uScale = egl_shader_get_uniform_location((*splash)->logoShader, "scale");
|
||||
(*splash)->uScale = egl_shaderGetUniform((*splash)->logoShader, "scale");
|
||||
|
||||
if (!egl_model_init(&(*splash)->logo))
|
||||
if (!egl_modelInit(&(*splash)->logo))
|
||||
{
|
||||
DEBUG_ERROR("Failed to intiailize the splash model");
|
||||
return false;
|
||||
@@ -106,12 +106,12 @@ bool egl_splash_init(EGL_Splash ** splash)
|
||||
|
||||
/* build the splash model */
|
||||
#define P(x) ((1.0f/800.0f)*(float)(x))
|
||||
egl_draw_torus_arc((*splash)->logo, 30, P( 0 ), P(0), P(102), P(98), 0.0f, -M_PI);
|
||||
egl_draw_torus ((*splash)->logo, 30, P(-100), P(8), P(8 ), P(4 ));
|
||||
egl_draw_torus ((*splash)->logo, 30, P( 100), P(8), P(8 ), P(4 ));
|
||||
egl_drawTorusArc((*splash)->logo, 30, P( 0 ), P(0), P(102), P(98), 0.0f, -M_PI);
|
||||
egl_drawTorus ((*splash)->logo, 30, P(-100), P(8), P(8 ), P(4 ));
|
||||
egl_drawTorus ((*splash)->logo, 30, P( 100), P(8), P(8 ), P(4 ));
|
||||
|
||||
egl_draw_torus ((*splash)->logo, 60, P(0), P(0), P(83), P(79));
|
||||
egl_draw_torus ((*splash)->logo, 60, P(0), P(0), P(67), P(63));
|
||||
egl_drawTorus ((*splash)->logo, 60, P(0), P(0), P(83), P(79));
|
||||
egl_drawTorus ((*splash)->logo, 60, P(0), P(0), P(67), P(63));
|
||||
|
||||
static const GLfloat lines[][12] =
|
||||
{
|
||||
@@ -135,44 +135,44 @@ bool egl_splash_init(EGL_Splash ** splash)
|
||||
}
|
||||
};
|
||||
|
||||
egl_model_add_verticies((*splash)->logo, lines[0], NULL, 4);
|
||||
egl_model_add_verticies((*splash)->logo, lines[1], NULL, 4);
|
||||
egl_model_add_verticies((*splash)->logo, lines[2], NULL, 4);
|
||||
egl_modelAddVerts((*splash)->logo, lines[0], NULL, 4);
|
||||
egl_modelAddVerts((*splash)->logo, lines[1], NULL, 4);
|
||||
egl_modelAddVerts((*splash)->logo, lines[2], NULL, 4);
|
||||
|
||||
egl_draw_torus_arc((*splash)->logo, 10, P(-26), P(-154), P(10), P(14), M_PI , -M_PI / 2.0);
|
||||
egl_draw_torus_arc((*splash)->logo, 10, P( 26), P(-154), P(10), P(14), M_PI / 2.0f, -M_PI / 2.0);
|
||||
egl_drawTorusArc((*splash)->logo, 10, P(-26), P(-154), P(10), P(14), M_PI , -M_PI / 2.0);
|
||||
egl_drawTorusArc((*splash)->logo, 10, P( 26), P(-154), P(10), P(14), M_PI / 2.0f, -M_PI / 2.0);
|
||||
#undef P
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void egl_splash_free(EGL_Splash ** splash)
|
||||
void egl_splashFree(EGL_Splash ** splash)
|
||||
{
|
||||
if (!*splash)
|
||||
return;
|
||||
|
||||
egl_model_free(&(*splash)->bg );
|
||||
egl_model_free(&(*splash)->logo);
|
||||
egl_modelFree(&(*splash)->bg );
|
||||
egl_modelFree(&(*splash)->logo);
|
||||
|
||||
egl_shader_free(&(*splash)->bgShader );
|
||||
egl_shader_free(&(*splash)->logoShader);
|
||||
egl_shaderFree(&(*splash)->bgShader );
|
||||
egl_shaderFree(&(*splash)->logoShader);
|
||||
|
||||
free(*splash);
|
||||
*splash = NULL;
|
||||
}
|
||||
|
||||
void egl_splash_render(EGL_Splash * splash, float alpha, float scaleY)
|
||||
void egl_splashRender(EGL_Splash * splash, float alpha, float scaleY)
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
glBlendColor(0, 0, 0, alpha);
|
||||
glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);
|
||||
|
||||
egl_shader_use(splash->bgShader);
|
||||
egl_model_render(splash->bg);
|
||||
egl_shaderUse(splash->bgShader);
|
||||
egl_modelRender(splash->bg);
|
||||
|
||||
egl_shader_use(splash->logoShader);
|
||||
egl_shaderUse(splash->logoShader);
|
||||
glUniform1f(splash->uScale, scaleY);
|
||||
egl_model_render(splash->logo);
|
||||
egl_modelRender(splash->logo);
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
Reference in New Issue
Block a user