Jump to content
  • Advertisement
Sign in to follow this  

Newbie help! OpenGL

This topic is 3851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Guys, I'm very new to OpenGL and co, so forgive me if I ask some really draft questions! How do make a dot about 8 pixels in size. thanks

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by shaolinf
Hi Guys,

I'm very new to OpenGL and co, so forgive me if I ask some really draft questions!

How do make a dot about 8 pixels in size.

thanks
Take a look at glBegin() and glEnd() (you'll want to use the GL_POINTS enum), glVertex2*(), and glPointSize().

If you need more info than that, you may need to clarify your question a bit.

Share this post


Link to post
Share on other sites


glPointSize (8);
glBegin (GL_POINTS);
glVertex2f (0.0f,0.0f);
glEnd ();



This renders a pixel to the center of the screen.

If you prefer, there are alternative routines that you can use besides the glVertex2f version (For example, glVetex2i() (For integers), glVertex2iv() (Integers), et al.

Share this post


Link to post
Share on other sites
Ok, so I've created 2 of those squares with different co-ordinates on the screen. If I wanted to randomly move them about, how would I do that?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!