Advertisement

Building Cube Maps

Started by September 19, 2003 12:56 AM
4 comments, last by adam17 21 years, 5 months ago
i keep getting this error:

--------------------Configuration: OGL Window - Win32 Release--------------------
Compiling...
main.cpp
C:\Adam\Software\Visual C++\OGL Window\main.cpp(272) : error C2664: 'glBindTexture' : cannot convert parameter 2 from 'unsigned int (*)[6][100][100][1]' to 'unsigned int'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.
Creating browse info file...

OGL Window.exe - 1 error(s), 0 warning(s)
  
i have the line written as "glBindTexture(GL_TEXTURE_CUBE_MAP_EXT, &cubemap);" "cubemap" is defined as "GLuint cubemap[6][100][100][1]" im loading the pictures individually using the ipicture code and the BuildTexture() function. then i load them into the array. the array is set up like this: GLuint variable[num_cube_sides][height][width][mipmapping(if any)]. any ideas what i could do to fix this? thanks -adam [edited by - adam17 on September 19, 2003 2:00:04 AM]
Try it with glBindTexture(GL_TEXTURE_CUBE_MAP_EXT, *cubemap);
With & you''re accessing the address of you cubemap array block.

PS: Why do you use a 4D (okay, okay, actually it is a 3D) array??

--------------------------------------------------------

"If it looks good, it is good computer graphics"
"If it looks like computer graphics, it is bad computer graphics"

Corrail
corrail@gmx.at
ICQ#59184081
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
Advertisement
You got zhe whole thing a bit wierd.

First create new texture using
glGenTextures(1, &texID); 


Then you bind texture like any other:
glBindTexture( GL_TEXTURE_CUBE_MAP_ARB, texID ); 


Then upload all 6 faces like:
for 0 to 5 :   load image   set any glTexParameteri( GL_TEXTURE_CUBE_MAP_ARB, , ... ); you need   glTexImage2D( cubeMapDirection[ side ], ...} 


where cubeMapDirection is list of directions : GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,...



You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
@Darkwing

But you can only set texture options for each cube map, not for each face of it, don't you?

--------------------------------------------------------

"If it looks good, it is good computer graphics"
"If it looks like computer graphics, it is bad computer graphics"

Corrail
corrail@gmx.at
ICQ#59184081

[edited by - Corrail on September 20, 2003 6:42:59 AM]
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
BindTexture only takes a single int (signed or unsigned).

and lose the &

glBindTexture(GL_TEXTURE_CUBE_MAP_EXT, cubemap);
@Corrail : Yes, you''re right. My mistake.

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.

This topic is closed to new replies.

Advertisement