Rendering on a Bitmap (Small Problem)
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!!!!!!!!!!!!!!!!!!
I doubt anyone can help you. This is a Macintosh programming forum, and that looks very much like a Windows problem.
Quote:Originally posted by OneSadCookie
I doubt anyone can help you. This is a Macintosh programming forum, and that looks very much like a Windows problem.
Ah yeah that is 100% pure windows code I know I just got done coding a choosepixelformat() and hdc is a handle to device context struct. Oh yeah winblows coding!! Do yourself a favor and go out and buy a Mac and throw that PCee in the trash!!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Bitmap fonts | markhula | 6 | 6,567 |
Feb 27, 2011 12:55 PM Last Post: markhula |
|
| Font rendering problem | wadesworld | 5 | 3,104 |
Mar 18, 2009 11:11 PM Last Post: AnotherJake |
|
| Bitmap font toolkit | Najdorf | 9 | 5,660 |
Nov 11, 2008 05:43 PM Last Post: Najdorf |
|
| Text rendering problem with VBOs on | myfeng | 9 | 4,913 |
Feb 29, 2008 04:54 PM Last Post: OneSadCookie |
|
| Bitmap Fonts in GL | Joseph Duchesne | 18 | 8,299 |
Feb 3, 2006 09:25 AM Last Post: ThemsAllTook |
|

