Results 1 to 5 of 5

Thread: Subwindow slows my app

  1. #1
    Senior Member Regular Contributor
    Join Date
    Mar 2005
    Posts
    115

    Subwindow slows my app

    Hi I have a subwindow that I use for a map in one of my programs, but when I have it on it slows my frame rate by half. I need this map in my game, but can't think of any other way to display it. Is there a way I can speed it up or do I have to find a another way to show it?

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

    Re: Subwindow slows my app

    Hi !

    Context switcing can be slow so you might want to try to only use one window and put the map in one corner or so, use glViewport to select the area of a window to render to.

    You should of course also have a peek at your code and see where you can improve performance a bit.

    Mikael

  3. #3
    Senior Member Regular Contributor
    Join Date
    Mar 2005
    Posts
    115

    Re: Subwindow slows my app

    Well I've disabled all rendering to the subwindow and it's still slow so I think I should try the glViewPort, but I'm not sure how to use it could you post some code please?

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jan 2004
    Posts
    314

    Re: Subwindow slows my app

    It depends on what you want to display the map for.

    If you want to display the map, why not try a single textured quad in Ortho mode? You can scroll it by using the texture matrix or by changing the UV coordinates.

    If the whole map needs to be updated often I suggest rendering to texture when it needs to be updated. You don't need high detail textures or complex shaders in a small map so it should be faster. Also, it typically does not need to be updated every frame.

    If the map basically stays the same but you want to display some objects on it, just render those in a 2D mode after rendering the map. The map itself can then be a static texture.

    If the map needs to be updated sporadically, you might even just re-upload the texture when it changes. But render to texture could do it just as well.

  5. #5
    Senior Member Regular Contributor
    Join Date
    Mar 2005
    Posts
    115

    Re: Subwindow slows my app

    Well I'm not that great with textures, all I can do is texture map objects, not create them or edit them during the program. I think maybe the glViewPort may still be my best bet

Similar Threads

  1. Why SwapBuffers slows down the performance?
    By wolfman in forum OpenGL: Advanced Coding
    Replies: 44
    Last Post: 02-24-2010, 04:38 PM
  2. Textures in Vertex Shader slows down FPS
    By sheree in forum OpenGL: GLSL
    Replies: 13
    Last Post: 04-05-2009, 05:40 AM
  3. Rendering lots of polygons slows down FPS too much.
    By Klick in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 09-12-2007, 07:04 AM
  4. Clip Region slows down on GeForce cards
    By Coconut in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 01-31-2005, 09:36 AM
  5. Why SwapBuffers slows down the performance?
    By wolfman in forum OpenGL: Windows
    Replies: 1
    Last Post: 01-10-2004, 04:53 AM

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