Advertisement Jump to content


This topic is now archived and is closed to further replies.


Textures Display Order

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

Newbie to opengl.. I have a texture as a background that covers the entire screen. I have another texture which i want to display abou this background. but at the moment it cant be seen how do i get the bottom texture to the top. Any help would be greatful.

Share this post

Link to post
Share on other sites
Probably, you''ve drawn the 2nd texture at the same position as, or behind (as seen from the point of view) the first one, so the 2nd one disappears or flickers (stripes of tex1 and tex2). Try drawing the second textured quad (or other primitive) closer to the camera than the first one or disable depth testing (which tests if there is already drawn something to the screen at that depth, or closer, is so, nothing will be drawn) with this code:


Don''t forget to enable it again or your drawing after this code (even the next frames) will become a bit strange :


You could also try to set a different depth testing function so it draws too if the depth is equal to the already drawn, not only if it''s less:


Now, i am not sure this isn''t the deafault value, but it''s worth trying .


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!