Results 1 to 8 of 8

Thread: Is it C or C++ or what is this?

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2009
    Location
    United Kingdom
    Posts
    10

    Is it C or C++ or what is this?

    Hi, this is a very noob question, I am searching this question in google but no clear anwser, so I decide to ask the forum

    So can you explain how the opengl language works, I dont understand if this is C or C++, or how that works

    Many thanks
    rS

  2. #2
    Member Contributor
    Join Date
    Jun 2009
    Posts
    60

    Re: Is it C or C++ or what is this?

    What made u think of this question .. Ofcourse it is in C++...

  3. #3
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: Is it C or C++ or what is this?

    opengl language : do you mean the shading language, GLSL ? or the OpenGL API it self ?
    The GL API is defined as C, but easily compatible with all sorts of other languages.
    http://www.opengl.org/wiki/Getting_s...OpenGL_Program

  4. #4
    Junior Member Newbie
    Join Date
    Sep 2009
    Location
    United Kingdom
    Posts
    10

    Re: Is it C or C++ or what is this?

    Thanks ZbuffeR, well know I wonder both GLSL and OpenGL API? you said OpenGL is C how about GLSL? from that article I understand I can pick any programming language, but what I dont understant is if OpenGL is C, and I want to use PASCAL how they manage to work together?

    Other people please dont post if you are not going to help, if you think this is a stupid question, just skip it

    Cheers
    rS

  5. #5
    Senior Member Regular Contributor
    Join Date
    Mar 2007
    Location
    CA
    Posts
    408

    Re: Is it C or C++ or what is this?

    OpenGL is an API not to be confused with GLSL which is not.

    GLSL is an internal language that is C-like. It is not compiled with an external compiler like Pascal, C, C++, etc. It is only used to write graphics shaders; vertex, fragment, and geometry shaders. These do very specific things related only to the graphics pipeline. The key with GLSL is that it is compiled at RUNTIME by the openGL driver -- you write a string consisting of C-like GLSL commands and send that string to the driver using your favorite flavor of openGL API (C, C++, Pascal, Ruby, Perl, etc).

    If you are new to openGL, starting with shaders and the GLSL can be confusing. You will first need to simply use the openGL API. I am not a pascal user but a quick search led to a tutorial page that may be helpful to you using Pascal. Once you become familiar with using the openGL API in your favorite language (Pascal) you then can start to apply the GLSL C-like string to your graphics toolkit -- this will be controlled at the top level still by your openGL API Pascal code.


  6. #6
    Junior Member Newbie
    Join Date
    Sep 2009
    Location
    United Kingdom
    Posts
    10

    Re: Is it C or C++ or what is this?

    Thanks marshats, I am not a Pascal fan, I just mention it to illustrate my question

    This OpenGL stuff is starting to make more sence, I am a designer how likes to code, and now I want to learn this more advance programming languages, it is all a bit confusing the first time...

    Cheers
    rS

  7. #7
    Senior Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    992

    Re: Is it C or C++ or what is this?

    OpenGL is not a programming language, it is an API, aka a set of types, constants, functions and stuff like that.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  8. #8
    Senior Member Regular Contributor
    Join Date
    Apr 2009
    Posts
    171

    Re: Is it C or C++ or what is this?

    and OpenGL is also available for many languages(ie c,c++,java,python).
    and
    if you don't know API
    API means Application programming interface
    OpenGL
    M3G (may be)
    Mascot Capsule (hi)
    DirectX...and
    as much you can count
    yes it looks Non OpenGL but may help the new user
    haven't made a game [img]<<GRAEMLIN_URL>>/frown.gif[/img]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean