Yeah, maybe you're right, I guess that would be pretty simple. I was just happy about my current system and hoped I wouldn't have to turn it all around.
The current wall texture is 16*16 pixels, wich is repeated over the entire wall. (Two times vertical and horizontal depending on the length of the wall (the distance between the two wall positions)) The house consists of four walls. This means I can just break up the wall on wich the door is placed into 2 walls: The part left and the part right of the door. Then I would simply place the door right between the 2 walls. This would only cost 1 line of code, so that's not the problem. I was just wondering if there was some kind of way to force OpenGL to 'override' the previously rendered stuff and to force one texture to win the depth fight. Sadly this is not the case so I'll have to do it the way I just explained.
Thanks for the help guys, I really appreciate it. ;)
I currently render the door 0.001 outside of the wall, and depth fighting now only happens when I'm far away from the wall. So it works, but it's not a permanent solution.
Both the walls and the door are just entities in my game. Only the wall takes 2 position parameters intead of 2 (the wall being rendered from the first to the second position) and I really like the simplicity of that but I'm afraid I'm gonna have to come op with a more complicated system.
Is there a way in openGl to 'draw' a hole in something? It would be a great solution for this and some other problems I will encounter.
For example: can I tell OpenGL to draw a rectangle (using GL_QUADS) from 0,0,0 to 20,0,20, and then tell it to 'dedraw' a rectangle 5,0,5 to 10,0,10? It would be great but I don't think this is possible this way except by breaking up the first rectangle into 4 rectangles surrounding the hole.
And Sik, I understand what you mean, but I was actually trying to avoid adding detail as much as possible to keep this project simple. That's why I chose a retro-look and made the player unable to look up and down. (The camera can only turn left and right)
By the way, it won't be possible to open the door, you just press the action key when you're close enough and will be teleported to the inside of the house, wich is just a seperate room.