Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: 1 [2]
  Print  
Author Topic: How to reboot Tv3D through a code?  (Read 737 times)
Hawthorne
Customers
Community Member
*****
Posts: 233


« Reply #20 on: September 12, 2008, 08:37:09 AM »

Clear? What clear? We're talking about exceptions here, right?
But yes, I for one do mind. I'm used to good code practices Wink

Truvision.Engine.Clear();

You see this is normally what give's people a fit (causing those exceptions) They forget to call a clear after the last render cycle and all kinds of madness takes hold and no one knows why! My point was the above approach would allow this to recover. And this is but one of MANY examples where this approach will save you hours of needles time wasted pouring over something that is trivial. You call it bad code practice, I call it covering every base.

No need to get riled up, if you would like to see it in action you can download the latest version of geonardo (www.zepadev.net) and check it out first hand and load 1000 maps over and over and over and watch them load in under 3 seconds without skipping a beat (source code provided in the sdk).

Obviously a little Editor maker envy is at play here but I forgive you. Tongue

-Pat

ps: How's that LUA coming along?
« Last Edit: September 12, 2008, 08:41:44 AM by Hawthorne » Logged
DanDixon
Customers
Community Member
*****
Posts: 181


« Reply #21 on: September 12, 2008, 08:13:27 PM »

Truvision.Engine.Clear();

You see this is normally what give's people a fit (causing those exceptions) They forget to call a clear after the last render cycle and all kinds of madness takes hold and no one knows why!

I call Truvision.Engine.Clear before I begin drawing new stuff to the screen every frame. Where are you calling it?
Logged
Hawthorne
Customers
Community Member
*****
Posts: 233


« Reply #22 on: September 13, 2008, 01:08:29 AM »

I call Truvision.Engine.Clear before I begin drawing new stuff to the screen every frame. Where are you calling it?

That is exactly what you are supposed to do, and not in question. It was provided as an example of how an access violation can occur.

You can run loading screens and what not,  So if you do a .Clear at he beginning of a load loop, then come out of the loop and start doing things without issuing another clear, you will get access violations.

It is the same as "Reusing TV" going from one loop to another clearing out TV's data sets on the way and loading any new assets (i.e. level changing, zone loading), you can do this and avoid all potential issues during your applications lifespan, thus giving you the capability to "load and unload" TV assets several times using the same objects causing no problems.

-Pat
 
« Last Edit: September 13, 2008, 03:15:44 AM by Hawthorne » Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks