Changeset 267 for trunk/tests/gui_test
- Timestamp:
- 06/19/14 19:03:25 (11 years ago)
- Location:
- trunk/tests/gui_test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/gui_test/gui.frag
r161 r267 2 2 varying vec4 v_color; 3 3 varying vec2 v_texcoord; 4 uniform sampler2D tex;4 uniform sampler2D nv_t_diffuse; 5 5 6 6 void main(void) { 7 vec4 texture = texture2D( tex,v_texcoord);7 vec4 texture = texture2D(nv_t_diffuse,v_texcoord); 8 8 gl_FragColor = v_color * texture; 9 9 } -
trunk/tests/gui_test/gui.vert
r161 r267 3 3 attribute vec2 nv_texcoord; 4 4 attribute vec4 nv_color; 5 uniform mat4 nv_ projection;5 uniform mat4 nv_m_projection; 6 6 varying vec4 v_color; 7 7 varying vec2 v_texcoord; … … 10 10 v_color = nv_color; 11 11 v_texcoord = nv_texcoord; 12 gl_Position = nv_ projection * vec4( nv_position.x, nv_position.y, 0.0, 1.0 );12 gl_Position = nv_m_projection * vec4( nv_position.x, nv_position.y, 0.0, 1.0 ); 13 13 } -
trunk/tests/gui_test/nv_gui_test.cc
r239 r267 16 16 void spawn_window(); 17 17 void recolor_window(); 18 // void bring_to_front( int i ); 18 19 ~application(); 19 20 protected: … … 64 65 switch (event.key.code) 65 66 { 67 // case nv::KEY_1 : bring_to_front(0); break; 68 // case nv::KEY_2 : bring_to_front(1); break; 69 // case nv::KEY_3 : bring_to_front(2); break; 70 // case nv::KEY_4 : bring_to_front(3); break; 71 // case nv::KEY_5 : bring_to_front(4); break; 66 72 case nv::KEY_N : spawn_window(); break; 67 73 case nv::KEY_K : kill_window(); break; … … 80 86 glm::ivec2 a( std::rand() % 600, std::rand() % 400 ); 81 87 glm::ivec2 b( std::rand() % 200 + 40, std::rand() % 200 + 40 ); 82 nv::gui::element* e = new nv::gui::element( m_guienv, nv::rectangle(a).dim(b) );88 nv::gui::element* e = m_guienv->create_element( nullptr, nv::rectangle(a).dim(b) ); 83 89 e->set_class( "window" ); 84 90 e->set_text("Window "+nv::to_string(m_windows.size()+1) ); 85 m_guienv->add_child( e );86 91 NV_LOG( nv::LOG_INFO, "Spawn (" << a.x << "," << a.y << "x" << b.x << "," << b.y << ")" ); 87 92 m_windows.push_back( e ); … … 92 97 if ( m_windows.size() == 0 ) return; 93 98 size_t index = rand() % m_windows.size(); 94 delete m_windows[ index ];99 m_guienv->destroy_element( m_windows[index] ); 95 100 m_windows.erase( m_windows.begin() + index ); 96 101 } … … 102 107 delete m_device; 103 108 } 109 110 // void application::bring_to_front( int i ) 111 // { 112 // if ( i >= 0 && i < m_windows.size() ) 113 // { 114 // m_guienv->bring_to_front( m_windows[i] ); 115 // } 116 // } 104 117 105 118 int main(int, char* [])
Note: See TracChangeset
for help on using the changeset viewer.