Skip to content

Commit

Permalink
Merge pull request #36 from Gothor/add-resize-function-to-anime-manager
Browse files Browse the repository at this point in the history
add resize function to anime manager
  • Loading branch information
noalien authored May 30, 2023
2 parents d2fa545 + f3442af commit 0878d97
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 0878d97

Please sign in to comment.