wglMakeCurrent failed with error code ERROR_TRANSFORM_NOT_SUPPORTED (2004)

158 views
Skip to first unread message

Mohammed El-Dana

unread,
Jul 25, 2015, 2:06:27 PM7/25/15
to skia-discuss

I'm creating an MFC application that uses skia for rendering.


Now when I call wglMakeCurrent with no scroll (Scroll position is 0, 0) it works fine.

But when I change the scroll position, calling wglMakeCurrent failed and GetLastError returns 2004.

Note: My view is inherited from CScrollView


Here is the sample I'm using in OnDraw:


HDC hdc
= pDC->m_hDC;

fHGLRC
= SkCreateWGLContext(hdc, 0, kGLPreferCompatibilityProfile_SkWGLContextRequest);

         
if (wglMakeCurrent(hdc, fHGLRC))

         
{

           
const GrGLInterface* fInterface = GrGLCreateNativeInterface();




            fContext
= GrContext::Create(kOpenGL_GrBackend, (GrBackendContext)fInterface);

           
{

               
GrBackendRenderTargetDesc desc;

               desc
.fWidth = 2000;

               desc
.fHeight = 3000;

               desc
.fConfig = kSkia8888_GrPixelConfig;

               desc
.fOrigin = kBottomLeft_GrSurfaceOrigin;

               
GrTextureProvider* provider = fContext->textureProvider();

               fRenderTarget
= provider->wrapBackendRenderTarget(desc);

           
}

            surface
= SkSurface::NewRenderTargetDirect(_fRenderTarget);
           
//Do Draw Stuff
            surface
->getCanvas();
           
....etc


Brian Salomon

unread,
Jul 27, 2015, 8:25:47 AM7/27/15
to skia-discuss
I don't really know anything about MFC, but perhaps you're using windows APIs that aren't compatible with a OpenGL backed window?

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

Mohammed El-Dana

unread,
Jul 28, 2015, 1:14:02 PM7/28/15
to skia-discuss, bsal...@google.com
Thanks for your response, I found the problem, the problem caused by the cscrollview, I change it to cview and handled the scrolling manually (Translate).
Reply all
Reply to author
Forward
0 new messages