COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### glDrawPixels problem

• Email
• 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...


 0

See related articles to this posting

> 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

> 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

> 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

> > 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

"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

>  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
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

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();
>  glOrtho(0,width,0,height,-1.0f,1.0f);

glMatrixMode(GL_MODELVIEW);
glPushMatrix();

>  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 ?!?
> ====
>

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

> "NOTE: GeForce2 Go and GeForce4 Go mobile processors are not supported in
> 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

> > "NOTE: GeForce2 Go and GeForce4 Go mobile processors are not supported in
> > 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

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

Andrew


 0

> 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..).

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

9 Replies
352 Views

Similar Articles

12/6/2013 8:04:36 AM
page loaded in 25803 ms. (0)

Similar Artilces:

Problem
On the right side of my screen (the cover) i can see light goes through a little schrink. 2 weeks laptop Is it normal or i shoul exchange it.... Thanks

Problem with templates
of text - I'll simply assume that you got the syntax right. If I were you, I'd have tried to create the smallest possible piece of code that still shows the problem, without a complex combo of memberfunction pointers in template argument lists. > This is implemented in another cpp file [...] > This is compiled into a .lib file > and the fucntion is called from another cpp file which implements a > class called Bond and it has a public method > This is also compiled into a .lib and referenced in a consol app. I am > getting the linker error when trying to create

dispatch problem
How can i send my aglets to other hosts in my network. I tried sending my aglets by providing atp://<ip-address> few were successfully dispatched but were not able retract back. when i tried to send others i got this error com.ibm.aglet.RequestRefusedException atp://192.168.0255,Integrity=DIGEST,Confidentiality=SHORTSECRETKEY,Timeout=0 examples.snmp.SnmpGet please suggest if there are any settings to be done!

problem with mexCallMATLAB
= *ouptr; If I used to debug the program, the value of single should come 1. But unfortunatly the value of single is coming to 0 only. Any comment will be appreciated. Nihal Hi Nihal, without testing your code, I think your line int *ouptr, single; is the problem. The value is 1, but it is not an integer, but of type double (as all MATLAB-variables, as long as you don't explicitly set the type like uint32(1)). So double *ouptr, single; and ouptr = mxGetPr(ouhs[0]); should probably solve your problem. Titus "Nihal Ahmad" <nihal@cranessoftware.com> wrote in message news...] = mxCreateDoubleMatrix(1, 1, mxREAL); > ouptr = (int *)mxGetPr(ouhs[0]); > > y = mexCallMATLAB(1,ouhs,0,NULL,"dummyst"); > > single = *ouptr; > If I used to debug the program, the value of single should come 1. > But unfortunatly the value of single is coming to 0 only. > > Any comment will be appreciated. > Nihal Hi Titus, Thank you for immediate response. I checked with double *ouptr, single;, but the problem is same. what to do to sove it. please help me out to solve it. Regards Nihal Titus Edelhofer wrote: > > > Hi Nihal, > without testing your code

Audio problem
Friend has an Evesham (Time/Colosuss/Tiny/Mitac) 8375 laptop with an audio problem -- sound coming only from right-side speaker. Have tried external speakers, headphones and a USB sound 'card' with speakers attached but result always the same. Could it be just the internal speaker itself that's faulty or does it point to a motherboard connector? Either way, how difficult/expensive would it be to put right? TIA In news:20070909-215611.202.0@me.nntp.dsl.pipex.com, Zed typed on Sun, 09 Sep 2007 22:56:11 +0100: > Friend has an Evesham (Time/Colosuss/Tiny/Mitac) 8375 laptop with an > audio problem -- sound coming only from right-side speaker. Have > tried external speakers, headphones and a USB sound 'card' with > speakers attached but result always the same. Could it be just the > internal speaker itself that's faulty or does it point to a > motherboard connector? Either way, how difficult/expensive would it > be to put right? TIA WOW! Did you disable the driver for the internal sound card when you used the USB sound card (through the Device Manager)? And you had to install the USB sound card driver for it too, right? You

problem with synthesis
a test when 'd' is no longer active and after a certain amount of time, led should turn off. Now my code has a precision problem, it does not reliably count high time. I need help to straighten out this code. Where can I get some sample verilog to look at (small modules that implement simple things)? Thanks, module blink(input clk, input d, output reg led); parameter blink_freq = 23; paremeter high_time = 4; // 16 clocks reg ld = 0; reg [blink_freq:0] count; reg [high_time:0] hcount; always @(posedge clk or posedge d) begin if(clk) begin count <= count + 1; hcount <... blink with a frequency clk_freq/(2^blink_freq). > >THere are a couple of problems > >1) I need a module register to hold the signal 'd' when it goes high, >usually 'd' only maintains high for a single clock period. > >2) I need a test when 'd' is no longer active and after a certain amount >of time, led should turn off. Now my code has a precision problem, it >does not reliably count high time. > >I need help to straighten out this code. Where can I get some sample >verilog to look at (small modules that implement simple things

getpwnam problem
; Greetings, > Aaron > -- > Aaron Isotton | http://www.isotton.com/ > You know it's Monday when you wake up and it's Tuesday. -- Garfield But the problem is I always pass the same user(exist in the system) to getpwnam, sometimes it works but sometimes it fails with NULL. Any idea? jholly@cup.hp.com (Jim Hollenback) writes: > ultra (ultraman@rogers_NOSPAM.com) wrote: > : But the problem is I always pass the same user(exist in the system) to > : getpwnam, sometimes it works but sometimes it fails with NULL. Any idea? > > what is the errno when it fails...\n", strerror(errno)); : > else fprintf(stderr, "no such user\n"); : > } : > : But the problem is I always pass the same user(exist in the system) to : getpwnam, sometimes it works but sometimes it fails with NULL. Any idea? what is the errno when it fails? -- Jim Hollenback jholly@cup.hp.com my opinion. "ultra" <ultraman@rogers_NOSPAM.com> writes: >> what is the errno when it fails? > > it didn't set the errno when it failed... > > Huh? What do you mean it didn't set the errno? Here is your original message: > I have

filestream problem
I'm having a little filestream problem. With the code below, I open a file in order to insert its contents into another file. However, right after the opening of the file, insertfile.eof() seems to be TRUE. Before the problematic file is opened, one other file is opened and inserted by the same piece of code (which is in a loop), without any problems. I'm sure that the file to be inserted has several lines of contents, and I also checked if the insertfile stream is closed before opening it. if(FileExists(insertfilepath)) { insertfile.open(insertfilepath.c_str()); while(! insertfile.eof()) { getline(insertfile, insertline); outfile << insertline << endl; } insertfile.close(); } I would really appreciate some advise here. Thanks, Pieter Pieter Provoost wrote: > I'm having a little filestream problem. With the code below, I open a file > in order to insert its contents into another file. However, right after the > opening of the file, insertfile.eof() seems to be TRUE. Before the > problematic file is opened, one other file is opened and inserted by the > same piece of code (which is in a loop), without any problems. I

init.tcl problem
Hi folks, I have a little problem: I embed Tcl/Tk into an application, but there is a nerve-racking init.tcl error, here is the important code: ##### Tcl_FindExecutable(argv[0]); interp = Tcl_CreateInterp(); ... /* * tcl_library */ Tcl_Obj* restcl; Tcl_Obj* libtcl; if (Tcl_Eval(interp, "file join [file normalize $::env(APP_HOME)] tcl lib tcl8.4") != TCL_OK) { return TCL_ERROR; } libtcl = Tcl_GetObjResult(interp); restcl = Tcl_SetVar2Ex(interp, "tcl_library", NULL, libtcl, TCL_GLOBAL_ONLY); /* * Init Tcl/Tk */ if (Tcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } if (Tk_Init(interp) == TCL_ERROR) { return TCL_ERROR; } /* * Init [incr Tcl/Tk] */ if (Itcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } if (Itk_Init(interp) == TCL_ERROR) { return TCL_ERROR; } /* * load framework */ if (Tcl_Eval(interp, "source [file join [file normalize$::env(APP_HOME)] scripts init init.tcl]") != TCL_OK) { return TCL_ERROR; } if (Tcl_Eval(interp, "::CreateTopLevel") != TCL_OK) { return TCL_ERROR