Jump to content
  • Advertisement
Sign in to follow this  
Witchcraven

OpenGL OpenGL will not color my primitives

This topic is 5402 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

I am making a simple 2d space game as a warm up to a far larger game. I have a bunch of textured space ships flying around the screen all nice and well. I then decided I need a very simple starfield. So I randomly generate the stars, and use GL_POINTS to plot them. To my dismay, nothing shows up. On a hunch I decided to draw the stars last, and there were all sorts of little black dots on my space ships. So I know the stars are being drawn. I then attempted to change the color to green using glColor, and the stars stayed black, but only the green channel of the textures were drawn. I then disabled everything in my game from input to sprites and only drawing the starfield, but still nothing. What could be wrong?

Share this post


Link to post
Share on other sites
Advertisement
No. I need to? Maybe I should read that opengl book instead of winging it (although that works fairly well with most api's). I will give it a try.

Cool, it worked. You++.

[Edited by - Witchcraven on October 2, 2004 10:04:57 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Witchcraven
No. I need to?


Yeah, OpenGL is a state machine. If you turn on anything once, it's on forever, and effects everything until you switch it off.

Share this post


Link to post
Share on other sites
Quote:
Original post by Vampyre_Dark
Quote:
Original post by Witchcraven
No. I need to?


Yeah, OpenGL is a state machine. If you turn on anything once, it's on forever, and effects everything until you switch it off.


Instead of turning GL_TEXTURE_2D off, you could also turn GL_COLOR_MATERIAL on. That will color your primitives.

Share this post


Link to post
Share on other sites
Quote:
Original post by nife
Quote:
Original post by Vampyre_Dark
Quote:
Original post by Witchcraven
No. I need to?


Yeah, OpenGL is a state machine. If you turn on anything once, it's on forever, and effects everything until you switch it off.


Instead of turning GL_TEXTURE_2D off, you could also turn GL_COLOR_MATERIAL on. That will color your primitives.

Wrong. Color_material only affects how surface colours are chosen when lighting is enabled (from vertex colour instead of material colour). Texturing is independant of this and can be used at the same time as either of those options.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!