Sign in to follow this  
thuong

OpenGL create texture problem

Recommended Posts

Hi All, i have image with width and height is not : 2 ^ n, 2 ^ m, i want render it i must scale to : 2 ^ n, 2 ^ m, ex: my image have dimension: 720 x 576 i must scale it to 512 x 512 so quanlity render not good, anybody have image that good quanlity in OPENGL, pls help me? i use function: glTexImage2D to create texture and apply it to quads Thanks very much, David,

Share this post


Link to post
Share on other sites
Not 100% sure what you mean here, but here goes:

If you just want to scale the image to 512x512 in your program, use gluScaleImage.
If you want to apply a texture that isn't (2^m, 2^n), then look for GL_TEXTURE_RECTANGLE. :)

Good luck

Share this post


Link to post
Share on other sites
thanks very much,

i want render texture with real size but when i use function glTexImage2D with GL_TEXTURE_2D then can not create texture with size could not be represented as 2k + 2(border) for some integer value of k

but param: GL_TEXTURE_RECTANGLE can not define in OPENLG
i can not use it, can you help me?

thanks very much,

[Edited by - thuong on September 28, 2006 4:37:50 AM]

Share this post


Link to post
Share on other sites
GL_ARB_texture_rectangle is an OpenGL extension. For more information on extensions read this. After you read that and understand OpenGL's extension mechanism I recommend using an extension loading library to actually load them (there are links to two of them in the FAQ), it makes it much easier.

Share this post


Link to post
Share on other sites
If you want to use your texture to render video, you can call glTexImage2D() with a size of 1024x1024, then call glTexSubImage2D() to upload the video frames into that texture. When draing those frames, specify (u,v) coordinates for the rectangle that contains the video (i.e. u goes from 0 to 720/1024, v goes from 0 to 576 to 1024). You may use the unused part of that texture for other stuff, for instance to have an OSD.

Share this post


Link to post
Share on other sites
Thanks very much,

i am newbiz on OpenGL, i have question OpenGL extension base on GFX card too? GFX card must support then we used it otherwise is can not used, i am correct?

my machine use glTexImage2D with dimension image with width, height is not 2 ^ n, 2 ^ m, i render image good, my GFX card (GeFox 8x), but another machine(GFX card is GeFox 4x), it can not create texture, my mean to create textture with dimension image with width, height is not 2 ^n, 2 ^ m use glTexImage2D base on GFX card, i i i am correct?

Thanks very much,

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