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 7 of 7

Thread: OpenGL MDI in VC++

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    gainesville, fla, usa
    Posts
    17

    OpenGL MDI in VC++

    Hi,
    I am getting ready to start writing an MDI in VC++. I will be using OpenGL, so, I was looking on the web for a view class that has OpenGL enabled that I can subclass. I found an MDI on codeguru but some people commented that it has memory leaks. So, does anyone have or know of a site where I can get this information?

    Thanks

  2. #2
    Junior Member Newbie
    Join Date
    Mar 2000
    Location
    Rome,Italy
    Posts
    7

    Re: OpenGL MDI in VC++

    On www.codeproject.com there is a slightly more recent version of CGLEnabledView.
    The leaks issue on codeguru were related to poor opengl drivers (old ATI ICD in that case) and infact all OpenGL application were affected.
    Memory consumption is heavily connected to your video card ICD, for example on my GeForce I notice a 9 mb memory allocation upon startup and a ~1.5 mb allocation for each rendering context (that is view).

    Alex

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

    Re: OpenGL MDI in VC++

    Just a remark flappy : you can have only one rendering context per document i.e. you are not forced to have one RC per view.

    Anyway, your 9mb must be due to the DC and not the RC... And as you need one DC per view, the result is the same...

    Eric

  4. #4
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    gainesville, fla, usa
    Posts
    17

    Re: OpenGL MDI in VC++

    Thanks very much flappy and eric.
    I am going to check it out. I hope it works.


    glguru

  5. #5
    Junior Member Newbie
    Join Date
    Mar 2000
    Location
    Rome,Italy
    Posts
    7

    Re: OpenGL MDI in VC++

    Hi Eric, you said:
    Originally posted by Eric:
    Just a remark flappy : you can have only one rendering context per document i.e. you are not forced to have one RC per view.

    Anyway, your 9mb must be due to the DC and not the RC... And as you need one DC per view, the result is the same...

    Eric
    I've choosen to have a separate RC for each view for future expansions: I originally planned to design a multithreaded view class (there must be an RC for every thread), then I realized that multithreaded MDI interfaces are a real nightmare.
    Perhaps in the future I'll try to move the RC handle into the Document class but I'm afraid this will introduce some state switching (by the way does someone knows if RC switching is slower or faster than state switching?).
    Another way could be to share a single RC among all views.

    Alex

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

    Re: OpenGL MDI in VC++

    Hi Flappy.

    That's waht I meant : I share one RC amongst all views... And the RC is contained within the document !

    Eric

  7. #7
    Junior Member Newbie
    Join Date
    Mar 2000
    Location
    Rome,Italy
    Posts
    7

    Re: OpenGL MDI in VC++

    Originally posted by Eric:
    Hi Flappy.

    That's waht I meant : I share one RC amongst all views... And the RC is contained within the document !

    Eric
    And how much memory does it consumes?
    Which environment are you running in?

    Just to check if I'm doing the bad way.

    Alex

Posting Permissions

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