PDA

View Full Version : .bitmap



tpthyd
02-07-2009, 04:26 AM
hi,
i am new to the opengl.i know how to render basic primitives and tesselations. now i have one question . i'll give width and height of some part of screen in which i have to render 2d image. input is i'll give only colors for every one fixel width.then how can i make bitmap image for that part of screen

Y-tension
02-08-2009, 03:57 AM
glDrawPixels is your friend.

tpthyd
02-08-2009, 09:28 PM
ya,
i tried to render by using glDrawPixels(). but it is giving black color image.here is my snap code for giving colors for that image
for (i = 0; i < checkImageHeight; i++)
{
for (j = 0; j < checkImageWidth; j++)
{
int c=datapoint->color[k++];
checkImage[i][j][0] = (GLubyte) c;
checkImage[i][j][1] = (GLubyte) c;
checkImage[i][j][2] = (GLubyte) c;
}
}

i have one more problem. i rendered polygons initially on the screen. now on top of that i have to render this image. for zooming/panning i have written code by changing parameters left/right/top/bottom in

glortho()

i think now after render this image on that, only background polygons will zoom.

can anyone help me in this regard so that i'll be thankful to you.