Results 1 to 2 of 2

Thread: Form_Load or SubMain for game loop

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982

    Form_Load or SubMain for game loop

    I was just looking at a site with DirectX for VB tutorials. The first one explains how to get started, getting a DX window up and running.

    The part I am curious about is the main game loop and garbage collection is in the Form_Load event which means the Form_Load procedure doesn't end until the app has ended.

    In some tutorials I have seen the game loop in a module in a SubMain procedure.

    Which is better Form_Load or SubMain?

  2. #2
    Fanatic Member scr0p's Avatar
    Join Date
    Oct 2002
    Location
    VA
    Posts
    720
    For a small program, or an example, use Form_load, for a big program, put all your code in modules and you can use sub_main to call the beginning, then form1.show or w/e. I think sub_main is a little faster because it loads the code right away.
    asdf

Posting Permissions

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



Click Here to Expand Forum to Full Width