🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Why was my texture stretched?

Started by
2 comments, last by Mike00 23 years, 11 months ago
I had a texture of stars (basically just dots) that I put on a big square. When I ran my program though, all the stars were stretched. They looked more rectangular than circular. The square was really big (taking up the whole screen), so the texture was repeated 4 times on it. Could that be the problem? Thanks!
Advertisement
well if youre trying to map a texture that is 256x256 in a 800x600 window of course youre gonna get some stretching , u could do what u said and till it

right = 800/256;
top = 600/256;

texcoord(0,0) drawcorner
texcoord(right,0) drawcorner
texcoord(right,top) draw corner
texcoord(0,top) draw corner

this''ll squash the texture as well

maybe try
right = 600/256 + (800-600)/256

and try the abouve
btw do 600.0/256.0 to get a float back



Thanks. So I do 600/256 + (800-600)/256 for right, and what for top? Also, what if I wanted to do one big 800 by 600 texture? Would that be possible, or take up too much memory? Thanks!
top stays the same ie 800/256

a 800x600 texture is that a power of 2 i think not

800x600 = 480k x 24bit = 1.44mb

This topic is closed to new replies.

Advertisement