This repository has been archived on 2023-05-27. You can view files and clone it, but cannot push or open issues or pull requests.
api8/includes/utils.h

40 lines
793 B
C
Raw Normal View History

2023-05-08 13:10:39 +02:00
#ifndef DEMO_UTILS_H
#define DEMO_UTILS_H 1
2023-05-21 21:26:16 +02:00
#include <GL4D/gl4dh.h>
2023-05-08 14:35:36 +02:00
#include <GL4D/gl4duw_SDL2.h>
2023-05-21 08:16:16 +02:00
#include <SDL_image.h>
2023-05-12 16:00:17 +02:00
#include <string.h>
2023-05-08 13:10:39 +02:00
// Récupère un delta-temps
2023-05-23 12:56:32 +02:00
double get_dt(double *, const GLboolean);
2023-05-08 13:10:39 +02:00
2023-05-08 14:35:36 +02:00
// Bind and load a matrix
void bindAndLoadf(const char *name);
2023-05-12 13:49:33 +02:00
/* Move something in space
*
2023-05-12 17:46:25 +02:00
* `+x` => movement to right
2023-05-12 13:49:33 +02:00
*
2023-05-12 17:46:25 +02:00
* `-x` => movement to left
2023-05-12 13:49:33 +02:00
*
2023-05-12 17:46:25 +02:00
* `+y` => movement to top (fly)
2023-05-12 13:49:33 +02:00
*
2023-05-12 17:46:25 +02:00
* `-y` => movement to bottom (sink)
2023-05-12 13:49:33 +02:00
*
2023-05-12 17:46:25 +02:00
* `+z` => move closer
2023-05-12 13:49:33 +02:00
*
2023-05-12 17:46:25 +02:00
* `-z` => move away */
2023-05-23 12:56:32 +02:00
void move(const GLfloat x, const GLfloat y, const GLfloat z);
2023-05-12 13:49:33 +02:00
2023-05-21 08:16:16 +02:00
// Rotate a vector XYZ
2023-05-23 13:11:34 +02:00
void rotateVec(GLfloat *, const GLfloat);
2023-05-19 11:13:37 +02:00
2023-05-21 08:16:16 +02:00
// Load an image into a GL texture
2023-05-23 13:11:34 +02:00
void loadImg(const char *filename, const GLuint texture);
2023-05-21 08:16:16 +02:00
2023-05-21 21:26:16 +02:00
// Copy a texture
2023-05-23 13:11:34 +02:00
void copyTexture(const GLuint, const GLuint);
2023-05-21 21:26:16 +02:00
2023-05-08 13:10:39 +02:00
#endif