Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Resize Event on window create  (Read 3132 times)

0 Members and 1 Guest are viewing this topic.

double_you

  • Newbie
  • *
  • Posts: 4
    • View Profile
Resize Event on window create
« on: June 27, 2011, 04:08:07 am »
I don't understand how the following example is resizing the opengl viewport:

http://www.sfml-dev.org/tutorials/1.6/window-opengl.php

When creating a window a resize event isn't generated, so glViewport isn't called; however, the example runs correctly.

I'm using SFML 1.6 on Linux.

Any clarification would be greatly appreciated.

Steve.

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Resize Event on window create
« Reply #1 on: June 27, 2011, 04:35:29 am »
glViewport is called when the window is first created.
I use the latest build of SFML2

double_you

  • Newbie
  • *
  • Posts: 4
    • View Profile
Resize Event on window create
« Reply #2 on: June 27, 2011, 05:00:44 am »
Cheers for the reply. But where in the documentation does it say glViewport is called when the window is created? I'm getting strange behaviour in my own program that I'm trying to diagnose.

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Resize Event on window create
« Reply #3 on: June 27, 2011, 05:46:40 am »
Quote from: "double_you"
Cheers for the reply. But where in the documentation does it say glViewport is called when the window is created? I'm getting strange behaviour in my own program that I'm trying to diagnose.
It doesn't say it in the documentation. Also, what is this strange behavior you're getting?
I use the latest build of SFML2

double_you

  • Newbie
  • *
  • Posts: 4
    • View Profile
Resize Event on window create
« Reply #4 on: June 27, 2011, 05:59:50 am »
I'm using SFML with opengl and a gui created with CEGUI. When I run my program creating a window doesn't call glViewport (I set a breakpoint to confirm this) so none of my gl calls get displayed. Note that CEGUI does set glViewport internally so it is displayed.

If I use the mouse to resize the window a resize event occurs and glViewport is called, and everything works correctly. Another workaround is to manually call glViewport after creating the window; however, I would like to pinpoint the cause of the problem, rather than hacking in a solution.

Steve.

double_you

  • Newbie
  • *
  • Posts: 4
    • View Profile
Resize Event on window create
« Reply #5 on: June 27, 2011, 06:15:32 am »
I just ran the example with a breakpoing on glViewport and it seems the example isn't calling it. I thought that was required, but I guess the default viewport works correctly with the example, but not my application.

 

anything