Thread: RoD's opengl programming tutorial

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    6

    RoD's opengl programming tutorial

    Is there anything that i need for RoD's opengl programing tut that isnt already included in the bloodshed dev-C++ compiler or do i need a differnt compiler all together

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    This has come up before but bears repeating. The tutorial was unfortunately written for msvc++ and #includes one-non-standard, ms specific header that's actually not required for the examples anyway (#include "stdafx.h"). It also uses, again unnecessarily, a #pragma directive(#pragma comment(linker, "/subsystem:windows"). Just remove them and I think you should be okay. If not, post again but please provide either a link to the tutorial in question or post the problematic code.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    The OpenGL libs aren't "already included" with Dev-C++, at least I don't think they are; you'll have to download them. There's probably a DevPak for OpenGL.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>The OpenGL libs aren't "already included" with Dev-C++<<

    No, opengl libs have been supplied with dev-cpp since at least v4.01(mingw 295.x) - ie. years before the current version.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  5. #5
    Registered User
    Join Date
    Oct 2005
    Posts
    6
    thanks

  6. #6
    Registered User
    Join Date
    Oct 2005
    Posts
    6
    here's the link to the tut
    http://www.cprogramming.com/tutorial...ojections.html
    Do i need any libraries and if so were should they be placed?

  7. #7
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    You only need to link with the required opengl libraries: project menu --> project options, select 'parameters' tab and add the following to the 'linker' field:
    Code:
    -lopengl32
    -lglu32
    -lglut
    -lglaux
    in the project options dialog.

    edit:

    Actually, you'll also need to remove all those #pragma statements. In fact, the opening few lines should look like this:
    Code:
    #define WIN32_LEAN_AND_MEAN
    
    //#pragma comment(lib, "opengl32.lib")
    //#pragma comment(lib, "glu32.lib")
    //#pragma comment(lib, "glaux.lib")
    //#pragma comment(linker, "/subsystem:windows")
    
    //#include "stdafx.h"
    #include <windows.h>                                    // standard Windows app include
    //#include <winuser.h>          // Windows constants
    #include <gl/gl.h>                                              // standard OpenGL include
    #include <gl/glu.h>                                             // OpenGL utilties
    #include <glut.h>                                       // OpenGL utilties
    
    #define WND_CLASS_NAME  "OpenGL Window Class"
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Error I have in OpenGL tutorial on this site.
    By Nirdop in forum C++ Programming
    Replies: 4
    Last Post: 07-25-2006, 03:03 PM
  2. Compiling issue with the OpenGL tutorial by RoD
    By Twitchmokey in forum Game Programming
    Replies: 12
    Last Post: 06-26-2006, 06:05 PM
  3. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  4. Problem with OpenGL tutorial
    By 2Biaz in forum Windows Programming
    Replies: 18
    Last Post: 09-16-2004, 11:02 AM
  5. Better OpenGL tutorial?
    By ShadowMetis in forum C++ Programming
    Replies: 2
    Last Post: 03-11-2004, 06:38 PM