person23
2003.03.27, 01:50 PM
Hallo Experts,
I have a Question to Bitmap-Rendering!
I am rendering some thing on a Bitmap (I must not use a Window).
But when I whant to render some thing new on the bitmap nothing happens.
Becaus the bitmap has no backroundbuffer I can not swap the buffers (understandable).
How can I handle this Proplem?
I think I have forgotten something smal linke "MakeCurrent" or something like that
Please have a look at me code:
hdc= .... (from a bitmap)
PIXELFORMATDESCRIPTOR pfd = {.... , PFD_DRAW_TO_BITMAP , ...};
SetPixelFormat(hdc,ChoosePixelFormat(hdc, &pfd),&pfd))
hrc = wglCreateContext(hdc);
wglMakeCurrent(hdc, hrc);
glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glColor3b(0,0,100);
glBegin(GL_POLYGON);
glVertex3f(-1,-1,0);
glVertex3f(1,-1,0);
glVertex3f(1,1,0);
glVertex3f(-1,1,0);
glEnd();
glFlush();
//************************************************** ****************
// Until here I have no Problem!!!!!!!!!!!!!!!
// The bitmap has changed!
// But when I want to render something new onto the bitmap
// nothing changes in the bitmap
//************************************************** ****************
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3b(50,50,50);
glBegin(GL_POLYGON);
glVertex3f(0,0,0);
glVertex3f(1,0,0);
glVertex3f(1,1,0);
glVertex3f(0,1,0);
glEnd();
Who can help me?
Thanks!!!!!!!!!!!!!!!!!!
I have a Question to Bitmap-Rendering!
I am rendering some thing on a Bitmap (I must not use a Window).
But when I whant to render some thing new on the bitmap nothing happens.
Becaus the bitmap has no backroundbuffer I can not swap the buffers (understandable).
How can I handle this Proplem?
I think I have forgotten something smal linke "MakeCurrent" or something like that
Please have a look at me code:
hdc= .... (from a bitmap)
PIXELFORMATDESCRIPTOR pfd = {.... , PFD_DRAW_TO_BITMAP , ...};
SetPixelFormat(hdc,ChoosePixelFormat(hdc, &pfd),&pfd))
hrc = wglCreateContext(hdc);
wglMakeCurrent(hdc, hrc);
glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glColor3b(0,0,100);
glBegin(GL_POLYGON);
glVertex3f(-1,-1,0);
glVertex3f(1,-1,0);
glVertex3f(1,1,0);
glVertex3f(-1,1,0);
glEnd();
glFlush();
//************************************************** ****************
// Until here I have no Problem!!!!!!!!!!!!!!!
// The bitmap has changed!
// But when I want to render something new onto the bitmap
// nothing changes in the bitmap
//************************************************** ****************
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3b(50,50,50);
glBegin(GL_POLYGON);
glVertex3f(0,0,0);
glVertex3f(1,0,0);
glVertex3f(1,1,0);
glVertex3f(0,1,0);
glEnd();
Who can help me?
Thanks!!!!!!!!!!!!!!!!!!