Changeset 321 for trunk/tests/gui_test/nv_gui_test.cc
- Timestamp:
- 08/25/14 02:43:30 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/gui_test/nv_gui_test.cc
r319 r321 4 4 #include <nv/core/logging.hh> 5 5 #include <nv/core/logger.hh> 6 #include <cstdlib> // rand 7 #include <ctime> // time 6 #include <nv/core/random.hh> 8 7 9 8 class application … … 84 83 void application::spawn_window() 85 84 { 86 glm::ivec2 a( std::rand() % 600, std::rand() % 400);87 glm::ivec2 b( std::rand() % 200 + 40, std::rand() % 200 + 40);85 nv::ivec2 a = nv::random::get().range( nv::ivec2(), nv::ivec2( 600, 400 ) ); 86 nv::ivec2 b = nv::random::get().range( nv::ivec2( 40, 40 ), nv::ivec2( 240, 240 ) ); 88 87 nv::gui::handle e = m_guienv->create_element( nv::rectangle(a).dim(b) ); 89 88 m_guienv->set_class( e, "window" ); … … 96 95 { 97 96 if ( m_windows.size() == 0 ) return; 98 size_t index = rand() % m_windows.size();97 size_t index = nv::random::get().urand( m_windows.size() ); 99 98 m_guienv->destroy_element( m_windows[index] ); 100 99 m_windows.erase( m_windows.begin() + index ); … … 118 117 int main(int, char* []) 119 118 { 120 std::srand((unsigned int) std::time(0));119 nv::random::get().randomize(); 121 120 nv::logger log(nv::LOG_TRACE); 122 121 log.add_sink( new nv::log_file_sink("log.txt"), nv::LOG_TRACE );
Note: See TracChangeset
for help on using the changeset viewer.