Thread: OpenGl and C

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    10

    Question OpenGl and C

    I'm not really familiar with OpenGL but I m curious if OpenGl can be used with only C, without C++?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Yes.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Quote Originally Posted by Salem View Post
    Yes.
    Right to the center of the question, eh?
    Devoted my life to programming...

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > Right to the center of the question, eh?
    Yes.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Quote Originally Posted by Salem View Post
    > Right to the center of the question, eh?
    Yes.
    No comments? Nothing you want to express?
    Devoted my life to programming...

  6. #6
    Registered User
    Join Date
    Nov 2010
    Posts
    10
    Thanks a lot for the reply. Sorry but I will have to bother you with another question: I have started learning OpenGL on OpenGL Video Tutorial - Home but I came to the section for textures and there the image is loaded into a class(c++) and is said that that's the format OpenGL "likes" the images. Is this true or can it be done some other way in c?

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    The file formats have nothing to do with whether you use C or C++.

    Like I said, the whole API is C based.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    Registered User
    Join Date
    Nov 2010
    Posts
    10
    I think you misunderstood me, but so did I misunderstood the tutorial. What I meant was the format into what you load the image( I mentioned the class). I misunderstood the tutorial and though that all images had to be loaded into a class, but the tutorial was reffering to an array of pixels which is than along with other parameters passed to a function that turns it into a texture.

    Sorry for not being clear enough.

Popular pages Recent additions subscribe to a feed