Results 1 to 10 of 42

Thread: pascal and learning 3d

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Not sure if it's solved but I want to make a comment about record alignment. In the engine I wrote and used in the 2nd. PGD Challenge I didn't use records to store data that is used with OpenGL; I use vectors (ARRAY) instead. For example, to store xyz points I used something like:
    Code:
    CONST
      COOR_X = 0;
      COOR_Y = 1;
      COOR_Z = 2;
    TYPE
      Vector3D = ARRAY [0..2] OF glFloat;
    To access to each axis I use the CONST (i.e. Point[COOR_X], etc). This way I can use the "v" functions without alignment problems.
    No signature provided yet.

  2. #2
    yeah it works alright now

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

  4. #4
    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.

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

  6. #6
    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.

  7. #7
    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.

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
  •