5 Replies Latest reply on Apr 10, 2014 2:26 AM by brus62

    WGL_ARB_create_context

    brus62

      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

        • Re: WGL_ARB_create_context
          gsellers

          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

            • Re: WGL_ARB_create_context
              brus62

              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/