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: MAX_VIEWPORT_DIMS problem

  1. #1
    Intern Newbie
    Join Date
    Jul 2012
    Posts
    41

    MAX_VIEWPORT_DIMS problem

    I have app for image editing. Everything related to image or it's editing is done via OpenGL. I implemented zooming method. To achieve zooming effect I'm using glTranslatef. I draw everything 5 times bigger than it is, to achieve zoom-in effect. But now I met problem. When drawing everything 5 times bigger, automatically viewport is 5 times bigger than original image. And on older macs sometimes MAX_VIEWPORT_DIMS is too small to redraw image. For example if I use this app on mac with NVIDIA GeForce 7300 graphics card, witch's MAX_VIEWPORT_DIMS is 4096, when user opens for example 825x825 image, it can't be redrawn correctly, because 5*825 = 4125, and it is bigger than MAX_VIEWPORT_DIMS. Maby anyone could point me to some way-arround, to avoid this type of problem.

    By the way, viewport is set to be 5 times bigger, only when rendering to frame buffers. When drawing mainframebuffer to screen it is set to be equal to visible rectangle.
    P.S. for zooming i'm using glTranslatef, because I need perspective projection.
    Last edited by hockeyman; 10-30-2012 at 06:57 AM.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    749
    You could split your draw calls into tiles so that each one does not exceed the max. size of the viewport.

    However, why are you drawing stuff that you know won't fit on the screen anyway? Also, to just draw an image (and possibly zoom it) a full screen quad with appropriately chosen texture coordinates should be enough.

  3. #3
    Intern Contributor nigels's Avatar
    Join Date
    Apr 2000
    Location
    Texas, USA
    Posts
    87
    Generally the viewport should be determined by the Windowing system - not fiddled by the application for viewing.
    A full screen quad with well chosen texture coordinates ought to do the job.

    - Nigel
    ---
    Regal - as OpenGL ought to be

Tags for this Thread

Posting Permissions

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