Jump to content

  • Log In with Google      Sign In   
  • Create Account


GL_QUADS and a shiny black screen


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 notatric   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 August 2001 - 08:28 AM

Hi people, I''m using OpenGL ortho mode and wanna display a simple quad with a color and an alpha value. So far so good, but everything I get is a black screen. The code seems right to me....could anybode please help!?? void cSprite:lane(RECT dim,float r,float g,float b,float alpha) { glLoadIdentity(); glTranslatef((float)dim.left,(float)dim.top,0.0f); glColor4f(r,g,b,alpha); glBegin(GL_QUADS); glVertex2d(0,dim.bottom); // top left glVertex2d(0,0); // bottom left glVertex2d(dim.right,0); // top right glVertex2d(dim.right,dim.bottom); // bottom right glEnd(); } I''m calling the function with these params: rc.left=0; rc.top=0; rc.right=640; rc.bottom=480; Sprite->Plane(rc,1.0f,1.0f,1.0f,0.0f); thanks! Bye, Alex

Sponsor:

#2 Null and Void   Moderators   -  Reputation: 1087

Like
Likes
Like

Posted 08 August 2001 - 10:33 AM

Using 0.0f for an alpha value makes the object invisible. Also, you might want to set up a method of blending.

[Resist Windows XP''s Invasive Production Activation Technology!]

#3 Fragmo   Members   -  Reputation: 187

Like
Likes
Like

Posted 08 August 2001 - 11:01 AM

I think the problem might be that smiley face in your function definition

#4 zedzeek   Members   -  Reputation: 528

Like
Likes
Like

Posted 08 August 2001 - 11:33 AM

glClearColor(1,0,0,1);
if u see a pure red screen then the object cant be seen
perhaps the cameras pointing the wrong way or the backface is facing the camera etc.
if u do see a black square perhaps u have lighting enabled


#5 notatric   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 August 2001 - 12:39 AM

Hi,

I set the background to red but I''m getting a black one -> the quad is drawn but don''t uses the color....

#6 smitty1276   Members   -  Reputation: 560

Like
Likes
Like

Posted 13 August 2001 - 08:24 PM

Try translating behind the front clipping plane. If your front clipping plane is at 1.0, translate to 1.1.

#7 zedzeek   Members   -  Reputation: 528

Like
Likes
Like

Posted 14 August 2001 - 09:48 AM

have you disabled lighting , blending and texturing?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS