Reputation: 491
I'm having some problems with the simple 2D game in OpenGL in JOGL I'm making. I'm mapping some textures in this game. When I want render some graphic object (f.e Guads) with some color (no texture), I use procedure glColor3d(x,x,x)
. The object get this color, but all other textures are shaded with this color. I want to set color only for one graphics object, but this procedure sets color shade for all objects rendered aftwerwards. How can I solve this issue?
Upvotes: 1
Views: 1310
Reputation: 39370
As you've already noticed, glColor3*
changes also the color for textures. There are two ways to solve your problem:
glColor3d(1.0, 1.0, 1.0);
before rendering textured objectsglPushAttrib()
/glPopAttrib()
pair for storing drawing properties.Anyway, all of the above functions are already deprecated - you might want to look on tutorial about new OpenGL.
Upvotes: 2