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: Context switching speed question ?

  1. #1
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,651

    Context switching speed question ?

    Hi !

    Context switching is slow, but how slow is it. If I want an ordinary 3D modeler setup with 4 views of a scene, would it be fastest to create 4 windows with one OpenGL context for each window or to use one window with one context and render the scene 4 times in this window instead (one time in each quadrant) ?

    Mikael

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: Context switching speed question ?

    Depends a little on your system (CPUs and graphics board.)

    For some reasons it might be more effective to work in one window with four do-it-yourself viewport.
    Examples:
    - Textures and display lists don't need to be shared.
    - Clears and SwapBuffers only have to be done once and may be faster that way.
    - Simultaneous updates in multiple viewports easier because of single window message handler.
    - Lots of other things...

    But you'll have to fuzz around with the viewport dimensions and display borders yourself (don't use GDI!). Even some highend apps do this, so you're in good company.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Dec 2000
    Location
    Computer Graphics Group, RWTH Aachen, Germany
    Posts
    137

    Re: Context switching speed question ?

    Hi,

    it is very slow, really. I know it from my experience. You'll maybe loose a week to make fully featured view with 4 viewports, but it is worth...Not olny for speed, but also for the display lists and the textures, as Relic pointed.... A easy way to do it, is to implement a class CViewport with the local viewport's properties. Some mess is to be expected with the mouse coords mapping, but if you have problems, I may e-mail you some code for these things...


    Hope this helps
    Martin

Posting Permissions

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