Changeset 47
- Timestamp:
- 05/28/13 18:08:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/render_test/rl.cc
r46 r47 87 87 }; 88 88 89 application* g_application;90 91 89 application::application() 92 90 { … … 210 208 m_window->get_context()->clear( m_clear_state ); 211 209 212 // float d = -4.0f;213 float angle = (float)(SDL_GetTicks() / 1000.0 * 45); // 45° per second214 glm::vec3 axis_y(0.0, 1.0, 0.0);215 glm::mat4 anim = glm::rotate(glm::mat4(1.0f), angle, axis_y);216 217 // glm::mat4 model = glm::translate(glm::mat4(1.0f), glm::vec3(0.0, 0.0, d));218 // glm::mat4 view = glm::lookAt(glm::vec3(0.0, 2.0, 0.0), glm::vec3(0.0, 0.0, d), glm::vec3(0.0, 1.0, 0.0));219 220 210 glm::mat4 model = glm::translate(glm::mat4(1.0f), glm::vec3(-8.5, 0.0, -8.0)); 221 211 glm::mat4 view = glm::lookAt(glm::vec3(0.0, 20.0, 5.0) + move, glm::vec3(0.0, 4.0, 0.0) + move, glm::vec3(0.0, 1.0, 0.0)); 222 212 glm::mat4 projection = glm::perspective(25.0f, 1.0f*800.0f/600.0f, 0.1f, 100.0f); 223 //projection = glm::ortho(-10.0f, 10.0f, -10.0f, 10.0f, 0.1f, 100.0f);224 213 glm::mat4 mv = view * model; 225 glm::mat3 N = glm::transpose(glm::inverse(glm::mat3(mv)));226 214 227 215 m_texture->bind( 0 ); … … 272 260 } 273 261 274 /*275 class test_resource : public nv::resource276 {277 public:278 typedef std::shared_ptr< test_resource > ptr;279 public:280 test_resource() {}281 virtual bool load() { return true; };282 virtual bool unload() { return true; };283 };284 */285 // nv::resource_manager::pointer()->register_resource_type<test_resource>("test");286 287 288 262 289 263 int main(int, char* []) … … 294 268 295 269 NV_LOG( nv::LOG_NOTICE, "Logging started" ); 296 297 // nv::load_freetype_library(); 298 // 299 // size_t depth = 3; 300 // nv::texture_atlas tex( glm::ivec2( 512, 512 ), depth ); 301 // for ( nv::uint16 i = 10; i < 32; i += 2 ) 302 // { 303 // nv::texture_font font( &tex, "aero.ttf", i ); 304 // font.load_glyphs( "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); 305 // } 306 307 g_application = new application(); 308 309 // SDL_Surface* s = SDL_CreateRGBSurfaceFrom( (void*)tex.get_data(), 512, 512, depth * 8, 512 * depth,0,0,0,0); 310 // SDL_SaveBMP_RW( s, SDL_RWFromFile("test.bmp", "wb"), 1); 311 312 if ( g_application->initialize() ) 270 application app; 271 if ( app.initialize() ) 313 272 { 314 g_application->run(); 315 } 316 delete g_application; 317 273 app.run(); 274 } 318 275 NV_LOG( nv::LOG_NOTICE, "Logging stopped" ); 319 276
Note: See TracChangeset
for help on using the changeset viewer.