CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    May 2011
    Posts
    5

    VC++ and OpenGL 3

    Hi folks,

    Just planning to start coding using Visual C++ 2008 for some graphics drawing on a small project, one of my hobbies actually. Got books about OpenGL programming guide, C++ programming and a few others.

    The hardware is Intel Q6600 and ATI Raedon 4870 1GB, know it's not a top end setup but i just need it to do some static graphics objects so should be okay.


    The OS is Vista, again know it's not the best OS out there but can't afford to upgrade at the moment so live with it.


    Got a bit rusty on VC++ and my first time to use OpenGL, where do I download OpenGL and how do I call the various commands?

    Appreciate for your help

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    Re: VC++ and OpenGL 3

    VC++ installation contains Microsoft OpenGL implementation for Windows. You don't need to download anything, just start coding.
    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx

  3. #3
    Join Date
    Jul 2002
    Posts
    2,543

  4. #4
    Join Date
    May 2011
    Posts
    5

    Re: VC++ and OpenGL 3

    Alex

    I followed your pointers, found this one -> http://www.codeproject.com/KB/openGL...wWithGLUT.aspx

    and it draws even though my VC++ is 2008 version.

    I followed the setup instructions there which involves moving 3 files

    glut32.dll -> C:\Windows\Systems32
    glut32.lib -> C:\Program Files\Microsoft Visual Studio 9.0\VC\lib
    glut32.h -> C:\Program Files\Microsoft Visual Studio 9.0\VC\include\gl

    and it works!!!

    So let me understand this correctly, wihtout glut32.h and glut32.lib, the VC++ compiler won't pass obviously. Without glut32.dll, the program won't run, am I correct?

    Next question is what is the most current version of this glut32 set of files?

    I thought ATI graphics driver comes with these OpenGL files, apparently it is not...

  5. #5
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: VC++ and OpenGL 3

    GLUT is not a part of OpenGL proper. It is a dead-simple windowing environment which is often used for "My first OpenGL program" purposes. Just about any windowing environment can be used for OpenGL if you prefer (MFC, GTK+, QT, etc).

    http://www.opengl.org/resources/libraries/glut/
    http://www.opengl.org/resources/libr...indowtoolkits/

  6. #6
    Join Date
    May 2011
    Posts
    5

    Re: VC++ and OpenGL 3

    Quote Originally Posted by Lindley View Post
    GLUT is not a part of OpenGL proper. It is a dead-simple windowing environment which is often used for "My first OpenGL program" purposes. Just about any windowing environment can be used for OpenGL if you prefer (MFC, GTK+, QT, etc).

    http://www.opengl.org/resources/libraries/glut/
    http://www.opengl.org/resources/libr...indowtoolkits/
    I am working on a Ray Tracing project, last time I did it was in Pascal back in 1988 using Whitted algorithm. I know it has been a while back. Now I want to do it again with a new language which I've chosen Visual C++.

    I am new to all these and I want to set up a proper environment so that I can use C++ to implement the algorithm, and OpenGL to draw objects.

    Any pointers will be highly appreciated.
    THANKS!

  7. #7
    Join Date
    Jul 2002
    Posts
    2,543

    Re: VC++ and OpenGL 3

    Just to learn OpenGL, without wasting time on Win32 programming, MFC and any other UI framework, you can use GLUT.
    To make a real program, you need to decide which UI framework you want to use: Win32 API, MFC, Qt, .NET etc. Then look for OpenGL resources for selected environment.
    For MFC, there are ready for use Application Wizards, which create basic MFC program with OpenGL support. You can see the link to one of them in my previous post.

  8. #8
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: VC++ and OpenGL 3

    OpenGL may not be ideally suited to ray tracing, unless you're specifically attempting to do ray tracing on the GPU (which is a relatively new area of research made possibly by recent GPGPU language developments). For standard ray tracing algorithms, the only thing you need the GPU to do is display the computed image; most computation, particularly for student projects, will be done on the CPU. Simply displaying an image can be done much more easily with something like HighGUI than via GLUT/OpenGL.

  9. #9
    Join Date
    May 2011
    Posts
    5

    Re: VC++ and OpenGL 3

    Quote Originally Posted by Lindley View Post
    OpenGL may not be ideally suited to ray tracing, unless you're specifically attempting to do ray tracing on the GPU (which is a relatively new area of research made possibly by recent GPGPU language developments). For standard ray tracing algorithms, the only thing you need the GPU to do is display the computed image; most computation, particularly for student projects, will be done on the CPU. Simply displaying an image can be done much more easily with something like HighGUI than via GLUT/OpenGL.
    You're probably right. Just a student project, difference being an Apollo workstation in 1988 and now we're talking about a PC with a faster GPU.

    I also want to take this chance to learn translating the algorithm and the mathematics into codings, as to what type of codings I really not quite sure which is the best between C++ and Java, because I also heard that Java can do 3D graphics.

    I agree that most of the computational work will be coded in either C++/OpenGL or Java/Java3D, and the display work will be done by the GPU.

    I also want to avoid Win32 API and .NET because they are new to me, last time I did programming on the job was 15 years ago with C, Oracle and Unix scripts LOL

    What you advise me to do if openGL is too much for ray Tracing?Thanks~!!!

  10. #10
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: VC++ and OpenGL 3

    It's not that OpenGL is too much for ray tracing; it's just that the type of computation it's good at isn't exactly the same as the type of computation needed for ray tracing.

    The first ray is simple enough; in fact, that's just a plain old OpenGL render. The problem comes when you try to incorporate shadow rays, reflection rays, transmission rays, etc. It's possible to do these on the GPU; in fact, if you use a shader language like OpenCL or CUDA, it's not even particularly strenuous. But entry-level OpenGL won't do it easily.
    Last edited by Lindley; May 10th, 2011 at 02:36 PM.

  11. #11
    Join Date
    Jul 2002
    Posts
    2,543

    Re: VC++ and OpenGL 3

    AFAIK, we are talking about GPU programming, shaders and OpenCL when we need to get very high performance. If we just need to make work done (I guess this is the case), it is OK to make all computations in CPU and use plain OpenGL rendering.
    I suggest to use GLUT to get some results. Later, if you make your program look professional, think about some UI framework.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured