Rectangle Textures and RubyGameCommon
Edit: solved the problem
This might be more of a Rectangle texture problem than RGC.
First of all, I added the rectangle texture constant myself, so it does exist and compiled fine.
So I have this code:
I've taken out everything but the texturing code.
When drawn, all I get is a white squares, even with a solid color texture.
If I replace the TEXTURE_RECTANGLE_EXT with TEXTURE_2D, and change the texturing coordinates it works correctly.
On the other hand, I went to one of my programs in C and and tried to use GL_RECTANGLE_EXT and it told me it was undefined. Is there some special header needed? I also remember hearing that you need to load extensions explicitly, is this true?
This might be more of a Rectangle texture problem than RGC.
First of all, I added the rectangle texture constant myself, so it does exist and compiled fine.
So I have this code:
Code:
GL.Enable(GL::TEXTURE_RECTANGLE_EXT)
GL.PixelStore(GL::UNPACK_ALIGNMENT, 1)
texNum = GL.GenTextures(1)[0]
GL.BindTexture(GL::TEXTURE_RECTANGLE_EXT, texNum[0])
texPNG = load_png_image(fileName)
GL.TexParameter(GL::TEXTURE_RECTANGLE_EXT, GL::TEXTURE_WRAP_S, wrap)
GL.TexParameter(GL::TEXTURE_RECTANGLE_EXT, GL::TEXTURE_WRAP_T, wrap)
GL.TexParameter(GL::TEXTURE_RECTANGLE_EXT, GL::TEXTURE_MAG_FILTER, filter)
GL.TexParameter(GL::TEXTURE_RECTANGLE_EXT, GL::TEXTURE_MIN_FILTER, filter)
GL.TexImage2D(GL::TEXTURE_RECTANGLE_EXT, 0, GL::RGBA,
texPNG['width'], texPNG['height'],
0, GL::RGBA, GL::UNSIGNED_BYTE,
texPNG['data'])
GL.Begin(GL::QUADS)
GL.TexCoord(0, 0)
GL.Vertex(xmin, ymin)
GL.TexCoord(100, 0)
GL.Vertex(xmax, ymin)
GL.TexCoord(100, 100)
GL.Vertex(xmax, ymax)
GL.TexCoord(0, 100)
GL.Vertex(xmin, ymax)
GL.EndI've taken out everything but the texturing code.
When drawn, all I get is a white squares, even with a solid color texture.
If I replace the TEXTURE_RECTANGLE_EXT with TEXTURE_2D, and change the texturing coordinates it works correctly.
On the other hand, I went to one of my programs in C and and tried to use GL_RECTANGLE_EXT and it told me it was undefined. Is there some special header needed? I also remember hearing that you need to load extensions explicitly, is this true?
GL_RECTANGLE_EXT should be in <OpenGL/glext.h>
*Smacks forehead again* Once again, after spending an hour looking for the problem, I find it shortly after posting.
I had simply missed a line in one of the files that set the texture target back to TEXTURE_2D.
Anyway, a new question. Is GL_TEXTURE_RECTANGLE_EXT supported cross platform? If it is, I should mention to Keith to add it.
Josh: Thanks, the Apple docs didn't mention any extra includes.
I had simply missed a line in one of the files that set the texture target back to TEXTURE_2D.
Anyway, a new question. Is GL_TEXTURE_RECTANGLE_EXT supported cross platform? If it is, I should mention to Keith to add it.
Josh: Thanks, the Apple docs didn't mention any extra includes.
NV_texture_rectangle, EXT_texture_rectangle, ARB_texture_rectangle, all the same thing. I can add the constant to the file if you want
OneSadCookie Wrote:NV_texture_rectangle, EXT_texture_rectangle, ARB_texture_rectangle, all the same thing. I can add the constant to the file if you want
I don't see why it shouldn't be made official.

