windowsopenglmingwwgl

Finding WGL with MinGW


I've wrote an adequate little program in C that creates a window. However, I'm having trouble adding the OpenGL rendering context and assorted functions to it.

GetDC, ChoosePixelFormat, SetPixelFormat -- all wgl functions, as I understand it. I thought these may be specific to Visual C++, but this does not seem to be the case -- unless they've been radically altered to be C++ only; the amount of errors, compared to MinGW, is stunning.

Where can I find WGL? How can I add it to MinGW?

(Slightly related sourcecode can be found here: http://pastebin.com/eMWLqL6h )


Solution

  • Downloading and installing the following libraries into MinGW/lib resolved all issues:

    win32api wing32 GDI GDI32 GDIPLUS OpenGL opengl32

    These are called in order by gcc. No longer are there undefined or contradictory define errors.

    Headers then need only be: GL/gl.h windows.h