glDrawPixels problem

  • Follow


I've a problem with the glDrawPixels openGL primitive....
I'm not able to draw at screen a figure described into a GLubyte
dataCulling[480][640] matrix...
This is a resuming of my program:

char valid;
float position[4];
GLubyte GLubyte dataCulling[480][640];
.....
operation with dataCulling....
at the end of operation I've a matrix dataCulling composed only by GLubyte
value 0 or 127 or 255 ....
.....
glRasterPos2i(0,0);
glGetFloatv(GL_CURRENT_RASTER_POSITION,&position[0]);
glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID,&valid);
glDrawPixels(640,480,GL_GREEN,GL_UNSIGNED_BYTE,dataCulling);
glFlush(); <====== DEBUG STOP

I've made the debugging and I've find out that:
position => { 0,480,0.5,0 }
valid => 0
and the screen remain all black....but in the dataCulling matrix ( I've
check it ) there are several 127 or 255 values....not only 0......

now......what I've to do ?!?
How can I resolve my problem ?!?
I want only see my green figure ( described into dataCulling) in the
screen...

please help me !!!!!!!



0
Reply zaero 8/28/2003 6:45:21 AM

> position => { 0,480,0.5,0 }
> valid => 0

Well, valid must be TRUE, otherwise "the current raster position become
indeterminate".

However, I founded a strange behaviour. If I specify GL_GREEN in
glDrawPixels nothing appears to the screen (even if
GL_CURRENT_RASTER_POSITION_VALID is true). With GL_LUMINANCE ... I get the
correct result. Why? ... I'm upset..


Manuel


0
Reply Manuel 8/28/2003 11:00:25 AM


> Well, valid must be TRUE, otherwise "the current raster position become
> indeterminate".

but, in my case.....why the raster position validity is FALSE ?!

> However, I founded a strange behaviour. If I specify GL_GREEN in
> glDrawPixels nothing appears to the screen (even if
> GL_CURRENT_RASTER_POSITION_VALID is true).
> With GL_LUMINANCE ... I get the
> correct result. Why? ... I'm upset..

I think is the same problem of mine..



0
Reply zaero 8/28/2003 11:52:34 AM

> Maybe your graphics driver is rubbish. Many gaming-card
> drivers will fail when you try to do "weird things".

....I've a geForce 420 go ( Mobile computer ) with 16 MB of ram....
and drivers are latest detonator of nVIDIA site....



0
Reply zaero 8/28/2003 11:54:15 AM

> > Maybe your graphics driver is rubbish. Many gaming-card
> > drivers will fail when you try to do "weird things".
>
> ...I've a geForce 420 go ( Mobile computer ) with 16 MB of ram....
> and drivers are latest detonator of nVIDIA site....

But Nvidia's mobile chipsets don't use the Dets from Nvidia's website, you're supposed to get
drivers from your computer manufacturer...

"NOTE: GeForce2 Go and GeForce4 Go mobile processors are not supported in this driver. Please
contact the notebook's manufacturer for graphics drivers for your notebook PC."

Perhaps if you installed the Dets you've got incorrect drivers installed?

Andrew


0
Reply Andrew 8/28/2003 5:11:59 PM

>  glDrawPixels(width,height,GL_RED,GL_UNSIGNED_BYTE,dataCulling);
>
> valida=1
> position= { 0  0  0.5  1 }
>

Ah, maybe I forgot one thing, before glMatrixMode(GL_PROJECTION) you should
loadIdentity() to reset the modelview_matrix.
But, It seems you're already doing this (you got valid=1).

You can try using GL_LUMINANCE (with glColorMask() if necessary). On my
computer that seem to work (while GL_GREEN,GL_RED,GL_BLUE are evils..).

Last try: use GL_RGB and fill your dataCulling[] with 3 components. This
MUST works.. well,I hope! I've tried this on a GeForce3 and on a 9700PRO and
it works.

However, glDrawPixels is really a sloow function...

Manuel


(PS : sorry for my poor english... I'm italian)


0
Reply Manuel 8/29/2003 8:38:10 AM

zaero wrote:
> 
> > However I think the correct way to code is:
> >
> >  ........
> 
> I've used your precious help...an I've try with the follow code...
> 
> glMatrixMode(GL_PROJECTION);
>  glPushMatrix();
>  glLoadIdentity();
>  glOrtho(0,width,0,height,-1.0f,1.0f);

    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();
    glLoadIdentity();

>  glRasterPos2f(0,0);
>  glGetFloatv(GL_CURRENT_RASTER_POSITION,position);
>  glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID,&valida);
>  glDrawPixels(width,height,GL_RED,GL_UNSIGNED_BYTE,dataCulling);
>  glFlush();

     glPopMatrix();

>  glMatrixMode(GL_PROJECTION);
>  glPopMatrix(); <=======================STOP DEBUGGING
> 
> Debugging says that:
> 
> valida=1
> position= { 0  0  0.5  1 }
> 
> BUT    I dont see anything at screen.......why ?!?!? Why glDrawPixels
> doesn't work ?!?
> ====
> 
> please help me !!!!
> I'm becoming mad !!!!!


Maybe these inserts might help? Dunno what the rest of your code is
doin'

-- 
Rob Fletcher, University of York, UK
[Spamtrap - Remove the "y" to reply]
0
Reply Rob 8/29/2003 8:59:15 AM

> "NOTE: GeForce2 Go and GeForce4 Go mobile processors are not supported in
this driver. Please
> contact the notebook's manufacturer for graphics drivers for your notebook
PC."
>
> Perhaps if you installed the Dets you've got incorrect drivers installed?

.....well....I've installed detonator and....so far I haven't had any
problem.....
but.....I've search to download specific driver for my sony vaio geforce 420
go and I've found out anything...
Do You know where I could find out them ?!?



0
Reply zaero 8/29/2003 11:54:51 AM

> > "NOTE: GeForce2 Go and GeForce4 Go mobile processors are not supported in
> > this driver. Please
> > contact the notebook's manufacturer for graphics drivers for your notebook
> > PC."
> >
> > Perhaps if you installed the Dets you've got incorrect drivers installed?
>
> ....well....I've installed detonator and....so far I haven't had any
> problem.....
> but.....I've search to download specific driver for my sony vaio geforce 420
> go and I've found out anything...
> Do You know where I could find out them ?!?

Well somewhere on Sony's website I presume... can't get very far without knowing your model number
but this page looks like it will help...

http://ciscdb.sel.sony.com/cgi-bin/select-p-n.pl

Andrew


0
Reply Andrew 8/29/2003 2:01:45 PM

> Ah, maybe I forgot one thing, before glMatrixMode(GL_PROJECTION) you
should
> loadIdentity() to reset the modelview_matrix.
> But, It seems you're already doing this (you got valid=1).

I've added the glLoadIdentity() but I't doesn't work

> You can try using GL_LUMINANCE (with glColorMask() if necessary). On my
> computer that seem to work (while GL_GREEN,GL_RED,GL_BLUE are evils..).

I've used glDrawPixels with GL_LUMINANCE but....
my screen is still all black !!!!

> Last try: use GL_RGB and fill your dataCulling[] with 3 components. This
> MUST works.. well,I hope! I've tried this on a GeForce3 and on a 9700PRO
and
> it works.

....still to try.....

> However, glDrawPixels is really a sloow function...

I know that but....how can I draw at screen an image from a matrix in an
other way ?!?!?

> (PS : sorry for my poor english... I'm italian)

You undervalue yourself !!!



0
Reply zaero 8/30/2003 6:42:07 AM

9 Replies
272 Views

(page loaded in 0.119 seconds)

Similiar Articles:













7/22/2012 6:32:21 AM


Reply: