Writing a game...

Started by
12 comments, last by medevilenemy 18 years, 10 months ago
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?
There was a saying we had in college: Those who walk into the engineering building are never quite the same when they walk out.
Advertisement
yes, look at my sig.
You could allso take a look at lesson 24 witch teaches you how to load TGA files.
The GLUT version did not work, so i'm really stalled until I can find something that does work.
There was a saying we had in college: Those who walk into the engineering building are never quite the same when they walk out.
Post some code. Maybe you just left something simple out like enabling texture mapping.

-DavidR-
In this world gone mad, we won't spank the monkey; the monkey will spank us.
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
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
There was a saying we had in college: Those who walk into the engineering building are never quite the same when they walk out.
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.
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?
There was a saying we had in college: Those who walk into the engineering building are never quite the same when they walk out.
Just Remember to disable texture mapping after you have mapped your quad .

Unless the entire game ie every single command needs it to be on.

glDisable(GL_TEXTURE_2D)
----------------------------

http://djoubert.co.uk
has not doing this caused problems similar to mine for others?
There was a saying we had in college: Those who walk into the engineering building are never quite the same when they walk out.

This topic is closed to new replies.

Advertisement