Sign in to follow this  
Radu094

OpenGL Missing GL extensions on PFD_DRAW_TO_BITMAP ?

Recommended Posts

Hello ! A funny OpenGL problem : I've created a DIBSection that I use to render to from OpenGL. hBMP=CreateDIBSection(hGLContext,(BITMAPINFO* &BIH,DIB_RGB_COLORS,&m_pBits,NULL,0); Then I'm using PFD_DRAW_TO_BITMAP |PFD_SUPPORT_OPENGL |PFD_SUPPORT_GDI to choose the pixel format. Finally I'm creating the context and starting rendering in it. It works, in that I can get a lighted & textured object on it. When I check the glGetString(GL_EXTENSIONS) the only extensions returned are GL_WIN_swap_hint, GL_EXT_bg and GL_EXT_paletted_texture. The normal render context (the one rendering to the screen) acts "normally" and I can get all the extenstions I need. Just this one is missing. Is it because I'm rendering to memory that all the extensions are not avlb. ? Is DRAW_TO_BITMAP not HW accelerated ?

Share this post


Link to post
Share on other sites
Ouch... 'was afraid of that. Any ideeas what I can do about it to have a HW-accelerated drawing to memory?

thanks anyway...

Share this post


Link to post
Share on other sites
There isnt really much you can do, at best you could use the gfx card via a hidden window and copy back to system ram but this is also going to be a little slow (although probably faster than rendering via the MS SW OGL driver). The alternative is to try using the Mesa library which should be more optimised and contain more extensions, its still software but its better than the MS one.

Share this post


Link to post
Share on other sites
My graphics card has over 100 pixel formats and I enumerated them all.
There is no such thing as a hardware-accelerated PFD_DRAW_TO_BITMAP.


void
EnumerateAllPixelFormats(HDC hDC) {

int iMax;
PIXELFORMATDESCRIPTOR pfd;
int iPixelFormat;

iPixelFormat = 1;

do {
iMax = DescribePixelFormat( hDC, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd );
if (iMax == 0) {
break;
}
// Examine bits in pfd.dwFlags
}
while (++iPixelFormat <= iMax);
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this