OpenGL Questions... Borders and Colors...

This is a discussion on OpenGL Questions... Borders and Colors... within the Game Programming forums, part of the General Programming Boards category; Below is some of my first work in 3D (please don't be too harsh). It is drawn as squares then ...

OpenGL Questions... Borders and Colors...

Below is some of my first work in 3D (please don't be too harsh). It is drawn as squares then rotated 45 degrees to get the isometric look. And because of the nature of what I want, it is done in an orthographic view. For now it uses a border that is part of the image file where the texture is loaded from. I want to get rid of that and just use a plain texture, but I am having some problems.

This is where I do all my texture initialization (image loading code can be provided if needed). I enable GL_TEXTURE_2D above this... What I don't get is why if I turn on borders after setting the GL_TEXTURE_BORDER_COLOR, everything that is textured (only one texture is used so far) turns white.

Psycho:I am trying to turn on OpenGL borders, since as it is, the tiles look good when they are in a diagonal state, but when I rotate the map the lines look a little thicker (they are 2px) and it looks like crap.

Another thing is, the edge of the texture seems to be bleeding into the sides, so if the edges of the textures are black, the sides of the tiles are black too. Even if I set the color to something else before drawing the sides.

Bubba:I don't understand what you said in the first sentence... still learning the 3d techno-babble.

As it is, I start by drawing the bottom, back tile, then work my way to the bottom right, then draw the next level of tiles back to front (in a pattern like I said in my other thread). I use a set of if statements to draw the map in the right order for the current view (though I don't know if this is the best way).

Eventually I want to optimize it to only draw the sides that are visable, but for now it draws every tile all 6 sides (though I guess I could get rid of the bottom safely right now).

EDIT: Attached is the exe, tga, and source code. I didn't write the CTargaImage stuff, and most of the stuff in main.cpp is from a base in the book I am using. I intend to change main.cpp to use SDL instead of Win32 to make it portable. 5 files max, so tga is in next post, and I can't post the .exe (for understandable reasons).

I am trying to turn on OpenGL borders, since as it is, the tiles look good when they are in a diagonal state, but when I rotate the map the lines look a little thicker (they are 2px) and it looks like crap.

The OpenGL borders wouldn't even be noticiable, would they? Since the loaded texture image already has a border. Perhaps i'm still missing the point here.

I know this is more of a work around than a fix, but why not do one of the following:
A. Draw a border on each texture as you load it (during runtime), before binding it with OpenGL, and load a second copy to use without the border
B. Instead of doing the border on the texture, you could use GL_LINES and draw the borders yourself.

I have read that page several times, but I can't see what I am doing wrong.

Does anyone have a working example of using borders on textures?

Anyway, I am going to continue googling and playing with it, but for now it is back burnered in priority so I can get my mapfile setup and then use that for drawing instead of some hardcoded values. Once I can get that done, I will probably rewrite the all of the OpenGL code since as it is, it was written as needed/learned and not really planned out. Perhaps then I will find out my problem.

EDIT: Also at that point I could do the line overlays if I can't get borders working.