cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

brus62
Adept I

WGL_ARB_create_context

Hi, I try to create an OpenGL 3.1 forward compatible rendering context with wglCreateContextAttribsARB.

I use this tokens :

  WGL_CONTEXT_MAJOR_VERSION_ARB, 1,

  WGL_CONTEXT_MINOR_VERSION_ARB, 0,

  WGL_CONTEXT_FLAGS_ARB,

because my application  is written in OpenGL 1.1.

With the last version of the driver I dont get error but the context in not created and nothing is drawn..with the old version works fine but when I try to activate the HiddenLine then application crash in atioglxx.dll ( I suppose glPolygonOffset is the problem )

With other graphics card everything works fine.

Can anyone give me a hint?

Thanks in advance.

Best regards

4 Replies
gsellers
Staff

I'm not sure what your intent here is, but those flags don't seem right. You need these flags:

WGL_CONTEXT_MAJOR_VERSION_ARB, 3,

WGL_CONTEXT_MINOR_VERSION_ARB, 1,

WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,

0

Don't forget the terminating zero.

If context creation fails, all bets are off. The driver may be crashing because you don't have a valid context.

Graham

0 Likes

Hello Graham,

thanks for your reply.

If I use this flags the context are created but nothing is drawn.. my

code is :

int attribList[] =

{

WGL_CONTEXT_MAJOR_VERSION_ARB, 1,

WGL_CONTEXT_MINOR_VERSION_ARB, 0,

WGL_CONTEXT_FLAGS_ARB,

0

};

HGLRC supported = NULL;

PFNWGLCREATECONTEXTATTRIBSARBPROC wglGetContext =

(PFNWGLCREATECONTEXTATTRIBSARBPROC)

wglGetProcAddress("wglCreateContextAttribsARB");

if (wglGetContext)

supported = ((HGLRC(__stdcall)(HDC,HGLRC, const int

attribList))wglGetContext)(DC, 0, attribList);

if (!wglGetContext) {

strcpy(message,"wglMakeCurrent() failed for OpenGL 1.1

context.");

MessageBox(this->Handle,message,"ATTENZIONE",

MB_ICONERROR | MB_APPLMODAL);

return(0);

}

if (!(GLDC = wglGetContext(DC, 0, attribList))) {

strcpy(message,"wglCreateContextAttribsARB() failed for

OpenGL 1.1 context.");

MessageBox(this->Handle,message,"ATTENZIONE", MB_ICONERROR

| MB_APPLMODAL);

return(0);

}

........ and also in ATI Radeon graphics card works with old driver...

except when I try to activate the HiddenLine : then application crash in

atioglxx.dll ( I suppose glPolygonOffset is the problem ).

With the latest version of driver application don't send error message

but don't work ( black screen )

Il 19/03/2014 03.18, gsellers ha scritto:

>

AMD Developer Forums <http://devgurus.amd.com/?et=watches.email.thread>

>

WGL_ARB_create_context

in /Graphics Programming/

0 Likes

You don't need to create a version 1,0 context. (which is apparently not even possible) to use 1.x features. Passing no flags at all should give you a compatibility context which will handle your 1.1 code fine.

0 Likes

exact, thanks for your answer

Il 08/04/2014 13.30, eodabash ha scritto:

>

AMD Developer Forums <http://devgurus.amd.com/?et=watches.email.thread>

>

WGL_ARB_create_context

in /Graphics Programming/

0 Likes