Skip to main content
GameDev.net gamedev.net
🔒 Locked

help!

Started by wwinthan Oct 16, 2008 at 10:02 AM 2 replies 550+ views
Original Post
wwinthan
wwinthan
Thanks senior mods for unblocking me. thanks a lot. i won't do bad things again. does anyone have any idea on the questions listed in the post below http://www.gamedev.net/community/forums/topic.asp?topic_id=511596 thanks
V-man
V-man
Your question seems to be

Quote:
how do you come up with the formula
buffer8[(j * WIDTH * 3) + (i * 3)] = (GLubyte) (buffer32[((HEIGHT - j - 1) * WIDTH * 4) + (i * 4)] * 255.0);

could you please point to the resource where i can learn more about?


but this is just basic logic. What is there to learn?
If you take courses at school, they teach you "how to play computer".
"how to play computer" means following the algorithm yourself to see if all is as it should be

So this is a copy of the post made by Graz
int i, j;/* colors may be outside [0,1] so we need to clamp */for (j = 0; j < HEIGHT; j++) {  for (i = 0; i < WIDTH; i++) {    buffer8[(j * WIDTH * 3) + (i * 3)] = (GLubyte) (buffer32[((HEIGHT - j - 1) * WIDTH * 4) + (i * 4)] * 255.0);    buffer8[(j * WIDTH * 3) + (i * 3) + 1] = (GLubyte) (buffer32[((HEIGHT - j - 1) * WIDTH * 4) + (i * 4) + 1] * 255.0);    buffer8[(j * WIDTH * 3) + (i * 3) + 2] = (GLubyte) (buffer32[((HEIGHT - j - 1) * WIDTH * 4) + (i * 4) + 2] * 255.0);  }}iSaveJpeg(image1,buffer8,"C:\\jpgimage.jpg");


so you follow the algorithm, replacing i and j by their values and incrementing as you are doing the loop.

PS : probably you were banned because you should post this in the beginner section. This forum is for OpenGL questions.
wwinthan
wwinthan
Here goes questions.
Is Offscreen rendering(rendering to memory)(mesa3d.org) too big? are there any option which uses small package?I tried FBO but my graphic doesn't support FBO. Help!
It is in mesa3d.org, GL_float eventhough i set background to white(glclearcolor (0.97,0.97,0.97), it doesn't render as white background. if i set it to 8bits GLubyte,it's working fine with white background. is it sth wrong with offscreen rendering(mesa3d.org) which doesn't support background changes?


[Edited by - wwinthan on October 17, 2008 8:51:50 AM]
wwinthan
wwinthan
hi Graz,
could you please answer the above question?
thanks
winthan

[Edited by - wwinthan on October 20, 2008 8:19:03 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.