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 2 of 2

Thread: opengl window creation and use

  1. #1
    Guest

    opengl window creation and use

    Im fairly new to opengl, I am creating a program which is similar to a simple flight simulator. The only way I know how to create a window to display the vehicles on screen is by using GLUT. Using this i can easily display what is required however, this has a major limitation for my program, i need to have the window system to being essentially a slave to the main program which calculates movement etc. With glut i only seem to be able to have glut as the main program and run the calculations using glutIdleFunc() which is very wasteful and slow for the calculation problem. Can anyone help and suggest a solution or alternative to glut for this problem?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Dresden, Sachsen, Germany
    Posts
    205

    Re: opengl window creation and use

    why not try "native" opengl via win32
    this throws glut away but is more windows involving
    basic steps:

    1. create a normal win32 app
    fill WNDCLASS structure
    register WNDCLASS structure -RegisterClass()
    create Window - CreateWindow()
    setup Main MessageLoop - PeekMessage()...
    2. do the wgl stuff
    fill PIXELFORMATDESCRIPTOR structure
    find a pixelformat - ChoosePixelformat()
    set this pixelformat - SetPixelFormat()..
    create rendering context - wglCreateContext()
    make it current - wglMakeCurrent()...
    3. Do your stuff

    CU
    for the pixelformat stuff look into your compilers help under PIXELFORMATDESCRIPTOR

Posting Permissions

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