GLUT Resizing and Focusing

This is a discussion on GLUT Resizing and Focusing within the Game Programming forums, part of the General Programming Boards category; I was wondering if there is a way with GLUT to make the window non-resizable...My whole program gets messed up ...

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    47

    GLUT Resizing and Focusing

    I was wondering if there is a way with GLUT to make the window non-resizable...My whole program gets messed up when it is resized. If there isn't, I'll probably find some way to change the coordinate system when the window is resized.

    Also, I made a program where you click in the OpenGL window, and points are made where you clicked. But when I focus onto another window, and focus back to the GLUT one, all my dots I made are gone. And when I minus out the program, I get an error message, and it tells me to end the task. Any suggestions?

    Thanks!

    PS
    I am using a single buffer!!! I don't think a second one is needed, because no animation is used in my program.

  2. #2
    User
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    498
    I am using a single buffer!!! I don't think a second one is needed, because no animation is used in my program.
    I think you should. If you constantly swap and redraw, you won't have the problem of dots erasing when you change the window's focus.

    Sorry I don't know of a way to prevent window resizing (try using the Win API). EDIT: oops sorry that would take away the point of using glut

  3. #3
    Registered User
    Join Date
    Jun 2006
    Posts
    47
    Okay. But I'm not so good at double buffers...How do you clear both of them?
    Windows XP Service Pack 2
    Borland C++ Compiler Version 5.5

  4. #4
    User
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    498
    Use glutSwapBuffers() to swap them, and then use glClearColor() to clear the current one. It's really easy.

  5. #5
    Registered User
    Join Date
    Jun 2006
    Posts
    47
    Okay. Thanks!
    Windows XP Service Pack 2
    Borland C++ Compiler Version 5.5

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21