Aethedigm
Aethedigm

Reputation: 25

wglCreateContextAttribsARB not defined?

C++ application, I define a temp context, make it current, and then try to use wglCreateContextAttribsARB, which is simply undefined. Most answers I have seen say to use PFNWGLCREATECONTEXTATTRIBSARBPROC. Which is also undefined. What am I missing?

I'm only using gl.h (provided by VS2015)

    SetPixelFormat(g_hDc, chosenPixelFormat, &pfd);
    HGLRC temporaryContext = wglCreateContext(g_hDc);
    wglMakeCurrent(g_hDc, temporaryContext);
    PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB...

Both, however, are just unidentified. I initially tried calling wglCreateContextAttribsARB by itself, to no avail, anywhere in my code.

At this stage, I have a context working, windowed, 480p, updating, stable 60FPS. So I know my side is working. I'm getting no GL errors either. Where do I need to instantiate these two? Am I using the wrong gl header?

I'm using an updated ASUS Radeon R9-285

Upvotes: 0

Views: 3798

Answers (1)

derhass
derhass

Reputation: 45332

All data types and constants related to wgl extensions are declared in wglext.h.

You need to query the function pointer of type PFNWGLCREATECONTEXTATTRIBSARBPROC using your current context via the GL extension mechansim (e.g. wglGetProcAddress()).

Upvotes: 1

Related Questions