Jump to content
  • Advertisement
Sign in to follow this  
citronrock

1024*768 !!!

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

Hi everybody ! I want to display my picture ( 1024*768 pix ) in a 1024*768 mod ...... i don't kow why but my program is working well with small picture , and in a lower size ( for example : 640*480 ) . i think my loader is bad, because it need a picture like that : width=2^... and height=2^... someone know this problem ?? thx a lot !!!

Share this post


Link to post
Share on other sites
Advertisement
Hi citronrock!

What loader are you using? Only OpenGL textures have to be 2n in width and height, and that too, not if you are using mipmaps. But if 640x480 is working, that isn't the problem. Does your application work? I mean, do you get a blank screen or does it crash? If it crashes, it's most probably memory overflow. Please post back ...

Share this post


Link to post
Share on other sites

Hi ! thanks .

So , i'm using a tga loader, the man who made that one say that you have to do picture 2^ ... my application is working , i'v got a just a blank screen.
Maybe i need to change the loader .

I don't use mimaps because i don't know if a need to use and how it's working.. do i have to use mimap ..?



Share this post


Link to post
Share on other sites
Quote:
Original post by deavik
What loader are you using? Only OpenGL textures have to be 2n in width and height, and that too, not if you are using mipmaps.


No, wrong.
Even mipmaps have to be a power-of-two. the glu function used by most people to build their mipmaps internally resizes the inital image to a power-of-two in size before it submits the data to OpenGL.

Share this post


Link to post
Share on other sites
yes, ok ...so my pb is not finished yet ...
there is no way to do what i want, because in directX, it's very easy to do that but i don't want to use directX , come on there is a way !!!! plz

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
how can i make my own mipmap function ??

Share this post


Link to post
Share on other sites
Quote:
Original post by phantom
the glu function used by most people to build their mipmaps internally resizes the inital image to a power-of-two in size before it submits the data to OpenGL.
Yes but that is what citronrock would be using I expect [smile].

Maybe you should post the tga loader for everyone to see, citronrock. That could be where the problem is.

EDIT: Thanks for correcting the part about the mipmaps, phantom.

Share this post


Link to post
Share on other sites
If your TGA loader can only load images with a power of two dimension, don't use that loader. That is a serious flaw.

I recommend getting the TGA spec from Wotsit.org and writing your own loader. It really isn't that hard; you just need to follow the spec. If you don't want to do that then use some image loading library like Corona or DevIL. I have no experience with either of them though so I can't make a specific recommendation.

EDIT: I don't think that's actually your problem since you say it works with images that are 640x480, which is definitely not power of two dimensions. It would still probably be better to go with Corona or DevIL in the long run anyway.

EDIT2: There's FreeImage as well for you to check out.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
how can i make my own mipmap function ??


In all honesty, it's more trouble than it's worth, but the principle is to compress an image from 2^n x 2^n to 2^(n-1) by 2^(n-1). The only way I know of doing that, without the aid of graphics libraries, is to take the surround pixels (3 at fewest, 8 at most), average them together, and output your new pixel. Then, skip over the next pixel in the scan line, and repeat until a quarter the pixels have been processed.

Oh and skip every other scan line too.

Share this post


Link to post
Share on other sites
okok , good. So next pb !! i want to destroy a part of my image (.bmp ) , for example i want : when i click on the bitmap ( 52, 152 ) i want a little area next to my click vanished .... i don't kow what i have to do...maybe a matrix which contains bitmap pixel...and refresh , i don't know... however it's possible , worms is real no ? mmmm


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!