Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Visual C++ Design Question

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2000
    Location
    Madras, OR
    Posts
    1

    Visual C++ Design Question

    Howdy!
    I'm a beginner at OpenGL.
    I have a question about implentation of OpenGL objects and data manipulation as it might pertain to the view/doc archetecture. I can't decide weather to make the OpenGL engine and objects local to the view or doc archetecture. Or to seperate them. Does anybody have any suggestions? Thanks for any help you might suggest.
    ogre
    It's not a bug.
    It's a feature!

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    France
    Posts
    880

    Re: Visual C++ Design Question

    Hi !

    What I am doing is putting every information about the world in the Document.
    It does not make sense to put them in the View because ONE Document should be for ONE world.
    This does not mean that the View shouldn't have specific members (such as the rendering mode (filled/lines) or the state of the lights (on/off)) but the vertices/normals/maps should belong to the Document.
    You can create a separated class (let's say CModel) and put a member CModel *m_pModel in your Document but this is more or less the same (except that your CModel object can be used in another program more easily !).

    Hope this will help you !

    As far as I am concerned, I have used both methods for different programs.

    Eric

  3. #3
    Intern Newbie
    Join Date
    Mar 2000
    Location
    UK
    Posts
    36

    Re: Visual C++ Design Question

    The best way to deal with this sort of problem, is to figure out what information would need to be shared amongst several different views (CView derived objects), and make sure that this is contained in the CDoc.

    Information about objects in the scene would be common to all views, so the neatest OOP way, is to create a load of objects (maybe in a tree structure) which are contained in the CDoc, so that any of the attached views can access this information when required.

    Hope that this makes secnse.

Posting Permissions

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