View Full Version : .bitmap

02-07-2009, 03:26 AM
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

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

02-08-2009, 08:28 PM
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


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.