How to add OpenGl in C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Xillez
    New Member
    • Jul 2013
    • 93

    How to add OpenGl in C++

    hi again, What file should I include for a OpenGl plugin for Code::Blocks?

    Error: File not found in directroy

    Newly made file(didn't write this):

    Code:
    #include <windows.h>
    #include <gl/gl.h>
    
    LRESULT CALLBACK WindowProc(HWND, UINT, WPARAM, LPARAM);
    void EnableOpenGL(HWND hwnd, HDC*, HGLRC*);
    void DisableOpenGL(HWND, HDC, HGLRC);
    
    
    int WINAPI WinMain(HINSTANCE hInstance,
                       HINSTANCE hPrevInstance,
                       LPSTR lpCmdLine,
                       int nCmdShow)
    {
        WNDCLASSEX wcex;
        HWND hwnd;
        HDC hDC;
        HGLRC hRC;
        MSG msg;
        BOOL bQuit = FALSE;
        float theta = 0.0f;
    
    pluss some more non-important code...
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    OpenGL has header files and library files.

    You need to:
    1) locate the all files on your hard disc
    2) add the paths to these files to your compilers pre-defined path list
    3) add the libraries to your compiler's project
    4) #include the header files. Probably, if you path is pre-defined, then you #include is probably just #include <header.h> rather than a partial path between the brackets.

    Comment

    • Xillez
      New Member
      • Jul 2013
      • 93

      #3
      ok, thanks, but found an installer that does it for me... so everything works, but thanks for the instruction...

      X

      Comment

      Working...