Results 1 to 10 of 42

Thread: pascal and learning 3d

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    I have a bunch of classes now, should I worry about writing destructors for them or memory will be freed autimatically when app terminates?

  2. #2
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    when it comes to classes whatever you create you must destroy. you should get heap trace up and running if you don't already. check the output file often to check mem leaks as you go along. also make sure to free up any opengl stuff in your destructors.

  3. #3
    ok, thanks. list of leaks is so long that it doesn't fit on the screen

  4. #4
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    I built my frame work using a custom linked list design. all things are connected so I worry little about mem leaks. I worked on it for over a year before I started checking for leaks and I wasn't really surprised that I had none. so much more is possible with such a design.

  5. #5
    Quote Originally Posted by Carver413 View Post
    I built my frame work using a custom linked list design. all things are connected so I worry little about mem leaks. I worked on it for over a year before I started checking for leaks and I wasn't really surprised that I had none. so much more is possible with such a design.
    Are you saying that you add all ingame classes into a single TList with which you free all of them in the end? It would be ince if you can give us more information on this approach or even show us some code examples of this.

  6. #6
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    this will probable explain it much better then I could
    mine is a single linked looped list and I am using an array of children which makes it possible for each and every class to maintain any number of lists without a container class to manage them. I will try to extract it from my code if you really want it. I plan to release my framework when it is finished but I can't really say how long that will be.
    http://en.wikipedia.org/wiki/Linked_list



  7. #7
    another headache.. object picking!
    I've read about different methods and looks like ray casting is a way to go in my case. But I'm having problems with gluUnProject , not sure what to feed to it.
    Samples I've seen are useing something like that to obtain values for it:
    glGetIntegerv(GL_VIEWPORT,@viewport);
    glGetDoublev(GL_PROJECTION_MATRIX,@projectionMatri x);
    glGetDoublev(GL_MODELVIEW_MATRIX,@modelMatrix);

    those get me identity matrices for projection and model. I guess it's because i'm doing all 'projection' computations in shaders only. I think I know how to fill projection and viewport matrices but every model has it's own model matrix. Should I just use any's model matrix for gluUnProject ? (tried and it didn't work ;p )

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
  •