Hi, I am trying to make just a simple GL program that will put a pixmap on top of a pixmap background.
I have a function that will read a sun raster image from file, and I’m using it to make my backgroud. It works and here is the stubbed code:
//Create my window
win = XCreateSimpleWindow(display, RootWindow(display, screen_num),
win_x, win_y, width, height,
win_border_width,
BlackPixel(display, screen_num),
WhitePixel(display, screen_num));
//In this next function, readraster reads the image and
//makes it into a pixmap it returns a Pixmap * map, and
//it’s width, height, and depth…
readraster(display,“sea.im1”, &wide, &high, &deep, &map);
//this next block renders the image into my background
XSetWindowBackgroundPixmap(display,win,map);
gcval.tile = map;
gc = XCreateGC(display, win, GCTile, &gcval);
XCopyArea(display,map,win,gc,0,0,wide,high,0,0);
XClearArea(display,win,0,0,wide,high, FALSE);
//since I want to learn GL instead of X, I tried doing
//this next block so as to put a little pixmap ontop of
//my background, but get an error where I’ve put ‘map’
//in the glDrawPixel function. [Map is a pixmap]
readraster(display,“suf.im1”, &wide, &high, &deep,&map);
glRasterPos2i(200,200);
glDrawPixels(wide, high, GL_UNSIGNED_BYTE_3_3_2, GL_RGB, map);
glFlush();
Any code suggestions?