Changeset 93 for trunk/tests
- Timestamp:
- 06/03/13 00:44:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/render_test/rl.cc
r90 r93 1 #include <nv/lib/sdl12.hh>2 1 #include <nv/interface/vertex_buffer.hh> 3 2 #include <nv/gl/gl_device.hh> … … 205 204 m_char_program->set_uniform( "tex", 0 ); 206 205 m_window->get_context()->draw( nv::TRIANGLES, m_render_state, m_char_program, m_char_va, 6 ); 207 208 SDL_GL_SwapBuffers(); 209 SDL_Event event;210 while( SDL_PollEvent(&event))206 m_window->swap_buffers(); 207 208 nv::io_event event; 209 while(m_window->poll_event(event)) 211 210 { 212 211 switch (event.type) 213 212 { 214 case SDL_QUIT:213 case nv::EV_QUIT: 215 214 keypress = 1; 216 215 break; 217 case SDL_KEYDOWN:218 switch (event.key.keysym.sym)216 case nv::EV_KEY: 217 if (event.key.pressed) 219 218 { 220 case SDLK_ESCAPE: keypress = 1; break; 221 case SDLK_LEFT: move.x = move.x - 1.0f; break; 222 case SDLK_RIGHT: move.x = move.x + 1.0f; break; 223 case SDLK_UP: move.z = move.z - 1.0f; break; 224 case SDLK_DOWN: move.z = move.z + 1.0f; break; 219 switch (event.key.code) 220 { 221 case nv::KEY_ESCAPE : keypress = 1; break; 222 case nv::KEY_LEFT : move.x = move.x - 1.0f; break; 223 case nv::KEY_RIGHT : move.x = move.x + 1.0f; break; 224 case nv::KEY_UP : move.z = move.z - 1.0f; break; 225 case nv::KEY_DOWN : move.z = move.z + 1.0f; break; 226 } 225 227 } 226 228 break;
Note: See TracChangeset
for help on using the changeset viewer.