Writing a few more asserts.

This commit is contained in:
2022-01-03 08:12:28 -08:00
parent 44ecc307e6
commit 0ff8548e15
9 changed files with 98 additions and 1 deletions

View File

@ -87,6 +87,7 @@ void standardShaderSetTexture(standardshader_t *stds, texture_t *texture) {
ASSERT_NOT_NULL(texture);
if(!assetManagerItemIsFinished(stds->shaderProgram)) return;
textureBind(texture, 0);
shaderUseTexture(STANDARD_SHADER_SHADER(stds), stds->uniformTexture, 0);
}

View File

@ -35,10 +35,57 @@ typedef struct {
shaderuniform_t uniformColor;
} standardshader_t;
/**
* Initialize the standard shader.
*
* @param stds Standard Shader Instance.
* @param assetManager Asset Manager to load the shaders' assets.
*/
void standardShaderInit(standardshader_t *stds, assetmanager_t *assetManager);
/**
* Bind the standard shader as the currently active shader.
*
* @param stds Standard shader to bind.
*/
void standardShaderUse(standardshader_t *stds);
/**
* Set the camera for the standard shader.
*
* @param stds Standard shader instance.
* @param camera Camera to bind.
*/
void standardShaderSetCamera(standardshader_t *stds, camera_t *camera);
/**
* Set the texture for the standard shader.
*
* @param stds Standard shader instance.
* @param texture Texture to bind.
*/
void standardShaderSetTexture(standardshader_t *stds, texture_t *texture);
/**
* Set the color for the standard shader.
*
* @param stds Standard shader instance.
* @param color Color to bind.
*/
void standardShaderSetColor(standardshader_t *stds, pixel_t color);
/**
* Set the position matrix for the standard shader.
*
* @param stds Standard shader to use.
* @param matrix Matrix to use.
*/
void standardShaderSetPosition(standardshader_t *stds, matrix_t *matrix);
/**
* Dispose/cleanup the standard shader.
*
* @param stds Standard shader instance.
* @param assMan Asset manager instance.
*/
void standardShaderDispose(standardshader_t *stds, assetmanager_t *assMan);