Results 1 to 10 of 34

Thread: Thyandyr's voxel engine

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Quote Originally Posted by Thyandyr View Post
    In reference to freeing all the TChunks in TDictionary<string, TChunk>, how do I do it?

    I don't see a way to just do

    Code:
    for I = 0 to count-1 do 
      TDict.Items[0].Free
    as it is not sorted or indexable in that way

    Do I need to extract all the keys and then iterate with that list? That hardly seems like a smart way to do it.

    OK this works

    Code:
    for Chunk in TDict.Values do Chunk.Free

    Uhhh... why aren't you just using a TObjectDictionary with "doOwnsValues" set in the ownerships parameter in the constructor? That's what they're there for. That way, it works exactly like a TObjectList that has OwnsObjects set to true, and you don't need to do anything at all in your destructor as all the dictionary values will be freed automatically.

    As far as your VBO problem, what kind of GPU are you using?
    Last edited by Akira13; 02-11-2017 at 01:16 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •