GL_TEXTURE_RECTANGLE_ARB not working...?

Member
Posts: 37
Joined: 2006.08
Post: #1
I am having trouble with using GL_TEXTURE_RECTANGLE_ARB as a target for textures. I have no problem loading and displaying a texture using GL_TEXTURE_2D. When I replace all of my 2D's with RECTANGLE_ARB's I get no texturing at all.

I am using these constants in all of the relevant texturing calls, such as glEnable(), glGenTextures, glBindTexture, glTexImage2D, etc...

Shouldn't any modern GPU be able to handle this? glGetError returns no error codes when loading a texture with the rectangle extension. What gives?
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #2
Can you post some code?

Also, and I'm just throwing this out here, are you using pixel coordinates for glTexCoord? GL_RECTANGLE_TEXTURE requires you to use pixel coordinates instead of the [0->1] coords you use for GL_TEXTURE_2D.
Quote this message in a reply
Member
Posts: 37
Joined: 2006.08
Post: #3
TomorrowPlusX Wrote:Can you post some code?

Also, and I'm just throwing this out here, are you using pixel coordinates for glTexCoord? GL_RECTANGLE_TEXTURE requires you to use pixel coordinates instead of the [0->1] coords you use for GL_TEXTURE_2D.

Mad Mad Mad

That's it! I had no idea. This didn't really jump out at me in any documentation...

Thanks!
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #4
It is very clearly stated in the spec. See the overview and issue 11.

We also specifically point this out in the OpenGL Programming Guide for Mac OS X.
Quote this message in a reply
Member
Posts: 37
Joined: 2006.08
Post: #5
I'll start reading the specs more often then Smile
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #6
Sometimes it's hard to know which spec to read; not to mention grokking it and keeping it in your head. I keep a number of specs on my hard disk for reference, but half the time I have aproblem, arekkusu drops a spec to clarify.

Useful, he is. With his specs.
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #7
I believe very strongly in reading the documentation.

OpenGL (and programming in general) is really fantastically complex. It isn't like a toaster oven where you can just poke a button and guess what will happen. There are millions of bits flying around; you have no chance of "guessing" how they work together. You must read the documentation.

Of course, OpenGL's documentation is very dense and technical, which is hard for some people. That's why there are many books to make it easier. But the specifications are always there as the real reference.
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #8
arekkusu Wrote:Of course, OpenGL's documentation is very dense and technical, which is hard for some people. That's why there are many books to make it easier. But the specifications are always there as the real reference.

I can't agree enough. I've got the Red Book ( mine is so out of date as to be silly, however ), the Orange Book, the OpenGL SuperBible, and some windows-centric book about game programming in OpenGL which has good material, but worthless boilerplate since it's all win32.

What I'd like would be to download all the specs from the oss.sgi site to my hard disk, tag them all with "OpenGL" so that Spotlight could index them. The only thing stopping me, I suppose, is laziness.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #9
You really don't need a version of the red book that deals with OpenGL newer than 1.1 -- that's essentially what you'll be using, anyway. All the useful extras on top of that you'll be using as extensions, and those are documented separately.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  glBindTexture(GL_TEXTURE_RECTANGLE_ARB, ...) throws GL errors ravuya 1 6,013 Nov 2, 2006 12:06 AM
Last Post: ravuya