Jump to content
  • Advertisement
Sign in to follow this  
medevilenemy

Writing a game...

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

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
Advertisement
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
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)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!