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

Thread: GNU C++

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2002
    Location
    Toronto
    Posts
    9

    GNU C++

    Hello, I'm new here!

    Anyways, I'm currently in University and we use GNU C/C++ to do most of our assignments. I want to start learning about 3d programming and I was just wondering if I could use the OpenGL to create graphics using GNU C\C++? There's a graphics library called Allegro taht I was playing around with once, but I want to learn OpenGL. If someone can explain to me how I can get started I'd appreciate it.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: GNU C++

    What platform are you using that on? The university I graduated from had RedHat Linux installed on some machines, and they actually had the OpenGL headers and libraries installed. I think the only reason they were installed was because the graphics programming class used VTK, which I think might rely on OpenGL underneath. Anyway, if you are on a Linux platform do something like so to find out if the OpenGL libraries are present..

    locate libGL
    locate gl.h

    Or try and look in /usr/include/GL, /usr/lib, etc...

    At home, I have a Suse box and I had to grab all the OpenGL development packages and setup the nVidia graphics drivers. (My Linux box has a GeForce 256)
    Deiussum
    Software Engineer and OpenGL enthusiast

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2002
    Location
    Bla,bla
    Posts
    12

    Re: GNU C++

    Hello,
    on Linux you have free OGL implementation called Mesa (www.mesa3d.org); and on Windows you have nicely GNU C/C++ port called MinGW (www.mingw.org).
    In MinGW case, you get needed OGL libray, only you need to download .h files (they can be found on the net).
    Also if you want to use Mesa on win, compiling will be easy with MinGW.

    Sanel
    SZ.

  4. #4
    Senior Member Frequent Contributor marcus256's Avatar
    Join Date
    Aug 2001
    Location
    Sweden
    Posts
    764

    Re: GNU C++

    For a good (?) overview of compilers and OpenGL drivers for Windows and Unix (e.g. Linux) go to http://hem.passagen.se/opengl/getstarted/ I use MinGW (GNU C/C++) under Windows. On the page you will find OpenGL includes that work with MinGW. You can also use Cygwin (another GNU C/C++ port for Windows) if you want.

    If you're just getting started with OpenGL, also check out GLFW , which is very helpful for setting up an OpenGL display.
    Most Linux distributions come with Mesa 3D (an OpenGL work-alike implemented in software), but there are also hardware accelerated OpenGL implementations available for Linux (see the drivers section on the above mentioned page).

  5. #5
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: GNU C++

    Hi !

    Are you using GNU C++ on Linux/UNIX or on Windows (MinGW32) ?

    Mikael

  6. #6
    Junior Member Newbie
    Join Date
    Apr 2002
    Location
    Toronto
    Posts
    9

    Re: GNU C++

    I'm using it on Windows.

    When I take a course on computer graphics next year I'll be using it on Unix, but I want to learn some stuff on my own over the summer.

  7. #7
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: GNU C++

    Ok, so the next question would be how are you using it in Windows. Mingw, Cygwin, or some other way?

    Cygwin comes with the OpenGL headers, but if I remember right, you have to build the libraries from the DLL. (And I can't remember how to do that offhand.)
    Deiussum
    Software Engineer and OpenGL enthusiast

  8. #8
    Junior Member Newbie
    Join Date
    Apr 2002
    Location
    Toronto
    Posts
    9

    Re: GNU C++

    I compile my code in DOS.

  9. #9
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: GNU C++

    Ok, well... Here's the problem... DOS doesn't come with a GNU compiler. There are a number of implementations of GNU compilers for Windows. Each of these implementations has somewhat unique characteristics when it comes to libraries and headers available. In order to help you setup GNU to compile OpenGL, we need to know what implementation you are using.
    Deiussum
    Software Engineer and OpenGL enthusiast

  10. #10
    Senior Member Frequent Contributor marcus256's Avatar
    Join Date
    Aug 2001
    Location
    Sweden
    Posts
    764

    Re: GNU C++

    For Windows, you can choose either MinGW32 or Cygwin . I use MinGW (the primary reason is that it generates native Windows executables, whereas Cygwin compiled executables need a special DLL).

    Cygwin comes with both libraries and headers for OpenGL (at least I was able to compile OpenGL programs with Cygwin without doing anything special).

    MinGW comes with the libraries, but not the headers at the moment. Soon there will be OpenGL 1.3 headers included in the MinGW distribution, but for now you can find headers here .

    For DOS (now I'm talking about pure MS-DOS, not a command prompt under Windows), there is DJGPP. It generates 32-bit DOS programs. I'm not sure if you can write win32 programs with it, or use win32 DLLs (e.g. opengl32.dll). AFAIK the only way to run OpenGL apps under DOS is to use Mesa3D (which has a DOS driver).

    Just to clarify: both the Cygwin and MinGW32 versions of gcc are accessed from a Windows command prompt (or MS-DOS prompt). This does NOT mean that they are DOS programs though (they will not run under DOS, only under Windows).


    [This message has been edited by marcus256 (edited 04-18-2002).]

Page 1 of 2 12 LastLast

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