Sign in to follow this  
ne_coco

problem with loading HDR image using pbrt

Recommended Posts

ne_coco    100
Hi everyone
I'm trying to load an HDR image into my program using pbrt libaray( 3rdparty), I include the associated libraries in "Additional include directories" of my solution. I'm using visual studio 2010. here is my code to load the image:
bool loadTexture(const char *path)
{
Imf::Rgba * pixelBuffer;
GLuint width;
GLuint height;
try
{
Imf::RgbaInputFile in(path);

Imath::Box2i win = in.dataWindow();
width = win.max.x - win.min.x+1;
height = win.max.y - win.min.y+1;
Imath::V2i dim(win.max.x - win.min.x + 1,
win.max.y - win.min.y + 1);

pixelBuffer = new Imf::Rgba[dim.x * dim.y];


int dx = win.min.x;
int dy = win.min.y;

int order = in.lineOrder();

in.setFrameBuffer(pixelBuffer - dx - (dy * dim.x), 1, dim.x);
in.readPixels(win.min.y, win.max.y);
}
catch(Iex::BaseExc & e)
{
std::cerr << e.what() << std::endl;

delete[]pixelBuffer;
return false;
}
//GLuint texture;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D /*GL_TEXTURE_RECTANGLE*/, texture);

glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_WRAP_T, GL_CLAMP);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

glTexImage2D(GL_TEXTURE_2D , 0, GL_RGBA16F, width, height, 0, GL_RGBA, GL_HALF_FLOAT, pixelBuffer);

delete[]pixelBuffer;
return true;


}

I got this linking errors:
error LNK1120:7 unresoved externals
error LNK2019:unresoved external symbol "int_cdecl Imf::globalTreadCount(void)(?globalTreadCount@Imf@@yahXZ)refrenced in function "bool_cdeclloadTexture(char const*)"(?loadTexture@@YA_NPBD@Z)
And 4 more linker errors like this.

Thanks in advance! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

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