Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add resize function to anime manager #36

Merged
merged 1 commit into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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