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

Thread: How to display items without using glutDisplayFunc()? What exactly does its code do?

  1. #1
    Newbie Newbie
    Join Date
    Aug 2014
    Posts
    2

    How to display items without using glutDisplayFunc()? What exactly does its code do?

    Hi guys, I'm new to programming and OpenGL. I try to understand from the ground. Most tutorials I've read so far are based on glut. I'm wondering how to write codes without using glut? What exactly do those functions do?

    For example, I've defined a display() function. If I use glut I can simply write "glutDisplayFunc(display); glutMainLoop();" in the main() function to call the display(). But if I do not use glut, what should I do? What do the code look like?

    If I work on a MFC/Qt project, there is no main() function. What should I do?

    Thanks!

  2. #2
    Intern Contributor
    Join Date
    Jul 2014
    Location
    Italy, Lissone
    Posts
    50
    Quote Originally Posted by loonger View Post
    Hi guys, I'm new to programming and OpenGL. I try to understand from the ground. Most tutorials I've read so far are based on glut. I'm wondering how to write codes without using glut? What exactly do those functions do?

    For example, I've defined a display() function. If I use glut I can simply write "glutDisplayFunc(display); glutMainLoop();" in the main() function to call the display(). But if I do not use glut, what should I do? What do the code look like?

    If I work on a MFC/Qt project, there is no main() function. What should I do?

    Thanks!
    All this glut functions are needed to create a context, otherwise you should use windows api or the one for linux, i think they are x windows but, the point is that using (or glfw or whatever library you want to use) avoids you tens of lines of code.

    This is not in modern opengl but you' ll get the idea:
    http://nehe.gamedev.net/tutorial/cre...(win32)/13001/

    About Qt i'm not the right person since i never use it, you should try searching on google a tutorial on how to create a context in Qt

  3. #3
    Newbie Newbie
    Join Date
    Aug 2014
    Posts
    2
    Thanks Ruggero.

  4. #4
    Intern Contributor
    Join Date
    Jul 2014
    Location
    Italy, Lissone
    Posts
    50
    Quote Originally Posted by loonger View Post
    Thanks Ruggero.
    you're welcome

Posting Permissions

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