Sign in to follow this  
medevilenemy

Writing a game...

Recommended Posts

Hello all, I am writing a top-down scrolling space shooter game (blah). I am working off of a rudimentary engine which uses viewports (3 of them: Left = menu bar, Right = Game display area, Bottom = Game Messages). I have been trying to implement texture mapping (to a simple 2d quad) for three days now and have not been able to get it to work. I have tried to use the code from the tutorial, as well as a few other tutorials and nothing seems to work. They have all used the GLAUX library so far... I am now going to try a version which uses GLUT. Any suggestions on how to get texture-mapping (from a simple .BMP file) to work?

Share this post


Link to post
Share on other sites
One thing that confused me at first - the texture resolutions have to be powers of 2. I never read that anywhere and it tripped me up at first. The X and Y dimensions should be 64,128,256,512,or 1024 or else you'll get white blocks. My old Mach64 tops out at 1024 but my Radeon 9700 mobile will do 2048.

Richard

Share this post


Link to post
Share on other sites
I'm using a 128*128 test image. I'm not sure what is happening, but the closest i've gotten to it working is turning the entire screen black with a couple of red lines (red lines which are not red in the image).

Perhaps it is the compiler i'm using... I'm using Dev-C++ 4.95

OR it could be my viewport setup...

Or any number of things...

If this helps, Here are my PC's specs:

AMD ATHLON XP 3200+ (2.2ghz)
512 MB DDR 400mhz RAM
ASUS BRANDED NVIDIA GEFORCE FX 5200 VIDEO CARD
WINDOWS 2000 Pro

Share this post


Link to post
Share on other sites
Seriously though, post some of your code. It can't be that huge. Besides, if you don't, we'll be forced to continue using our amazing powers of mind reading.

Share this post


Link to post
Share on other sites
I'm not posting from my home, so i cant give you code.... But....

I just managed to get a version of texture mapping code working, sort of.
It draws the image perfectly, but for some odd reason which I can't identify, the routines tint the entire screen to the main color of the bitmap loaded (if most of it is black, the screen tints heavily black, etc..


ANY IDEAS?

Share this post


Link to post
Share on other sites
Yes. After you use texturing, you have to disable it. Otherwise, your entire scene will be improperly filtered. Just call glDisable(GL_TEXTURE_2D) when youre done drawing those specific polygons.

-DavidR-

Share this post


Link to post
Share on other sites
thanks alot... I will try this and tell you (obviously on this thread) if it worked.


-- PS: It is about 90 degrees here in N.Y (not the city) right now, so there is the definate chance that I will pass out before I get the chance to test this. :-)

Share this post


Link to post
Share on other sites
ok, now it's raining...... but at least it isnt oppresively hot anymore...

I havent gotten to check if your solution works yet, but something about it doesnt sound right to me. Sorry if i'm being annoying, but i'm in high school trying to write a game pretty much on my own -- that and i'm on my 10th attempt at getting tex mapping to work :-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this