Jump to content

Night and Day script with in C++


Gabriel
 Share

Recommended Posts

Hello,

 

 

I have crash with the Night and Day script with in C++

When I incorporate in the editor, no propbleme it works and I save my file SBX.

Then I make a LoadScene it works, but after a RenderFrameWork I get an error "access violation":/

 

Any idea?

 

thank you

 

Gabriel

 

 

 


   m_pEngine = new LEO::Engine("Montana",ScreenWidth , ScreenHeight);
   m_pFrameWork = new LEO::Framework();

   BP L = GetLuaState();
   SetGlobalObject( "fw",(TEntity)m_pFrameWork);
   BP lua = GetLuaState();
   lua_pushobject( lua, (TEntity)m_pFrameWork);
   lua_setglobal( lua, "fw" );
   lua_pop( lua, 1 );

   m_scene = LE::LoadScene(FileName.c_str());

   SetHDR(1);
   SetSSAO(1);
   SetBloom(1);
   SetAntialias(1);
   SetShadowQuality(1);
   SetTextureQuality(1);
   OcclusionCulling(1);

   while(!KeyHit(KEY_ESCAPE))
   {

m_pFrameWork->Update();
m_pFrameWork->Render(); <-- crash when calling Render
Flip(0);
   }

Link to comment
Share on other sites

Try setting the framework effects after you rendered once. I think i had some problem with that, too.

 

Like:



   m_pEngine = new LEO::Engine("Montana",ScreenWidth , ScreenHeight);
   m_pFrameWork = new LEO::Framework();

   BP L = GetLuaState();
   SetGlobalObject( "fw",(TEntity)m_pFrameWork);
   BP lua = GetLuaState();
   lua_pushobject( lua, (TEntity)m_pFrameWork);
   lua_setglobal( lua, "fw" );
   lua_pop( lua, 1 );

   m_scene = LE::LoadScene(FileName.c_str());



   while(!KeyHit(KEY_ESCAPE))
   {

       if (KeyHit(KEY_G))
       {
             SetHDR(1);
             SetSSAO(1);
             SetBloom(1);
             SetAntialias(1);
             SetShadowQuality(1);
             SetTextureQuality(1);
             OcclusionCulling(1);
       }

       m_pFrameWork->Update();
       m_pFrameWork->Render(); <-- crash when calling Render
       Flip(0);
   }


(Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...