I have noticed that also.
Its fixed in my templates
#include "leo.h"
using namespace LEO ;
#if defined( _WINDOWS )
void ErrOut( const char* pstrMessage ) { MessageBoxA(0, pstrMessage, "Error", 0 ); }
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd )
#else
void ErrOut( const std::string& message ) { puts( message.c_str()); }
int main( int argn, char* argv[] )
#endif
{
// Set graphics mode
Engine engine("Example - LEO with Framework",1024,768);
if( !engine.IsValid() )
{
ErrOut( "Failed to set graphics mode.");
return 1;
}
// Create framework object and set it to a global object so other scripts can access it
Framework fw;
fw.Create();
if( NULL == fw )
{
ErrOut( "Failed to initialize engine." );
return 1;
}
// Set Lua framework object
engine.SetObject( "fw", fw );
// Set Lua framework variable
Lua lua;
lua.Create();
lua.PushObject( fw );
lua.SetGlobal( "fw" );
lua.Pop( 1 );
// Get framework main camera
fw.main.camera.SetPosition( Vec3(0,0,-2) );
Material material( "abstract::cobblestones.mat" );
Cube mesh( CREATENOW );
mesh.Paint( material );
Cube ground( CREATENOW );
ground.Scale( Vec3(10,1,10) );
ground.SetPosition( Vec3(0,-2,0) );
ground.Paint( material );
DirectionalLight light( CREATENOW );
light.SetRotation( Vec3(45) );
while( !engine.IsTerminated() )
{
mesh.Turn( Vec3( AppSpeed()*0.5f ) );
fw.Update();
fw.Render();
engine.Flip( 0 );
}
return engine.Free();
}