Rendering on a Bitmap (Small Problem)

person23
Unregistered
 
Post: #1
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!!!!!!!!!!!!!!!!!!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
I doubt anyone can help you. This is a Macintosh programming forum, and that looks very much like a Windows problem.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #3
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!!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Bitmap fonts markhula 6 7,847 Feb 27, 2011 12:55 PM
Last Post: markhula
  Anyone experienced Performance ± with UILabels vs. Bitmap Font in OpenGL ES 1.1? Elphaba 3 4,266 Jul 28, 2009 10:40 AM
Last Post: AnotherJake
  Font rendering problem wadesworld 5 3,461 Mar 18, 2009 11:11 PM
Last Post: AnotherJake
  Bitmap font toolkit Najdorf 9 6,685 Nov 11, 2008 05:43 PM
Last Post: Najdorf
  Text rendering problem with VBOs on myfeng 9 5,807 Feb 29, 2008 04:54 PM
Last Post: OneSadCookie