PDA

View Full Version : plese give me reply (fading to the display screen)



naveen_06
03-21-2009, 07:25 AM
his is naveen .. how to map Pixel buffer object into openGL address space..if my display resolution is 1280 X 800 .thing is display screen should be fadding .. i written code for this using openGL .. but i want use PBO object and this should be mapeed into openGL buffer object.. if i mapped PBO into openGL .. can i decrement RGB value and how to decrement RGB values from PBO(pixel buffer object) .. doubt is how to access(decrement) RGB value from Pixel buffer object ..can any one help my question

const int SCREEN_WIDTH =1280;
const int SCREEN_HEIGHT = 800;

void display(void);
void init(void);

void display(void)
{
static float i;
for (float i=0.0f;i<256.0f;i++)
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef( 0,0, 0 );
glLoadIdentity();
glBegin( GL_QUADS );
glColor4ub(i,i,i,i);
glVertex3f( 0,0,0 );
glVertex3f( SCREEN_WIDTH, 0,0 );
glVertex3f( SCREEN_WIDTH, SCREEN_HEIGHT,0 );
glVertex3f( 0,SCREEN_HEIGHT, 0 );
glEnd();
glutSwapBuffers();

}

}

void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
GLfloat _div = ( GLfloat ) SCREEN_WIDTH / ( GLfloat )SCREEN_HEIGHT;
glViewport( 0, 0, ( GLint ) SCREEN_WIDTH , ( GLint )SCREEN_HEIGHT );
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
gluOrtho2D (0.0, (GLdouble) SCREEN_WIDTH, 0.0, (GLdouble) SCREEN_HEIGHT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

}
int main(int argc, char** argv)
{

while(1)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize (1280, 800);
//glutInitWindowPosition (100, 100);
glutCreateWindow ("hello");
init ();
glutDisplayFunc(display);
glutMainLoop();
}
return 0;

}

naveen_06
03-30-2009, 05:02 AM
can any one give reply yaarrrrrrr............