Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Opengl coding

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2013
    Posts
    27

    Opengl coding

    When I run a code it has a place where you can render polygons in it.

    You can render them using opengl standards or it is different due the windowing aplication (glut, glfw, freeglut.. i use glfw) that i use?

    Also can I code programs with glfw in c++

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    716
    I'm afraid I don't quite understand what you are asking for, but I think you should read one of the tutorials linked from the wiki.

    OpenGL does not care what windowing toolkit you use, you only need to be able to create an OpenGL context. How the context is created depends on your OS and/or (for a cross platform toolkit) the toolkit.
    The default language bindings for OpenGL are for C and those are (as is the case with most C bindings) perfectly fine to use from C++, no additional libraries are needed. Bindings for many other languages exist as well.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2013
    Posts
    27
    I just mean that because ALL THE TUTORIALS ARE OUTDATED, they teach you with all versions of GLFW, with GLUT... I just wanted to know if apart of the windows context (that is specific, glfw, glut, freeglut), the rest is OPENGL standard.

    Because I want to use GLFW but due that there's no actual GLFW tutorial, I'm lost.

  4. #4
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    490
    Quote Originally Posted by Marc Colomé View Post
    I just wanted to know if apart of the windows context (that is specific, glfw, glut, freeglut), the rest is OPENGL standard.
    Yes.

    If you look at a tutorial which uses any of those toolkits, all of the functions which begin with "gl" or "glu" followed by an upper-case letter are part of OpenGL, not the toolkit. Those functions are available and work the same way regardless of the toolkit used. Functions beginning with "glut" or "glfw" are part of the toolkit.

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2013
    Posts
    27
    Thank you

    Do you know any complete working tutorial on the internet? Xoax ones work perfectly but they are very very basic.

    what do you think of: http://ogldev.atspace.co.uk/www/tuto...utorial22.html

    regards,


    marc

  6. #6
    Junior Member Newbie
    Join Date
    Jul 2013
    Posts
    27
    Also which version of GLEW is the one that only requires linking libraries and including headers, the source or the binaries? And If I have a 64bit pc can a 32bit binarie work?


    Programming in OpenGl is in C or in C++? If I want to program in C++ what I need to do?

  7. #7
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    716
    In order to do OpenGL programming in C++ you need to have some understanding of how (general) programming in C++ works, including how one uses external libraries. I'm not trying to be clever here, graphics programming is a huge topic and without a decent understanding of these basics everything becomes just more confusing.
    I'd really recommend working through one of the tutorials linked from the wiki, even if it uses glut (or some other toolkit that is not glfw), because once you've grasped how to do stuff with glut transitioning to glfw is not a huge step (well, your code changes, but the important concepts remain the same). There are tutorials that use C++ and show you the necessary steps (which are basically the same as for C, so using a C based tutorial should also work).

    You need a binary version of GLEW so that you can link your application against it. PCs with x86_64 CPUs (64bit) can run 32bit applications. You need to make sure your compiler produces 32bit code if you want to link your application against a 32bit library.

  8. #8
    Junior Member Newbie
    Join Date
    Jul 2013
    Posts
    27
    Thanks, the tutorial I mentioned uses old OpenGL (GL_TRIANGLES for example): http://ogldev.atspace.co.uk/

    Whats wrong if I learn that way?

    I can't find any tut more complete than that.


    Marc

  9. #9
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    716
    Uhm, GL_TRIANGLES is part of OpenGL 4.3 core profile, there is nothing old about it (in fact I would guess it is the most commonly used primitive type). The tutorial you linked to also uses buffer objects to store the data for rendering and uses shaders from part 4 forward, so seems to use the current techniques. The wiki page I linked to earlier distinguishes between pre/post OpenGL 3.0 tutorials and I would assume that the post OpenGL 3.0 tutorials all use core profile techniques (and therefore are more or less "modern OpenGL") or at least make it clear when they resort to compatibility profile stuff.

  10. #10
    Junior Member Newbie
    Join Date
    Jul 2013
    Posts
    27
    I didn't know it! I saw a article saying that they were jurassic coding (literally, it said that). do you think ogldev is a hard/dark tutorial? I understand medium to high c++ but this tutorials are hard to understand (the code and the text).

    Marc

Posting Permissions

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