Results 1 to 3 of 3

Thread: How bad can wglMakeCurrent hurt performance ?

  1. #1
    Member Newbie
    Join Date
    Oct 2003
    Posts
    30

    How bad can wglMakeCurrent hurt performance ?

    Hi !

    What is faster: change opengl states (the one that should be changed), glViewport(...), draw object, glBindTexture(...)
    glCopyTexSubImage2D(...) for each object I want to render,

    or have different rendering contexts for each object, draw object and then glCopyTexSubImage2D...

    The problem is that the objects are not known at compile time so I cannot optimize anything.

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

    Re: How bad can wglMakeCurrent hurt performance ?

    Hi !

    wglMakeCurrent is pretty expensive.

    If you for example need for different OpenGL views and create one conext and split it up with glViewport, this is much faster then creating for windows and switching context (at least on the hardware I tried on).

    It is all hardware dependant, but you should always try to minimize state changes if possible, try to keep geometry with similar attributes together if possible.

    Mikael

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Aug 2001
    Location
    Italy
    Posts
    625

    Re: How bad can wglMakeCurrent hurt performance ?

    Something related to shadow maps and wglMakeCurrent was posted some time ago on advanced forum.

    It turns out it is **very** expensive, check advanced forum's thread.

Similar Threads

  1. wglMakeCurrent() ???
    By andreasMank in forum OpenGL: Windows
    Replies: 1
    Last Post: 04-16-2004, 04:08 PM
  2. wglMakeCurrent in W2K/XP
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 07-07-2002, 12:31 PM
  3. wglMakeCurrent
    By 26hex in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-21-2001, 07:13 PM
  4. wglMakeCurrent
    By DUMEZ in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 06-27-2000, 01:29 AM
  5. GPF in wglMakeCurrent()
    By JJ in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 06-13-2000, 02:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean