a deriver pour afficher les objets. renvoie 1 pour continuer, 0 pour fermer l'application.
89 {
90 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
91
92
93 int mx, my;
94 unsigned int mb= SDL_GetRelativeMouseState(&mx, &my);
95 if(mb & SDL_BUTTON(1))
96 m_camera.rotation(mx, my);
97 else if(mb & SDL_BUTTON(3))
98 m_camera.move(mx);
99 else if(mb & SDL_BUTTON(2))
101
102 static float position= 0;
103
104 float speed= m_gamepads.pad(0).axis(SDL_CONTROLLER_AXIS_TRIGGERLEFT);
105 position= position + speed;
106
107 static float rotation= 0;
108
109 float angle= m_gamepads.pad(0).axis(SDL_CONTROLLER_AXIS_RIGHTX);
110 rotation= rotation + angle;
111
113
114 draw(m_grid, m_camera);
115 draw(m_objet, m_model, m_camera, m_texture);
116
117
118 int stop= 1;
119
120 if(m_gamepads.pad(0).button(SDL_CONTROLLER_BUTTON_BACK))
121 stop= 0;
122 return stop;
123 }
int window_height()
renvoie la hauteur de la fenetre de l'application.
int window_width()
renvoie la largeur de la fenetre de l'application.
float global_time()
renvoie le temps ecoule depuis le lancement de l'application, en millisecondes.
Transform RotationX(const float a)
renvoie la matrice representation une rotation de angle degree autour de l'axe X.
Transform RotationY(const float a)
renvoie la matrice representation une rotation de a degree autour de l'axe Y.
Transform Translation(const Vector &v)
renvoie la matrice representant une translation par un vecteur.