• Advertisement
Sign in to follow this  

Newbie help! OpenGL

This topic is 3765 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
Thanks for the reply. Can you give me an example of that code in implementation please ?

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
Look for tutorials or books.... The site above is good to start. Seriously though, you can't ask everything in a forum. Search for yourself and ask specifics in forums.

Share this post


Link to post
Share on other sites
I don't mean to hijack this thread, but I bought Beginning Open GL gameprogramming almost a year ago, and I lost the CD that came with it. The CD was very useful (had a few extra chapters, all the sourcecode etc.), so is there anyway I might get it back? :(

Share this post


Link to post
Share on other sites
Quote:
Original post by Lambi
I don't mean to hijack this thread, but I bought Beginning Open GL gameprogramming almost a year ago, and I lost the CD that came with it. The CD was very useful (had a few extra chapters, all the sourcecode etc.), so is there anyway I might get it back? :(


Ask them really nicely? Other than that, I can't think of a way that is endorsed by this forum.

Share this post


Link to post
Share on other sites
I suggest the OpenGL redbook. You can get the newest version which also handles shaders and other advanced stuff at amazon or elsewhere. If you can't afford this you still can find pdfs of the redbook v1.1 via google.

Share this post


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

  • Advertisement