|
|
|
@ -68,32 +68,6 @@ initCubeMesh() |
|
|
|
return m; |
|
|
|
return m; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
shader_program* |
|
|
|
|
|
|
|
getShaderByName(const char* name, GLContext* gl_ctx) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
u64 hash = utilFNV64a_str(name); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (u32 i = 0; i < gl_ctx->num_shaders; i++) { |
|
|
|
|
|
|
|
if (utilFNV64a_str(gl_ctx->shaders[i].name) == hash) |
|
|
|
|
|
|
|
return &gl_ctx->shaders[i]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf("%s(), shader not found, %s\n", __FUNCTION__, name); |
|
|
|
|
|
|
|
return nullptr; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
shader_program* |
|
|
|
|
|
|
|
getShaderByID(GLContext* gl_ctx, GLuint prog_id) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
for (u32 i = 0; i < gl_ctx->num_shaders; i++) { |
|
|
|
|
|
|
|
if (gl_ctx->shaders[i].prog_id) |
|
|
|
|
|
|
|
return &gl_ctx->shaders[i]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf("%s(), shader not found, %d\n", __FUNCTION__, prog_id); |
|
|
|
|
|
|
|
return nullptr; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// NOTE: equivalent to rgAppend() in libTangerine
|
|
|
|
// NOTE: equivalent to rgAppend() in libTangerine
|
|
|
|
model* |
|
|
|
model* |
|
|
|
getModel(RenderState* rs, const char* filepath) |
|
|
|
getModel(RenderState* rs, const char* filepath) |
|
|
|
|