Skip to content

Commit

Permalink
add resize function to anime manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Gothor committed May 29, 2023
1 parent d2fa545 commit f3442af
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib_src/GL4D/gl4dhAnimeManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,21 @@ void gl4dhUpdateWithAudio(void) {
drawOrUpdateWithAudio(_animations, GL4DH_UPDATE_WITH_AUDIO);
}

/*!\brief met à jour la largeur et la hauteur de la texture dans laquelle sont
* réalisées les animations.
*/
void gl4dhResize(int w, int h) {
_w = w; _h = h;

glBindTexture(GL_TEXTURE_2D, _wTexId);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);

glBindTexture(GL_TEXTURE_2D, _wdTexId);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, w, h, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL);

glBindTexture(GL_TEXTURE_2D, 0);
}

/*!\brief regarde si le pointeur \a func est un élément du tableau
* \a funcList
* \param func un élément dont il faut tester la présence.
Expand Down
1 change: 1 addition & 0 deletions lib_src/GL4D/gl4dhAnimeManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern "C" {
GL4DAPI Uint32 GL4DAPIENTRY gl4dhGetTicks(void);
GL4DAPI void GL4DAPIENTRY gl4dhDraw(void);
GL4DAPI void GL4DAPIENTRY gl4dhUpdateWithAudio(void);
GL4DAPI void GL4DAPIENTRY gl4dhResize(int w, int h);

#ifdef __cplusplus
}
Expand Down

0 comments on commit f3442af

Please sign in to comment.